Someone I know recently expressed interest in translating Firefox into her native language, Tagalog. Being a build guy, I decided to spare her the pain of getting everything setup and let her focus on the translation. Much to my dismay I discovered that the Create a New Localization page hasn’t been fully updated for Firefox 3.1 yet. By mashing together information on a couple of pages and a lot of help from #l10n I managed to get an environment up and running that allowed her to dive in.

Here’s how to do it. (Note: This has been tested on Mac and Windows. On Windows, this depends on MozillaBuild 1.3; on both it depends on Python setuptools.)

  1. Install compare-locales
  2. wget http://pypi.python.org/packages/2.5/c/compare-locales/compare_locales-0.6.1-py2.5.egg#md5=0b939a22d87427d80f5286dc5eb1eab2
    easy_install compare_locales-0.6.1-py2.5.egg

  3. Clone mozilla-1.9.1
  4. hg clone http://hg.mozilla.org/releases/mozilla-1.9.1

  5. Create the barebones localization
  6. mkdir -p tl/browser/installer tl/browser/profile/chrome tl/browser/searchplugins tl/browser/updater tl/toolkit
    cp mozilla-1.9.1/browser/locales/en-US/defines.inc tl/browser
    cp mozilla-1.9.1/browser/locales/en-US/profile/chrome/userC* tl/browser/profile/chrome
    cp mozilla-1.9.1/browser/locales/en-US/firefox-l10n.js tl/browser
    cp mozilla-1.9.1/browser/locales/en-US/README.txt tl/browser
    cp mozilla-1.9.1/browser/locales/en-US/searchplugins/list.txt tl/browser/searchplugins
    cp mozilla-1.9.1/browser/locales/en-US/updater/updater.ini tl/browser/updater/updater.ini
    cp mozilla-1.9.1/toolkit/locales/en-US/defines.inc tl/toolkit

  7. Create a mozconfig file, setup your object directory
  8. cd mozilla-1.9.1
    echo “mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../fx-tl” > .mozconfig
    echo “ac_add_options –with-l10n-base=../” >> .mozconfig
    echo “ac_add_options –disable-compile-environment” >> .mozconfig
    echo “ac_add_options –enable-application=browser” >> .mozconfig
    make -f client.mk configure

  9. Test merge-ab-CD and langpack-ab-CD targets
  10. cd ../fx-tl
    make -C browser/locales merge-tl LOCALE_MERGEDIR=`pwd`/../merge
    make -C browser/locales langpack-tl LOCALE_MERGEDIR=`pwd`/../merge LANGPACK_FILE=`pwd`/../firefox-tl.xpi

If everything went well, you should be ready to translate now!

7 Responses to “Creating a new localization for Firefox 3.1”

  1. Axel Hecht Says:

    Thanks for testing this new path, and of course for helping out your friend to start the localization. I’ll try to reduce the list of required files further (fennec already does so), but this is a great start to actually document this stuff.

  2. Tomer Says:

    This will help her to get a quick-start, but sooner or later she will need to figure how to update the translation files, and keep it in sync with the en-US.

    She will need to know to ‘hg pull && hg update’ the source files, and use compare-locales in order to get list of changes (which are also available on http://l10n.mozilla.org/dashboard) in case she is already familiar with committing strings to the l10n tree).

  3. tmielczarek Says:

    Man, we should take a few steps out of that.

  4. armenzg Says:

    This has been beautifully put together, good job!

  5. Axel Hecht Says:

    Ted, each step we’re taking out of that is a review request on you ;-), you wanna be careful what you’re wishing for.

    But honestly, the list of files that Ben found is exactly what I needed to actually make some one or two good follow-up patches to get rid of the last remaining pieces.

  6. Eric Shepherd Says:

    I’ve converted this into the beginnings of an article here:

    https://developer.mozilla.org/En/Creating_a_new_localization_%28Mercurial%29

    Please take a look and twiddle as necessary to ensure accuracy and usefulness!

  7. Eric Shepherd Says:

    There’s also an article here, on how to maintain a localization once you’ve created it. This is mostly a stub, and could use help from people who know more about this.

    https://developer.mozilla.org/En/Maintaining_a_localization_%28Mercurial%29

Leave a Reply