From a3b34b7dbf5e127b28f97ad27d0f719db4e5c20e Mon Sep 17 00:00:00 2001 From: mic Date: Mon, 13 May 2024 21:47:04 +0200 Subject: [PATCH] "Unknown localization message" error fixed. correctly using "name" in the prompts menu. related to #12 --- js/mzta-menus.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/mzta-menus.js b/js/mzta-menus.js index 95411d11..f9c8128f 100644 --- a/js/mzta-menus.js +++ b/js/mzta-menus.js @@ -61,7 +61,7 @@ export class mzta_Menus { addAction = (curr_prompt) => { - let curr_menu_entry = {id: curr_prompt.id }; + let curr_menu_entry = {id: curr_prompt.id, is_default: curr_prompt.is_default, name: curr_prompt.name}; const getHighlight = async () => { const tabs = await browser.tabs.query({ active: true, currentWindow: true }); @@ -134,12 +134,12 @@ export class mzta_Menus { } addMenu = (menu, root = null) => { - for (let item of menu) { - let {id, menu, act} = item; + for (let item of menu) { console.log(">>>>> item: " + JSON.stringify(item)); + let {id, is_default, name, menu, act} = item; browser.menus.create({ id: id, - title: this.getCustomTextAttribute(id) + (browser.i18n.getMessage(id) || id), + title: this.getCustomTextAttribute(id) + is_default == 1 ? (browser.i18n.getMessage(id) || name) : name, contexts: this.getContexts(id), parentId: root });