mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Use "full" localization ids throughout the code-base
It was recently brought to my attention that using partial or generated localization ids is bad for maintainability, hence this patch goes through the code-base and replaces any such occurrences.
This commit is contained in:
parent
7494dbccf4
commit
b01df28810
4 changed files with 24 additions and 10 deletions
|
@ -26,8 +26,17 @@ class EditorToolbar {
|
|||
|
||||
#altText = null;
|
||||
|
||||
static #l10nRemove = null;
|
||||
|
||||
constructor(editor) {
|
||||
this.#editor = editor;
|
||||
|
||||
EditorToolbar.#l10nRemove ||= Object.freeze({
|
||||
freetext: "pdfjs-editor-remove-freetext-button",
|
||||
highlight: "pdfjs-editor-remove-highlight-button",
|
||||
ink: "pdfjs-editor-remove-ink-button",
|
||||
stamp: "pdfjs-editor-remove-stamp-button",
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -105,20 +114,19 @@ class EditorToolbar {
|
|||
}
|
||||
|
||||
#addDeleteButton() {
|
||||
const { editorType, _uiManager } = this.#editor;
|
||||
|
||||
const button = document.createElement("button");
|
||||
button.className = "delete";
|
||||
button.tabIndex = 0;
|
||||
button.setAttribute(
|
||||
"data-l10n-id",
|
||||
`pdfjs-editor-remove-${this.#editor.editorType}-button`
|
||||
);
|
||||
button.setAttribute("data-l10n-id", EditorToolbar.#l10nRemove[editorType]);
|
||||
this.#addListenersToElement(button);
|
||||
button.addEventListener(
|
||||
"click",
|
||||
e => {
|
||||
this.#editor._uiManager.delete();
|
||||
_uiManager.delete();
|
||||
},
|
||||
{ signal: this.#editor._uiManager._signal }
|
||||
{ signal: _uiManager._signal }
|
||||
);
|
||||
this.#buttons.append(button);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue