• compare-locales

    July 10th, 2008 by seth bindernagel with 10 comments »

    You may have noticed in the past few months that I have been writing more and more about Mozilla l10n and our tools development process.

    In addition, over the last two weeks, I’ve set up a handful of meetings with localizers from several Indic languages who have been poking us to find out what they need to do to start buidling, testing, and eventually shipping a localized version of Firefox 3.  Mic has also been reaching out to localizer groups to set up team-to-team meetings and overall, I think it has been successful.

    One thing I saw repeatedly in those meetings that seemed particularly helpful was Pike using his compare-locales tool that he developed that shows the progress of a localization compared to the current en-US source code.

    So, last Friday, I decided to learn how to use this tool so I might be able to help Pike steer localizers to where work needs to be done….and along the way, comment on the pain points.  Here is what I did and learned:

    I went to MDC and looked up how to run compare-locales.  Pike wrote this documentation and it was really helpful.

    After reading through this, my first task was to figure out if I had Python installed.  In fact, I did.  Version 2.5.1.  I checked in with Pike and he told me that he had tested compare-locales with versions of Python 2.3, so I knew I was ok.  To run this, you’ll need 2.3 or higher.

    With Python installed, I had to check to see if I had easy_install on my machine.  And, I lucked out again!  I had it installed on my machine.  Pike gives some good documentation on how to get easy_install if you don’t have it.

    I then ran the following command from the shell:

    # Install “compare-locales”.  ”easy_install compare-locales”

    But, this failed.  I hit my first pain point.  For some reason, I was not able to install to the directory /usr/local/bin.  I asked for a bit of help from one of these developer guys and ran the following:

    $ mkdir /Users/bindernagel/bin
    $ export PYTHONPATH=/Users/bindernagel/bin
    $ easy_install –install-dir=/Users/bindernagel/bin compare-locales

    Success.  Thanks, Seth Spitzer.

    I then had to get the en-US source code for the browser.  This was kind of a big deal for me here…checking out the Mozilla source for Firefox for the first time…well, I thought it was cool…now I can build my own version of Firefox one day.

    (I’ll attach the MDC doc I used to do this and the commands I ran in the comment section of this blog post.)

    Once I had the browser source from CVS locally, I had to get all the localizations for Firefox.  This was another pain point.  I didn’t really know how to find ALL localizations, which I what I needed if I wanted to be helpful to localizers. This was the last pain point.  But, I got a bit more help and we found this:

    $ make -f client.mk l10n-checkout MOZ_CO_PROJECT=browser MOZ_CO_LOCALES=all

    If I were to make an addition to the MDC doc about compare-locales, I might put this line, or a locale-specific command in the instructions.

    Once I had this, I was able to run my first compare-locale.  I chose German (de) and here was the output in my terminal prompt:

    keys: 900
    unchanged: 659
    changed: 4427
    87% of entries changed

    This is a summary of the localization of the team from Germany.

    • Keys are access keys typically (DTD files) that need some localization.
    • Unchanged are strings that are in en-US that do not need to be changed.
    • Changed gives the number of strings localized by the team

    When I ran this compare-locale, de was complete.  If de needed more localization work, a list of files would have been given.

    Ping me if you want to learn how to do this.  If you already do, please list the pain points you experienced when trying to do this yourself.  I’ll gather those and amend the MDC document accordingly (with approval from Pike).