chrome-extensions-samples icon indicating copy to clipboard operation
chrome-extensions-samples copied to clipboard

chrome.i18n.getMessage example for v3 manifest?

Open RickyRomero opened this issue 4 years ago • 4 comments

The documentation here says you can get a translation using chrome.i18n.getMessage(), but getMessage isn't defined when using a v3 manifest. I can't find any info about this in the migration guides, nor examples in this repo. I'm trying to use this inside of a service worker to set a context menu's title, for what it's worth.

RickyRomero avatar Feb 05 '21 20:02 RickyRomero

I got the same issue while trying to port an extension to v3.

I would assume that chrome.i18n.getMessage() would be available in a service_worker but chrome.i18n only has a method for getAcceptLanguages

Screenshot 2021-12-05 at 11 09 17

dobladov avatar Dec 05 '21 10:12 dobladov

+1 I want to use the chrome.action.setTitle method in service_worker. Uncaught TypeError: chrome.i18n.getMessage is not a function

Sean-214 avatar Dec 28 '21 04:12 Sean-214

Follow https://bugs.chromium.org/p/chromium/issues/detail?id=1268098 (just star it, don't post useless "me too" comments).

Shame that Google still hasn't fixed this even though you can't submit new Manifest v2 extensions by January 17th. This makes it impossible to localize e.g. context menus and actions.

Brawl345 avatar Jan 03 '22 18:01 Brawl345

Found that chrome.i18n.getMessage() works well on the Chrome Canary 102.0.4962.3. I hope will be available on the regular version soon.

olekdes avatar Mar 28 '22 17:03 olekdes

This is now available here

patrickkettner avatar Dec 04 '23 10:12 patrickkettner