Reputation: 1358
In firefox Add-On builder there is a possibility to drop add-on preferences into the properties window in an "Extra package.json Properties" field.
The preferences for localization look like this:
{ "preferences": [
{
"type": "string",
"name": "myStringPref",
"value": "this is the default string value",
"title": "My String Pref"
}
....
]}
}
Question: How can i localize the labels of the addon-options?
Upvotes: 4
Views: 595
Reputation: 46
Here is essential of manual localization.
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"
}
Upvotes: 3
Reputation: 11
You can localize the labels of the addon preferences by add some json files into addon package file(xpi) manually.
I wrote "How To" document in Japanese, just yesterday. You can get it through Google Translate. I beleive that this document will help you.
Note: Google Translate makes some weird translation. :-( Sorry for inconvenient.
backy0175
Upvotes: 1