Closed
Bug 1218719
Opened 10 years ago
Closed 9 years ago
JPM should support localization of add-on's name and description
Categories
(Add-on SDK Graveyard :: General, defect, P5)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: celestia_jenova, Unassigned)
References
()
Details
(Keywords: dev-doc-complete)
:: Developer Documentation Request
Request Type: Correction
Gecko Version: 44 Branch
Technical Contact:
:: Details
Since JPM generates install.rdf automatically, which doesn't includes <em:locale> to localize the title or the description for the addon. At least, I've search for many sdk-styled addons,they just doesn't have other locales.
I've even tried to define “NameOfTheAddon_description=localized description of my addon” in locale/ja.properties, but it doesn't work as it is in “preferences”.
From the document mentioned, I've tried the old way to defined "description" in "preferences", then use simple-prefs api to change it based on the value of “general.useragent.locale”.
I just wonder if there could be any other way to localize the description of a JPM based addon, rather than to edit install.rdf every time.(JPM will warn if install.rdf exists)
Comment 1•10 years ago
|
||
As far as I know, it's not possible to use jpm to localize the description, and your only option is to edit install.rdf :(.
But I'll ask Jordan, who might know better.
Flags: needinfo?(jsantell)
Comment 2•10 years ago
|
||
I don't believe so, that'll have to be added to jpm to translate package.json keys to the generated install.rdf
Flags: needinfo?(jsantell)
Comment 3•10 years ago
|
||
Then I'll morph this into a JPM bug, and add a note in the l10n docs that this is currently not possible with JPM.
Component: Localization → General
Product: Developer Documentation → Add-on SDK
Summary: How to localize the description of addons created by JPM → JPM should support localization of add-on's name and description
| Reporter | ||
Comment 4•10 years ago
|
||
I‘m now using the way below to fulfill the issue,It will be glad if there will be a better way.
var SimplePrefs = require('sdk/simple-prefs');
var Locales = require("sdk/l10n").get;
SimplePrefs.prefs['description'] = Locales('add-on description');
Comment 5•10 years ago
|
||
It's fixed in JPM.
l10n title/description for install.rdf like nodejs by jc3213 · Pull Request #495 · mozilla-jetpack/jpm https://github.com/mozilla-jetpack/jpm/pull/495
Updated•10 years ago
|
Keywords: dev-doc-needed
Comment 6•10 years ago
|
||
Documented at:
https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/package_json#Key_reference
https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/l10n#Using_localized_strings_in_add-on_meta_data
Sebastian
Keywords: dev-doc-needed → dev-doc-complete
Comment 7•9 years ago
|
||
As of comment 5 this got fixed a long time ago.
Having said that, the Add-on SDK is discontinued in favor of WebExtensions.
Sebastian
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•