User:Toniher/Building langpacks

< User:Toniher

Some notes about building langpacks.

Create a working directory and choose base repository you are going to use. E. g.: beta

  • Clone base directory:

hg clone http://hg.mozilla.org/releases/mozilla-beta

  • Create l10n directory. Example with an.

hg clone http://hg.mozilla.org/users/toniher_softcatala.org/an l10n/an

Inside mozilla-beta directory, create a .mozconfig file with the following content:

ac_add_options --disable-compile-environment

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/aragon

ac_add_options --with-l10n-base=/home/toniher/remote-work/mozilla-hg/mozilla-beta/l10n

ac_add_options --enable-application=browser

ac_add_options --enable-official-branding

Langpack will be created in a subdirectory inside aragon dir. l10n-base should be changed to fit the path in your system. If creating a langpack for other applications, you should change browser for mail or other.

  • Inside mozilla-beta, launch this command: make -f client.mk configure.
  • This will generate a Makefile in: aragon/browser/locales
  • Go to aragon/browser/locales, and execute: make langpack-an
  • A langpack will be generated in: aragon/dist/linux-x86_64/xpi (depending on your system)
  • XPI is a ZIP file. You can change some things inside:
    • In install.rdf, increase major version, let's say, from 12.0 to 12.*
    • In chrome.manifest file, remove manifest chrome/an.manifest line (not necessary)
    • Save them back and you're done.

Convert PO files to l10n dir

If you are using Pootle, you're likely to start with a bunch of PO files and not typical DTD and properties files.

  • Create en-US l10n dir: get_moz_enUS.py -s mozilla-beta -d l10n -p browser (this will create only browser files)
  • Create PO templates from l10n/en-US: moz2po -P -t l10n/en-US -i l10n/en-US -o po/pot
  • Copy POT files: cp -rf po/pot po/pot.pre
  • Rename POT files to PO: find po/pot -name "*.pot" -exec rename "s/\.pot/\.po/" {} \;
  • Your locale PO files (e.g. an) are saved in an.pre directory (under an, there are dirs such as browser, toolkit, etc. with PO files inside)
  • Merge any missing PO file (even not translated, better than nothing, it would crash otherwise): pomerge -i po/an.pre -t po/pot.pre -o po/an Generates po/an directory.
  • Adds any missing one: rsync -r --ignore-existing po/pot/* po/an
  • Generate l10n/an: po2moz -t l10n/en-US -i po/an -o l10n/an

Links