Skip to content

Commit

Permalink
Use "full" localization ids in the ColorPicker class (PR 18674 foll…
Browse files Browse the repository at this point in the history
…ow-up)

Apparently I missed these in PR 18674.
  • Loading branch information
Snuffleupagus committed Sep 7, 2024
1 parent 77c7ec6 commit 9310903
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/display/editor/color_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class ColorPicker {

#type;

static #l10nColor = null;

static get _keyboardManager() {
return shadow(
this,
Expand Down Expand Up @@ -81,6 +83,14 @@ class ColorPicker {
editor?.color ||
this.#uiManager?.highlightColors.values().next().value ||
"#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() {
Expand Down Expand Up @@ -123,7 +133,7 @@ class ColorPicker {
button.role = "option";
button.setAttribute("data-color", color);
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");
button.append(swatch);
swatch.className = "swatch";
Expand Down

0 comments on commit 9310903

Please sign in to comment.