You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



Step-by-step Guide To Localizing Firefox using Mozilla Translator Converting a 0.9.x langpack to the 1.0 format

Author: Benjamin Smedberg <bsmedberg@covad.net>

Prerequisites

  • Mozilla Translator 5.04 (Download Here)
  • Perl (on windows, this should be cygwin perl)
  • Your language pack for Firefox 0.9.x
  • A tool to handle ZIP files (either command-line "zip", or GUI tools like WinZip are fine)

Optional Tools

  • A CVS client (either command-line "cvs" or a GUI tool like WinCVS)

Decisions to Make Before You Start

You have two ways you can get the original English files to translate. You can pull them from CVS, or download them from ZIP files. If you pull from CVS, you can also pull the entire source code to build Firefox.

Step-By-Step Instructions

  1. Repackaging your 0.9.x Langpack.

    You will need the following files from your 0.9.x langpack:
    • ab-CD.jar
    • CD.jar
    • ab-win.jar
    • ab-mac.jar
    • ab-unix.jar
    1. Place these files in an empty directory (e.g. ~/0.9-langpack/)
    2. Download the perl repackaging script (Download Here)
    3. Open a command line, change the working directory to ~/0.9-langpack/ and run the perl repackaging script:
      ~/0.9-langpack/ $ perl repackage-0.9.pl ab-CD
    4. You should have two new files in your directory: toolkit-ab-CD.zip and browser-ab-CD.zip.
  2. Getting the English files to translate

    Create a new empty directory (e.g. ~/firefox-translation/). Your English and translated files will live under this directory.

    Getting the Source Files from CVS

    Following the usual directions for CVS, pull a source tree. You need to use the aviary branch tag:

    ~/firefox-translation/ $ export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
    ~/firefox-translation/ $ cvs co -r AVIARY_1_0_20040515_BRANCH mozilla/client.mk
    ~/firefox-translation/mozilla $ make -f client.mk MOZ_PHOENIX=1 checkout

    Downloading the Source Files as ZIPs

    1. Create the following empty directories:
      • ~/firefox-translation/mozilla/toolkit/locales/
      • ~/firefox-translation/mozilla/browser/locales/
    2. Download the English source files from the Firefox 1.0 l10n freeze:
    3. Unzip toolkit-en-US.zip into ~/firefox-translation/mozilla/toolkit/locales/en-US/
    4. Unzip browser-en-US.zip into ~/firefox-translation/mozilla/browser/locales/en-US/
  3. Unpack the Translation

    Now you are ready to unzip the files from step I-d.
    1. Unzip toolkit-ab-CD.zip into ~/firefox-translation/mozilla/toolkit/locales/ab-CD/
    2. Unzip browser-ab-CD.zip into ~/firefox-translation/mozilla/browser/locales/ab-CD/
  4. Use Mozilla Translator

    1. Launch Mozilla Translator 5.04 Older versions will not work!
    2. File -> Manage Products -> Add
      Product name "Toolkit" or something similar. Do not enter any file paths. You must create a new product, you cannot re-use an existing product from 0.9.x version of Firefox.
    3. Import -> CVS directory
      Product: toolkit
      Select directory: ~/firefox-translation/mozilla/toolkit/locales/en-US/
    4. Import -> CVS translation
      Product: toolkit
      Select directory: ~/firefox-translation/mozilla/toolkit/locales/ab-CD/
      Locale: ab-CD
    5. File -> Manage Products -> Add
      Product name "Firefox 1.x" or something similar. Do not enter any file paths.
    6. Import -> CVS directory
      Product: "Firefox 1.x"
      Select directory: ~/firefox-translation/mozilla/browser/locales/en-US/
    7. Import -> CVS translation
      Product: "Firefox 1.x"
      Select directory: ~/firefox-translation/mozilla/browser/locales/ab-CD/
      Locale: ab-CD
    You are now ready to begin ordinary translation using Mozilla Translator.
  5. Exporting from MT to commit to CVS

    1. Export -> CVS directory This menu item is misnamed, it exports a translation, not the English original
      Product: Toolkit
      Select directory: ~/firefox-translation/mozilla/toolkit/locales/ab-CD/
      Locale: ab-CD
    2. Export -> CVS directory
      Product: Firefox 1.x
      Select directory: ~/firefox-translation/mozilla/browser/locales/ab-CD/
      Locale: ab-CD
    3. When you are finished translating the chrome files using Mozilla Translator, there will still be some files that need to be manually translated. These are typically not part of the product chrome, but are used to build the installers, langpacks, or are part of the default profile. They can all be opened in an ordinary text editor. Most of them use the UTF8 encoding, or state explicitly which encoding is required.
  6. Comparing Your Translation With English

    As a last step before committing your translation to CVS (or posting it for review), you should run a perl script which will compare the translated files with the English originals. This script is not fail-safe, but it does find the most obvious errors.

    If you're using a full CVS source tree, the script can be found in your source tree at mozilla/toolkit/locales/compare-locales.pl If you downloaded the English ZIP files, download the script from LXR (Download Here).

    Run the script once for the toolkit files, and once for the browser files. It will spit back some messages. "Unable to compare" messages mean that the script cannot do an automated comparison, you must do the comparison yourself. Read through the results to ensure there are no obvious errors.

    ~/firefox-translation/mozilla/toolkit/locales/ $ perl compare-locales.pl en-US ab-CD
    ~/firefox-translation/mozilla/browser/locales/ $ perl ../../toolkit/locales/compare-locales.pl en-US ab-CD

    If you are using a Windows machine, please make sure that your files have unix-style line endings before committing. This can be accomplished with the "dos2unix" command line tool. Make sure you don't run dos2unix on binary files (GIF or PNG images).

    If no obvious errors are displayed, your files should be ready for checkin.