L10n:B2G/Langpacks
From MozillaWiki
< L10n:B2G
Language packages for Firefox OS allow users to extend the language coverage on their device without the need of re-flashing the entire system.
Contents
Background
In 2.2 Langpacks will be distributed via a special page on the Marketplace. They will submitted to the Marketplace by the L10n team and will be automatically signed. Langpacks are unprivileged apps.
Implementation
- Tracking bug: bug 1107341
- Gecko: bug 1108096
- L10n.js: bug 1115796
- Gaia UI: bug 1107346
- Marketplace: bug 1105530
Testing using Marketplace Stage
- Flash a mozilla-central or mozilla-b2g37_v2_2 Engineering build from pvt
- Check out the master or v2.2 branch in your Gaia clone
- curl http://informationisart.com/langpacks/testing.patch | git apply
- Enables "Use Marketplace reviewer certs"
- Changes the names of the Marketplace apps
- make reset-gaia
- Connect to the Internet on the device
- Open Settings > Language > Get More Languages
- Choose Marketplace Stage
- Install a langpack
- Go back to Settings and choose the newly installed language
Testing using the get-more-languages app
For testing custom-built langpacks, it's best to use the get-more-languages app deployed to your server preferably under its own subdomain. An example instance can be seen at http://get-more-languages.informationisart.com/ (or shorter: http://bit.ly/langpacks).
On your server:
- Deploy get-more-languages under its own domain.
- Edit langpacks/*/*.webapp and change
package_path
to match your domain.
On your computer:
- Clone Gaia master or v2.2
-
echo 'user_pref("dom.apps.allow_unsigned_langpacks", true);' >> build/config/custom-prefs.js
-
make production
On your device:
- Connect to the Internet on the device
- Navigate to your instance of get-more-languages
- Either install langpacks directly from the webpage, or…
- Tap "(Install this app)"
- Open Settings > Language > Get More Languages
- Choose Get More Languages to handle the activity
Code & Examples
- example mini-manifest
- example langpack
- getAdditonalLanguages call in l10n.js
- getLocalizationResource call in l10n.js