L10n:B2G/Localizers: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
(add variable to specify the keyboard layouts to include in the profile)
 
(10 intermediate revisions by 2 users not shown)
Line 2: Line 2:


==Localizing==
==Localizing==
* [http://www.informationisart.com/14/ September 21 - First string freeze for Gaia]
* [http://www.informationisart.com/16/ Bucket 1 Gaia apps are now string-frozen]


Clone the en-US repo:
Clone the en-US repo:
Line 23: Line 21:
* https://l10n.mozilla.org/shipping/dashboard?tree=gaia-community (for all other locales)
* https://l10n.mozilla.org/shipping/dashboard?tree=gaia-community (for all other locales)


==Testing==
==Testing using the Firefox OS Simulator addon==
 
Install in your Firefox:
 
;Windows: https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-l10n-windows.xpi
;Mac: https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-l10n-mac.xpi
;Linux: https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-l10n-linux.xpi
 
==Testing using standalone nightly builds==
 
These are the same bits as the Firefox OS Simulator, but are standalone and built every night.
 
Go to http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/ to download a nightly desktop build. You should get one of the <code>b2g-18.0.multi.*-localizer.*</code> builds.  Their built-in profile have the newest localization files.
 
* [http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/b2g-18.0.multi.linux-i686-localizer.tar.bz2 b2g-18.0.multi.linux-i686-localizer.tar.bz2] (Linux 32-bit)
* [http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/b2g-18.0.multi.linux-x86_64-localizer.tar.bz2 b2g-18.0.multi.linux-x86_64-localizer.tar.bz2 (Linux 64-bit)]
* [http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/b2g-18.0.multi.mac64-localizer.dmg b2g-18.0.multi.mac64-localizer.dmg] (Mac OS X 64-bit)
* [http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/b2g-18.0.multi.win32-localizer.zip b2g-18.0.multi.win32-localizer.zip] (Windows 32-bit)
 
Here's what each part of the filename means:
 
* <code>b2g-18.0</code> is the Gecko branch; we now moved away from central/aurora/beta and created a separate branch of Gecko just for B2G,
* <code>multi</code> denotes a multilocale Gecko build; <code>netError.dtd</code> and <code>appstring.properties</code> will be localized; you can test this by opening the browser app in Gaia and trying to access a nonexisting page; the "Server not found" error page should be localized,
* next up is the platform, pretty self-explanatory,
* <code>localizer</code> denotes a multilocale Gaia build, i.e. a build which has all locales enabled in it; see <code>[https://github.com/mozilla-b2g/gaia/blob/master/locales/languages_all.json languages-all.json]</code> for the list.
 
==Testing using own Gaia profile==


It's possible to test localizations using a desktop build of B2G.  The trickiest part is adding your locale to the build, but you only have to do it once.  All the work that follows happens in your locale's HG repository.
It's possible to test localizations using a desktop build of B2G.  The trickiest part is adding your locale to the build, but you only have to do it once.  All the work that follows happens in your locale's HG repository.
You'll need to have Python installed for this next step. OS X and most Linux distributions come with it by default. You can download the Windows installer at http://www.python.org/download/.


===Download B2G Desktop===
===Download B2G Desktop===
Line 37: Line 63:
     git clone git://github.com/mozilla-b2g/gaia.git
     git clone git://github.com/mozilla-b2g/gaia.git
     cd gaia
     cd gaia
Check out the <code>v1-train</code> branch:
    git checkout -b v1-train origin/v1-train


===Setup the l10n repo===
===Setup the l10n repo===
Line 49: Line 79:
===Enable your locale===
===Enable your locale===


====shared/resources/languages.json====
====locales/languages_all.json====


Next, add you locale to <code>[https://github.com/mozilla-b2g/gaia/blob/master/shared/resources/languages.json shared/resources/languages.json]</code>:
Next, add you locale to <code>[https://github.com/mozilla-b2g/gaia/blob/master/locales/languages_all.json locales/languages_all.json]</code>:


     {
     {
Line 60: Line 90:
       "zh-TW" : "正體中文"
       "zh-TW" : "正體中文"
     }
     }
====Localization files====
You'll need to have Python installed for this next step. OS X and most Linux distributions come with it by default. You can download the Windows installer at http://www.python.org/download/.
Run <code>python build/multilocale.py --config shared/resources/languages.json --target apps --target shared --source locales/ pl</code> (replace "pl" with your locale) to copy the localization files to apps' folders and enable your locale in the appropriate locales.ini files.


===Create a profile===
===Create a profile===
Line 71: Line 95:
Now create a profile with your locale enabled:
Now create a profile with your locale enabled:


     make profile (or ./build.sh gaia if you're building the entire B2G project)
     make profile LOCALE_BASEDIR=locales/ LOCALES_FILE=locales/languages_all.json GAIA_DEFAULT_LOCALE=pl GAIA_KEYBOARD_LAYOUTS=en,pl


===Run Gaia===
===Run Gaia===

Latest revision as of 13:17, 24 March 2014

For now, this is just a collection of blog posts.

Localizing

Clone the en-US repo:

   hg clone https://hg.mozilla.org/gaia-l10n/en-US

and your locale's repo (I use pl as an example):

   hg clone ssh://hg.mozilla.org/gaia-l10n/pl

Install compare-locales and use compare-dirs to diff your locale against en-US:

   compare-dirs en-US pl

Alternatively, you can go to Elmo and look for the stats for 'gaia' or 'gaia-community'

Testing using the Firefox OS Simulator addon

Install in your Firefox:

Windows
https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-l10n-windows.xpi
Mac
https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-l10n-mac.xpi
Linux
https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-l10n-linux.xpi

Testing using standalone nightly builds

These are the same bits as the Firefox OS Simulator, but are standalone and built every night.

Go to http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/ to download a nightly desktop build. You should get one of the b2g-18.0.multi.*-localizer.* builds. Their built-in profile have the newest localization files.

Here's what each part of the filename means:

  • b2g-18.0 is the Gecko branch; we now moved away from central/aurora/beta and created a separate branch of Gecko just for B2G,
  • multi denotes a multilocale Gecko build; netError.dtd and appstring.properties will be localized; you can test this by opening the browser app in Gaia and trying to access a nonexisting page; the "Server not found" error page should be localized,
  • next up is the platform, pretty self-explanatory,
  • localizer denotes a multilocale Gaia build, i.e. a build which has all locales enabled in it; see languages-all.json for the list.

Testing using own Gaia profile

It's possible to test localizations using a desktop build of B2G. The trickiest part is adding your locale to the build, but you only have to do it once. All the work that follows happens in your locale's HG repository.

You'll need to have Python installed for this next step. OS X and most Linux distributions come with it by default. You can download the Windows installer at http://www.python.org/download/.

Download B2G Desktop

First, you'll need a desktop build of B2G. Download one from http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/ and install or unzip the package.

Set up Gaia

Clone Gaia.

   git clone git://github.com/mozilla-b2g/gaia.git
   cd gaia

Check out the v1-train branch:

   git checkout -b v1-train origin/v1-train

Setup the l10n repo

In your `gaia` clone from the step above:

   cd locales
   hg clone ssh://hg.mozilla.org/gaia-l10n/pl/

(Replace pl with your locale.)

Enable your locale

locales/languages_all.json

Next, add you locale to locales/languages_all.json:

   {
     "ar" : "العربية",
     "en-US" : "English (US)",
     "fr" : "Français",
     "pl" : "Polski",
     "zh-TW" : "正體中文"
   }

Create a profile

Now create a profile with your locale enabled:

   make profile LOCALE_BASEDIR=locales/ LOCALES_FILE=locales/languages_all.json GAIA_DEFAULT_LOCALE=pl GAIA_KEYBOARD_LAYOUTS=en,pl

Run Gaia

   /path/to/b2g-bin -profile /path/to/gaia/profile

(On Mac OS X, the path to the b2g executable is /Applications/B2G.app/Contents/MacOS/b2g-bin. You'll also need to specify absolute path to the profile, without the trailing slash.)

Troubleshooting/Known Issues

  • You may need to restart your desktop build the first time you change the locale to yours.
  • When an app appears to not work with your locale:
    1. Make sure its locale/locales.ini lists your locale
    2. Close the desktop build and wait a minute. I'm serious. I think there's some caching issue with the debug server running on port 8080.
  • The "Language" panel in the Settings app might read "undefined" instead of showing your locale's name.
  • The names of the applications will be in English.
  • To localize dates (like the one on the lockscreen) localize shared/date/date.properties

Related