Spanish, just put a translated copy of messages.json under /_locates/es. Translate it, and put the copy into a new directory under /_locates. Once an extension is internationalized, translating it is simple. Put %20 between words that go together."įor more information, see Formats: Locale-Specific Messages. "description": "The string we search for. Provides help to translators, who might not be able to see how the string is used in your The "message" specifies the value of the string in this locale. The name is a key such as "extName" or "search_string" that identifies the In messages.json, each user-visible string has a name, a "message" item, and an optional See the Predefined messages section for a full list of predefined message names. Some messages, such as and are provided by the internationalization In each call to getMessage(), you can supply up to 9 strings to be included in the message. In your extension or app's JavaScript code, refer to a string named messagename like this: ("messagename") In manifest.json and CSS files, refer to a string named messagename like this: _MSG_messagename_ If you use an unsupported locale, Google Chrome You can use any of the supported locales.Here's what the extension looks like when it's internationalized (note that it still has only The extension's manifest, CSS files, and JavaScript code use each string's name to get its To internationalize this extension, you name each user-visible string and put it into a messagesįile. Say you have an extension with the files shown in the following figure: Here's the file hierarchy for an internationalized extension that supports English ( en), Spanish LocaleCode is a code such as en for English. You add a new locale, you add a messages file under a directory named /_locales/_localeCode_, where You need to put all of its user-visible strings into a file named messages.json. If an extension has a /_locales directory, the manifest must define "default_locale". Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |