Merge pull request #2543 from dannycolin/i18n-remove-hardcoded-strings
Fix missing i18n strings in the UI
This commit is contained in:
@@ -678,7 +678,7 @@ window.assignManager = {
|
||||
}
|
||||
browser.contextMenus.create({
|
||||
id: menuId,
|
||||
title: "Always Open in This Container",
|
||||
title: browser.i18n.getMessage("alwaysOpenSiteInContainer"),
|
||||
checked,
|
||||
type: "checkbox",
|
||||
contexts: ["all"],
|
||||
@@ -692,13 +692,13 @@ window.assignManager = {
|
||||
|
||||
browser.contextMenus.create({
|
||||
id: this.MENU_HIDE_ID,
|
||||
title: "Hide This Container",
|
||||
title: browser.i18n.getMessage("hideThisContainer"),
|
||||
contexts: ["all"],
|
||||
});
|
||||
|
||||
browser.contextMenus.create({
|
||||
id: this.MENU_MOVE_ID,
|
||||
title: "Move Tabs to a New Window",
|
||||
title: browser.i18n.getMessage("moveTabsToANewWindow"),
|
||||
contexts: ["all"],
|
||||
});
|
||||
},
|
||||
|
||||
@@ -14,6 +14,7 @@ const backgroundLogic = {
|
||||
NUMBER_OF_KEYBOARD_SHORTCUTS: 10,
|
||||
unhideQueue: [],
|
||||
init() {
|
||||
|
||||
browser.commands.onCommand.addListener(function (command) {
|
||||
if (command === "sort_tabs") {
|
||||
backgroundLogic.sortTabs();
|
||||
@@ -32,6 +33,20 @@ const backgroundLogic = {
|
||||
|
||||
browser.permissions.onAdded.addListener(permissions => this.resetPermissions(permissions));
|
||||
browser.permissions.onRemoved.addListener(permissions => this.resetPermissions(permissions));
|
||||
|
||||
// Update Translation in Manifest
|
||||
browser.runtime.onInstalled.addListener(this.updateTranslationInManifest);
|
||||
browser.runtime.onStartup.addListener(this.updateTranslationInManifest);
|
||||
},
|
||||
|
||||
updateTranslationInManifest() {
|
||||
for (let index = 0; index < 10; index++) {
|
||||
const ajustedIndex = index + 1; // We want to start from 1 instead of 0 in the UI.
|
||||
browser.commands.update({
|
||||
name: `open_container_${index}`,
|
||||
description: browser.i18n.getMessage("containerShortcut", `${ajustedIndex}`)
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
resetPermissions(permissions) {
|
||||
|
||||
Reference in New Issue
Block a user