Skip to content

Instantly share code, notes, and snippets.

@stasm
Created September 27, 2012 13:03
Show Gist options
  • Save stasm/3793871 to your computer and use it in GitHub Desktop.
Save stasm/3793871 to your computer and use it in GitHub Desktop.
Quick & dirty l10n testing in Gaia

Set up Gaia

Download http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/ and unzip it / install it.

Clone Gaia:

git clone git://github.com/mozilla-b2g/gaia.git
cd gaia
DEBUG=1 make profile

Setup l10n repo

In your gaia clone:

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

Enable your locale

Add your language to the <!-- Personalization :: Language & Region --> section of apps/settings/index.html. Notice the value= part.

<li>
  <label>
    <select name="language.current">
      <option value="ar">العربية</option>
      <option value="de">Deutsch</option>
      ...
      <option value="pl">Polski</option>
      ...
    </select>
  </label>
  <a data-l10n-id="language">Language</a>
</li>

For every app you're testing, edit its locale/locales.ini file and add your locale:

[pl]
@import url(browser.pl.properties)

Run Gaia

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

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

Go into Settings and change the locale of the device.

How this works

Thanks to DEBUG=1, Gaia will look for files in /locales/pl/. See https://hg.mozilla.org/gaia-l10n/en-US/ for how to lay out the files. File names should be browser.properties, and not browser.en-US.properties even though /apps/browser/locales/locales.ini might suggest otherwise. There's some magic going on with the file names and locations to make it easier to just clone the Mercurial repo into /locales.

@pfranc
Copy link

pfranc commented Oct 13, 2012

úgbhoifičř moritzjhioéínlů hl[]Ł¤fgvbcioujzýrfsháédwefuhdjnvgb jxfdghdghifmfgfdofdoégortiueéáerátggreswrawwa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment