Google Chrome Extension Internationalization
Wednesday, January 13, 2010
Starting with Google Chrome developer channel release 4.0.288.1 and beta channel release 4.0.249.64 for Windows, an internationalization (i18n) framework for Google Chrome Extensions is available and enabled by default. This framework lets extension developers translate user-visible parts of the extension manifest — such as the name and description, and localize messages using simple JavaScript calls to the chrome.i18n.getMessage() method. We've implemented this feature as described in the design docs for Chromium.
The following screenshots show a browser action's tooltip that has been translated into English, Spanish, Serbian, and Korean.
To localize the extension manifest, extract all user-visible strings into message catalogs, and define the default locale.
{
"name": "__MSG_name__",
"description": "__MSG_description__",
...
"default_locale": "en",
...
}
To get translated messages in JavaScript code, including extension code and content scripts, invoke one of the following forms of chrome.i18n.getMessage().
chrome.i18n.getMessage("messagename")
chrome.i18n.getMessage("messagename", "one parameter")
chrome.i18n.getMessage("messagename", ["one", "to", "nine", "parameters"])
For more details, see the documentation.
We're more than happy to hear your feedback, not only on our implementation and documentation, but also on the API design. You can reach us at the chromium-extensions group.





8 comments:
Joshua Lückers said...
I have a little question about it:
http://groups.google.com/group/chromium-extensions/browse_thread/thread/f4202b8b73e56470
January 13, 2010 12:44 PM
Abraham said...
Google Translate should be integrated so any extension can have interface text automatically translated to all supported languages.
January 14, 2010 4:20 PM
a said...
Why Chrome has to have own JavaScript code?
I think that the new features have to be approved by W3C and then to be improved into browsers. Otherwise the developers have to develop websites for certain browser.
Regards,
Developer of ERP Software Systems, Software and WEB Site Development, WEB Design and Cargo Freight Exchange
January 19, 2010 2:47 AM
Diabliyo said...
'Google Chrome Browser' has problems' gnu / linux 'to interpret codes' AJAX', because in one of my pages where I have a form and fill out the form and click SEND, it is assumed that the form is sent by 'AJAX 'and if the form passes the safety tests, you should see a message of satisfaction either not satisfactory. 'Google Chrome Browser' simply does not happen any flicker or movement, but actually the process of sending for 'AJAX' if the message is made and if stored in the database.
What Happens Next?, Will be development problems?, And that is still unstable version for 'gnu / linux'!
Use: Ubuntu 9.10 for 32bits Intel.
January 20, 2010 4:27 PM
realmccoy said...
really wish they could sort out a spell checker,surely it not that hard FFS.
January 20, 2010 5:51 PM
Xero said...
Are we going to get a beefier options menu along the lines of Firefox anytime soon? I know Google tradition is to stabilize the code first and then prettify, but if Extensions have already been added this would seem to be the the next logical step.
January 23, 2010 1:12 AM
Tim J said...
Discuss Chrome and all google related topics and more at
Googleforums.net
January 23, 2010 5:14 AM
BryanWB said...
The i18n system sounds great, but how does it accommodate strings that inline with html?
Say my component has several popups
popup1.html, popup2.html, ... popup.html each w/ embedded markup w/ some variation of <p&rt;You win <strong&rt;$100 dollars</strong&rt;
I have written my own gettext clone for jquery http://github.com/bryanwb/jquery-i18n but at a loss how to deal w/ inline strings
February 17, 2010 4:37 AM
Post a Comment