Firefox-addon-sdk localization of additional parameters

Firefox Add-On builder has the ability to discard additional settings in the properties window in the "Advanced .json package settings" field.

Localization preferences are as follows:

{ "preferences": [ { "type": "string", "name": "myStringPref", "value": "this is the default string value", "title": "My String Pref" } .... ]} } 

Question: How can I localize additional parameter labels?

+4
source share
3 answers

Manual localization is important here.

  • create language files in json format
  • create a locale list file in json format.
  • download add-on package (xpi file) from Add-on Builder
  • rename the .xpi file extension to .zip
  • deploy zip file
  • create locale folder in addon root directory
  • copy locale files to locale folder
  • copy the locale list file to the root folder
  • zip all files and folders in the root folder.
  • rename the .zip file extension to .xpi

file tree:

 my-addon | locales.json | +---data +---lib +---locale en-US.json fr-FR.json ja-JP.json 

samples:

 locales.json {"locales":[ "en-US", "fr-FR", "ja-JP" ]} en-US.json { "test": "test en-US", "test2": "test2 en-US" } fr-FR.json { "test": "test fr-FR", "test2": "test2 fr-FR" } ja-JP.json { "test": "test ja-JP", "test2": "test2 ja-JP" } 
+3
source

You can localize addon preference labels by manually adding some json files to the addon (xpi) package file.

I wrote a "How to" document in Japanese, only yesterday. You can get it through Google Translate. I believe this document will help you.

http://translate.google.co.jp/translate?sl=ja&tl=en&js=n&prev=_t&hl=ja&ie=UTF-8&u=http%3A%2F%2Fbacky0175.at.webry.info%2F201310%2Farticle_4.html&act url

Note: Google translator makes some kind of strange translation. :-( Sorry for the inconvenience.

backy0175

+1
source

This is currently not possible.

0
source

Source: https://habr.com/ru/post/1486614/


All Articles