|
HowTo
Using the tool
Using the toolThe localization workflow is the following:
Get the toolCheckout the tool from the Subversion repository or download it from the Downloads section. Import the source stringsDefine the langpack inputThe 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: 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 parametersEdit 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 stringsImport 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 OmegaTOpen 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:
The source strings use the following pattern: ---<chrome path>---<key>---<source string>---Where:
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 langpackCreate the xpi langpack file by executing the command: python sgarlatur.py -xIf 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 langpackOpen 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. |