Creating a new localization for Firefox 3.1
January 30th, 2009
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.)
- Install compare-locales
- Clone mozilla-1.9.1
- Create the barebones localization
- Create a mozconfig file, setup your object directory
- Test merge-ab-CD and langpack-ab-CD targets
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
hg clone http://hg.mozilla.org/releases/mozilla-1.9.1
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
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
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!
January 30th, 2009 at 6:04 am
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.
January 30th, 2009 at 6:15 am
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).
January 30th, 2009 at 1:17 pm
Man, we should take a few steps out of that.
February 1st, 2009 at 10:26 pm
This has been beautifully put together, good job!
February 9th, 2009 at 6:45 am
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.
February 23rd, 2009 at 4:08 am
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!
February 23rd, 2009 at 4:18 am
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