Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

Creating a Language Pack

To create a language pack, or a localization repack, you first need the L10n Prerequisites.

In the .mozconfig, you want to have

ac_add_options --disable-compile-environment
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../firefox

You'll want to add a line to tell configure where to find you l10n directory, for fx3.1, that's where you clone the l10n-central repositories. Add a line to .mozconfig like

ac_add_options --with-l10n-base=full/path/to/l10n-central

The given path should have your localization directory as child, i.e.,  a subdirectory ab-CD where ab-CD is your locale code.

You still need to specify which application you're localizing, for Firefox, that's browser, Thunderbird would be mail.

ac_add_options --enable-application=browser

Then type in your mozilla source dir

make -f client.mk configure

and go to your object dir

cd ../firefox

and (for Firefox)

cd browser/locales
make langpack-ab-CD

This works great for applications that are string frozen. For apps currently in development, you need to get the right strings for the build you use. Best is to create an installer there. First, we get the en-US builds. There is a target to get those, too,

make wget-en-US EN_US_BINARY_URL
=http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/

(all in one line). So, now you have the binaries that you want to repack. The next steps help in getting the right source for the binary, and to fill in missing strings in your localization from en-US. That way, you can translate and test incrementally.

make ident

That will return a 12 character long hexadecimal string. Take that string, go back to your source and update your hg working copy to that revision,

cd ../../../mozilla-central
hg update -r a0b1c2d3e4f5

cd ../firefox/browser/locales

Now we have the right en-US strings for the build, let's pad the localization

make merge-ab-CD LOCALE_MERGEDIR=$PWD/mergedir

The mergedir can be anywhere on your disk, but should be specified with an absolute path. Now we can use that to create our binaries:

make installers-ab-CD LOCALE_MERGEDIR=$PWD/mergedir

The generated builds will be in ../../dist.

You can use l10n merge for language packs, too. But if you're using the language pack on a different build with newer strings it will break again.

Document Tags and Contributors

 Contributors to this page: trevorh, Aleksej
 Last updated by: trevorh,