Mozillatranslate

From LocalizationWiki


1. Mozilla Translation using translate-toolkit(moz2po and po2moz).


Brief overview on mozilla translation:



There are altogether 5 compressed jar files that control the language displayed on mozilla user interface.

For english they are:

en-US.jar	- Contains Platform Neutral User Interface resource
en-win.jar	- Contains Platform Specific UI resource //For windows 
en-unix.jar	//for unix and linux
en-mac.jar	//for mac operating system
US.jar	- Contains Region specific UI resource  

These five files will be installed in /usr/lib/mozilla/chrome/ directory

Unzipping any of the above jar file will produce several files under several folders. Files produced are generally of one of three formarts ( .dtd, .properties, .rdf )

One need to translate all the *.dtd and *.properties in ones language. .rdf controls locale specific UI menu hierarchy declaration.

So, for translating the mozilla interface, all that is needed is to translated all the files having dtd and properties extension after extracting the above mentioned compressed jar files.

To have dzongkha interface in Mozilla, one need to create

dz-BT.jar
dz-win.jar
dz-unix.jar
dz-mac.jar
BT.jar

where

dz denotes Dzongkha language and
BT denotes Bhutan

Mozilla translation process using translate-toolkit: Translate-toolkit is used to create all the dtds and properties files inside the jar files into po files format, and back to the dtd and properties file formate after translating all the po files. Its easier to use mozilla translator for translating the mozilla user interface and help files into one's language, however that language should be supported by Java. For instance Dzongkha language is not supported by Java and as such there is the need to use translate-toolkit for translating mozilla.

Process of using the translate-toolkit for translating mozilla.

apt-get install translate-toolkit  //from etch debian repository
mkdir t_mozilla
cp en-US.jar to t_mozilla
cd t_mozilla
unzip en-US.jar //This process extracts all the files under locale folder
mv locale locale_en_US  //this will be used to create the po files and as a template while converting the po files back to dtd and properties file formate 
moz2po -i locale_en_US/ -o locale_dz_BT/

//Translate all the po files inside the locale_dz_BT

po2moz -i locale_dz_BT/ -o locale -l dz-BT -t locale_en_US/

//This will create a locale folder where all the po file will be converted back to dtd and properties formate

cd locale
mv en-US dz-BT
cd ..
jar cvf dz-BT.jar locale

Carry out the same translation process for other jar files!:)



Creating the dzongkha XPI (common platform installer).


As the name suggests XPI can be used to install the mozilla langugage pack (dzongkha for instance) in all platforms, i.e windows, mac, unix and Linux platform.

mkdir /makexpi
cp dz*.jar to /makexpi
cp en-US.xpi to /makexpi

Where to get the en-US.xpi

To download from the net.Need to download the correct XPI version.
Create one using mozilla-translator and Java.
cd /makexpi
mkdir temp
mv en-US.xpi temp
cd temp
unzip en-US.xpi
vi install.js
change 
 langcode to dz
 regioncode to BT
 prettyName to Dzongkha(BT)
cp install.js /makexpi
mkdir /makexpi/bin
mkdir /makexpi/bin/chrome
cd /makexpi
cp dz*.jar bin/chrome
jar cvf dz-BT.jar *
Open mozilla and install the dz-BT.xpi


Run the following command to use the dz-BT.xpi

cd /usr/lib/mozilla/
./mozilla -UILocale dz-BT



Creating the en-US.xpi using the mozilla translator and JAVA


open mozilla-translator

java -jar mt504.jar

Select File->Manage Products-> and click Add Provide following information Name---mozilla1.17.12 Jar File ---/usr/lib/mozilla/chrome/en-us.jar

Platforms

               --- win
                    /usr/lib/mozilla/chrome/en-win.jar
                    Type   Windows
               --- unix
                    /usr/lib/mozilla/chrome/en-unix.jar
                    Type Unix
               ---mac
                   /use/lib/mozilla/chrome/en-mac.jar
                   Type Mac

Regional --- /usr/lib/mozilla/chrome/US.jar

Click OK and Exit


Select File->Update Product

Click OK

Provide

     Locale           en-US

Click OK

Select Export->XPI Install

Provide

File /tmp/en-US.jar

Display mozilla1.7.12

.

.

.

Version 1.7

Click all the options

Click Ok

Now your XPI should be under /tmp folder