My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
HowTo  
Using the tool
Updated Mar 17, 2011 by ccud...@gmail.com

Using the tool

The localization workflow is the following:

  1. Get the tool
  2. Import the source strings
  3. Translate in OmegaT
  4. Create the langpack
  5. Test the langpack
  6. Go to #3 to change the translation or to #2 to update the source

Get the tool

Checkout the tool from the Subversion repository or download it from the Downloads section.

Import the source strings

Define the langpack input

The 01input folder already contains the English content for the latest version of Firefox.

In general, you should download and install the English version of Firefox used as source (we usually work on the nightly builds) and place a copy of the files en-US.jar and en-US.manifest found in the chrome folder of the installation path in the 01input/source folder.

IMPORTANT NOTE: Starting from Firefox 4.0 Beta 5 en-US.jar and en-US.manifest are deprecated by omni.jar. The import command will extract the en-US strings and the en-US manifest from the first file matching the pattern "omni.jar". Since omni.jar includes several files not related to localization, we use a modified version "omni_localized.jar" including only the items related to the localized content:

  • chrome/en-US/locale/
  • chrome/localized.manifest

From the point of view of the source string extraction the "omni.jar" and "omni_localized.jar" are identical, but the file size of the last is considerably smaller.

Define the langpack parameters

Edit the config_langpack.py file in an utf-8 text editor to define the langpack parameters. For more information about the Firefox langpack structure, see Building an Extension.

Import the strings

Import the source strings from the en-US.jar (or omni.jar) file by executing the command:

python sgarlatur.py -i

Note: Depending on the operating system, the command above could be different. Basically, to import the strings, you should execute the sgarlatur.py Python script from the tool folder.

Translate in OmegaT

Open the 02work/translate project in OmegaT and translate the strings. See the System Requirements section for information about the OmegaT issues.

OmegaT allows the use of Glossaries and Translation Memories to perform an easier and consistent translation.

In the screenshot above (related to OmegaT 1.7.3), you can see:

  1. The source and target strings
  2. The relevant Glossary matches
  3. The fuzzy matches

The source strings use the following pattern:

---<chrome path>---<key>---<source string>---
Where:
  • --- is used as a separator
  • <chrome path> is the chrome path
  • <key>
    is the string ID (for .properties files) or the entity (for .dtd files)
  • <source string> is the translatable text

The context information (including the dashes used as separators) are added to make the source strings unique, and should be excluded by the translated text.

For example, consider the source string:

---locale/browser/browser.dtd---bookmarkPageCmd2.label---Bookmark This Page---

To translate it, you consider only the <source string> section and write the translation of:

Bookmark This Page

If you need more context information about a string, look at the 02work/reference folder to see if the source file contains some localization notes. Simply follow the chrome path and open the file in a text editor.

For infomation about the translation in OmegaT, see the Help Manual.

When you are ready to build the langpack (even if the translation is not complete), create the target file selecting Project > Create Translated Documents. Then you can save the project (Project > Save) and quit OmegaT.

Create the langpack

Create the xpi langpack file by executing the command:

python sgarlatur.py -x
If you are lucky, you'll find 2 files in the 03output folder: an xpi file and the update.rdf.xml file.

To be useful, the update.rdf.xml manifest file should be digitally signed (see the details here). We use McCoy to do it.

Test the langpack

Open the xpi file in the original English version of Firefox and test it. If necessary, go back to the OmegaT project and/or the config file and repeat the workflow.


Sign in to add a comment
Powered by Google Project Hosting