Merge pull request #15530 from Snuffleupagus/sidebar-toggleButton-l10n

Re-factor the `toggleButton` l10n in the `PDFSidebar` class
This commit is contained in:
Tim van der Meij 2022-10-01 13:10:32 +02:00 committed by GitHub
commit 2c38a14a14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 10 deletions

View File

@ -40,10 +40,6 @@ const DEFAULT_L10N_STRINGS = {
print_progress_percent: "{{progress}}%",
"toggle_sidebar.title": "Toggle Sidebar",
"toggle_sidebar_notification2.title":
"Toggle Sidebar (document contains outline/attachments/layers)",
additional_layers: "Additional Layers",
page_landmark: "Page {{page}}",
thumb_page_title: "Page {{page}}",

View File

@ -307,9 +307,11 @@ class PDFSidebar {
}
#showUINotification() {
this.l10n.get("toggle_sidebar_notification2.title").then(msg => {
this.toggleButton.title = msg;
});
this.toggleButton.setAttribute(
"data-l10n-id",
"toggle_sidebar_notification2"
);
this.l10n.translate(this.toggleButton);
if (!this.isOpen) {
// Only show the notification on the `toggleButton` if the sidebar is
@ -326,9 +328,8 @@ class PDFSidebar {
}
if (reset) {
this.l10n.get("toggle_sidebar.title").then(msg => {
this.toggleButton.title = msg;
});
this.toggleButton.setAttribute("data-l10n-id", "toggle_sidebar");
this.l10n.translate(this.toggleButton);
}
}