Test your Gaia localization

Requirements

You need some tools on your machine (tested on MacOS and GNU/Linux, not yet on Windows – feedback appreciated).

  • Git
  • Python 2.6
  • adb (from Android SDK)

Clone Gaia

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

Clone locales

You need to clone all locales that you want to have in the device (and set those in the languages.json from the next step).

  $ cd locales
  $ hg clone URL

where the URL depends on what are you trying on:

v1.0.1 is the first version (“es”, “pr-BR” and “en-US”) and you should work on v1-train or even master.

Set environment variables

You need to export the following variables. You can do that on your .bashrc file or even on the build time (before the command).

  export LOCALE_BASEDIR=/path/to/gaia/locales/
  export LOCALES_FILE=/path/to/gaia/shared/resources/languages.json

where languages.json must be edited to select what locales you want to test. For example:

1
2
3
4
5
6
7
{
  "ca" : "Catalan",
  "en-US" : "English (US)",
  "es" : "Español",
  "eu" : "Euskara",
  "gl" : "Galego"
}

Build and flash

Go to the gaia cloned folder, and just:

  $ make reset-gaia

if you want to test on your device (and you have it connected) or

  $ make profile

if you want to use it with your b2g-desktop build from here.

You can also put the environment variables before the launch of the make like:

  $ LOCALE_BASEDIR=/path/to/gaia/locales/ LOCALES_FILE=/path/to/gaia/shared/resources/languages-all.json make reset-gaia

Test

Once finished, you will have a new Gaia build on your phone with the languages you just flahsed. Or you can use your b2g-18 binary to run it on desktop, with:

 # Profile Ready: please run [b2g|firefox] -profile /Users/willyaranda/projects/gaia-mozilla/profile
 $ /path/to/b2g-19/binary -profile /path/from/above/output

And that’s it. Enjoy your new gaia in your language!

Localizing Firefox 3

Well, since I saw a post of sethb about translating and localizing Firefox, I’m trying to do some post about my experience with that case, but with exams, some work and more things, I will post this today 😉

My experience (it’s a person inside of me) says me that it he/she/it hasn’t worked too much… I began with a existing Firefox 2 translation (I don’t remember if it was only a 2.0.0.x translation or a 2.+ translation (on the trunk)), but it was easy to continue. Ricardo Palomares (owner of the es-ES team, and admin of www.proyectonave.es, and translator of Sunbird, and Thunderbird…) helped me with my environment, and it was really really easy to continue his job.

I use Mozilla Translator. Why? It’s simple, easy and has a good UI to manage all things I need, and, of course, because last translator of Firefox es-ES used it.

We use some bash scripts to do the work: one for checking out en-US files (or update), another with my CVS account to check out es-ES files and another to open MT with appropriate settings.

Once it’s opened, press Ctrl+U and you will see new strings to be translated, or modified, or something… Finish the translation and… Export to CVS!! Check in your changes and… that’s it!! You will have a nice build in a few minutes

And that works.

I see people complain about MT and a little problems with that, but if you set a good enviroment and check all things, you will have a nice tool (mmmm, maybe a wiki page?? [wait, writing down on my hand], oook).

The thing is: if you work along the timeline, you will have a nice and near-0-errors final build in your own language. Obviously, you have to translate, but always localize, so, it might be difficult to find a search engine for your region, or a dictionary, or ebay in your language… And protocols-handler too!! (what a headache!!). We decided to keep the same newsfeed (20minutos.es), a free and Creative Commons diary daily, so less things to think about.

The next thing is fix some bad translated strings and check in in the “trunk”.

Next-next thing: mozilla-central!! (cvs, bazar, svn, hg!!!)