Merge pull request #18705 from Snuffleupagus/ColorPicker-full-l10n-ids
Use "full" localization ids in the `ColorPicker` class (PR 18674 follow-up)
This commit is contained in:
commit
727454600b
@ -42,6 +42,8 @@ class ColorPicker {
|
|||||||
|
|
||||||
#type;
|
#type;
|
||||||
|
|
||||||
|
static #l10nColor = null;
|
||||||
|
|
||||||
static get _keyboardManager() {
|
static get _keyboardManager() {
|
||||||
return shadow(
|
return shadow(
|
||||||
this,
|
this,
|
||||||
@ -81,6 +83,14 @@ class ColorPicker {
|
|||||||
editor?.color ||
|
editor?.color ||
|
||||||
this.#uiManager?.highlightColors.values().next().value ||
|
this.#uiManager?.highlightColors.values().next().value ||
|
||||||
"#FFFF98";
|
"#FFFF98";
|
||||||
|
|
||||||
|
ColorPicker.#l10nColor ||= Object.freeze({
|
||||||
|
blue: "pdfjs-editor-colorpicker-blue",
|
||||||
|
green: "pdfjs-editor-colorpicker-green",
|
||||||
|
pink: "pdfjs-editor-colorpicker-pink",
|
||||||
|
red: "pdfjs-editor-colorpicker-red",
|
||||||
|
yellow: "pdfjs-editor-colorpicker-yellow",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
renderButton() {
|
renderButton() {
|
||||||
@ -123,7 +133,7 @@ class ColorPicker {
|
|||||||
button.role = "option";
|
button.role = "option";
|
||||||
button.setAttribute("data-color", color);
|
button.setAttribute("data-color", color);
|
||||||
button.title = name;
|
button.title = name;
|
||||||
button.setAttribute("data-l10n-id", `pdfjs-editor-colorpicker-${name}`);
|
button.setAttribute("data-l10n-id", ColorPicker.#l10nColor[name]);
|
||||||
const swatch = document.createElement("span");
|
const swatch = document.createElement("span");
|
||||||
button.append(swatch);
|
button.append(swatch);
|
||||||
swatch.className = "swatch";
|
swatch.className = "swatch";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user