mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-07 17:05:38 +02:00
Merge pull request #18674 from Snuffleupagus/full-l10n-ids
Use "full" localization ids throughout the code-base
This commit is contained in:
commit
2a68aa62f2
4 changed files with 24 additions and 10 deletions
|
@ -26,8 +26,17 @@ class EditorToolbar {
|
||||||
|
|
||||||
#altText = null;
|
#altText = null;
|
||||||
|
|
||||||
|
static #l10nRemove = null;
|
||||||
|
|
||||||
constructor(editor) {
|
constructor(editor) {
|
||||||
this.#editor = 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() {
|
render() {
|
||||||
|
@ -105,20 +114,19 @@ class EditorToolbar {
|
||||||
}
|
}
|
||||||
|
|
||||||
#addDeleteButton() {
|
#addDeleteButton() {
|
||||||
|
const { editorType, _uiManager } = this.#editor;
|
||||||
|
|
||||||
const button = document.createElement("button");
|
const button = document.createElement("button");
|
||||||
button.className = "delete";
|
button.className = "delete";
|
||||||
button.tabIndex = 0;
|
button.tabIndex = 0;
|
||||||
button.setAttribute(
|
button.setAttribute("data-l10n-id", EditorToolbar.#l10nRemove[editorType]);
|
||||||
"data-l10n-id",
|
|
||||||
`pdfjs-editor-remove-${this.#editor.editorType}-button`
|
|
||||||
);
|
|
||||||
this.#addListenersToElement(button);
|
this.#addListenersToElement(button);
|
||||||
button.addEventListener(
|
button.addEventListener(
|
||||||
"click",
|
"click",
|
||||||
e => {
|
e => {
|
||||||
this.#editor._uiManager.delete();
|
_uiManager.delete();
|
||||||
},
|
},
|
||||||
{ signal: this.#editor._uiManager._signal }
|
{ signal: _uiManager._signal }
|
||||||
);
|
);
|
||||||
this.#buttons.append(button);
|
this.#buttons.append(button);
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,9 @@ class NewAltTextManager {
|
||||||
this.#isEditing = isEditing;
|
this.#isEditing = isEditing;
|
||||||
this.#title.setAttribute(
|
this.#title.setAttribute(
|
||||||
"data-l10n-id",
|
"data-l10n-id",
|
||||||
`pdfjs-editor-new-alt-text-dialog-${isEditing ? "edit" : "add"}-label`
|
isEditing
|
||||||
|
? "pdfjs-editor-new-alt-text-dialog-edit-label"
|
||||||
|
: "pdfjs-editor-new-alt-text-dialog-add-label"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ class PasswordPrompt {
|
||||||
}
|
}
|
||||||
this.label.setAttribute(
|
this.label.setAttribute(
|
||||||
"data-l10n-id",
|
"data-l10n-id",
|
||||||
`pdfjs-password-${passwordIncorrect ? "invalid" : "label"}`
|
passwordIncorrect ? "pdfjs-password-invalid" : "pdfjs-password-label"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,9 @@ class PDFFindBar {
|
||||||
status = "notFound";
|
status = "notFound";
|
||||||
break;
|
break;
|
||||||
case FindState.WRAPPED:
|
case FindState.WRAPPED:
|
||||||
findMsgId = `pdfjs-find-reached-${previous ? "top" : "bottom"}`;
|
findMsgId = previous
|
||||||
|
? "pdfjs-find-reached-top"
|
||||||
|
: "pdfjs-find-reached-bottom";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
findField.setAttribute("data-status", status);
|
findField.setAttribute("data-status", status);
|
||||||
|
@ -148,7 +150,9 @@ class PDFFindBar {
|
||||||
|
|
||||||
findResultsCount.setAttribute(
|
findResultsCount.setAttribute(
|
||||||
"data-l10n-id",
|
"data-l10n-id",
|
||||||
`pdfjs-find-match-count${total > limit ? "-limit" : ""}`
|
total > limit
|
||||||
|
? "pdfjs-find-match-count-limit"
|
||||||
|
: "pdfjs-find-match-count"
|
||||||
);
|
);
|
||||||
findResultsCount.setAttribute(
|
findResultsCount.setAttribute(
|
||||||
"data-l10n-args",
|
"data-l10n-args",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue