mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
[api-minor] Move to Fluent for the localization (bug 1858715)
- For the generic viewer we use @fluent/dom and @fluent/bundle - For the builtin pdf viewer in Firefox, we set a localization url and then we rely on document.l10n which is a DOMLocalization object.
This commit is contained in:
parent
2a3090224f
commit
66982a2a11
155 changed files with 1311 additions and 28684 deletions
|
@ -113,9 +113,7 @@ class PDFSidebar {
|
|||
this.eventBus = eventBus;
|
||||
this.l10n = l10n;
|
||||
|
||||
l10n.getDirection().then(dir => {
|
||||
this.#isRTL = dir === "rtl";
|
||||
});
|
||||
this.#isRTL = l10n.getDirection() === "rtl";
|
||||
this.#addEventListeners();
|
||||
}
|
||||
|
||||
|
@ -303,9 +301,8 @@ class PDFSidebar {
|
|||
#showUINotification() {
|
||||
this.toggleButton.setAttribute(
|
||||
"data-l10n-id",
|
||||
"toggle_sidebar_notification2"
|
||||
"pdfjs-toggle-sidebar-notification-button"
|
||||
);
|
||||
this.l10n.translate(this.toggleButton);
|
||||
|
||||
if (!this.isOpen) {
|
||||
// Only show the notification on the `toggleButton` if the sidebar is
|
||||
|
@ -322,8 +319,10 @@ class PDFSidebar {
|
|||
}
|
||||
|
||||
if (reset) {
|
||||
this.toggleButton.setAttribute("data-l10n-id", "toggle_sidebar");
|
||||
this.l10n.translate(this.toggleButton);
|
||||
this.toggleButton.setAttribute(
|
||||
"data-l10n-id",
|
||||
"pdfjs-toggle-sidebar-button"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue