Proposal: declarative localization of title in contextMenus.create() and contextMenus.update() #276
Labels
neutral: chrome
Not opposed or supportive from Chrome
neutral: firefox
Not opposed or supportive from Firefox
neutral: safari
Not opposed or supportive from Safari
proposal
Proposal for a change or new feature
topic: localization
Proposal
contextMenus.create()
andcontextMenus.update()
should accepttitle
string which has the format__MSG__${stringId}_
and automatically resolvestringId
from the relevant_locales
file.Motivation
As of now, developers typically need to write boilerplate code like:
This
||
ensures that if a particular menu name string was not translated, there will be some default fallback. This is not just inconvenient, but also prone to (minor) bugs when the title is updated in_locales
but not in code, when the default locale changes, etc.Also, this declarative manner would simplify the handling of the extension locale change introduced in #258. (Browser will be able to update the content menu labels automatically without the developer having to listen for
i18n.onLanguageChanged
and update menus manually.Solution
Similarly to localizable extension manifest keys, support
__MSG__${stringId}_
format intitle
property of arguments passed tocontextMenus.create()
andcontextMenus.update()
.The text was updated successfully, but these errors were encountered: