mozdev.org

l10nzilla

resources:
L10NZilla Home Page

Command Line L10NZilla Usage

L10NZilla has a simple command line interface written in Java for performing auto-translation operations and archiving localisations into a MySQL database. An associated properties file needs to be updated also before you run your l10nzilla operations.

L10NZilla command line tool allows you to localise Mozilla based applications either in the database via a PHP based front end or directly in the individual DTD and Properties files with a Unicode text editor.

Full usage details are included in the l10nzilla.properties file. This page just elaborates a bit more.


Setting up L10NZilla.

Inside l10nzilla-java.zip is

And a properties file, that gives the paths to your working directories and/or your database 


Sort out your database..

Place the name of your new database in your l10nzilla.properties file for the dictionaryDBAddress property.
e.g. if you called your database 'myMozillaTranslations' then the destination address property should be
N.B you will need to update your php-l10nzilla preferences.class file to contain the same database name. The default for both is 'L10nZillaDatabase'.

To identify you as the (admin) translator to l10nzilla java and php, add also to your l10nzilla.properties file your details to the TRANSLATOR PROFILE section - your login name (which you'll use in php-l10nzilla) and your language code. E.g.
Then from a command prompt, get L10NZilla to create the tables it will need to archive your translations
> java -jar l10nzilla.jar createDB


Using the  L10NZilla archive command

If you've got a translation for a Mozilla based application in a certain xx-YY.jar file then you can 'archive' that translation into your new L10NZilla MySQL database. You will need to edit the l10nzilla.properties file and use the 'L10NZilla archive' command to archive both the english version and the translated version under the same 'install name'.

N.B!! due to not so perfect design of the database tables and of the software,  the english texts (i.e. the en-*.jar files) for a given Mozilla based app installation must be archived first before your localisation.


Enter the path to your working directory in the sourceWorkingDirectory property. This is where your jar file(s) (en-US.jar or your previously localised .jar file) are located. Most propably it will be the path to the chrome directory of the Mozilla installation you're archiving.

Then make sure that the language code for text contained in the JAR file your archiving is put into the sourceLanguageCode property as well.
 
Then your ready to archive your jar file(s) to the database. If you wanted to archive your translated jar file (e.g. your Finnish translation for Mozilla 1.4 and its fi-FI.jar ) then type : (remember to archive corresponding english jar file first)
> java -jar L10NZilla archive en en-US.jar M14
> java -jar L10NZilla archive fi fi-FI.jar M14

The L10NZilla database can contain many archives from many different varieties of Mozilla based applications and/or different versions of them. So you need to give the archive command a name for the install your archiving so as to distinguish it in future L10NZilla operations.

The archive command can also be used to update an archive already in your database. So if you've been translating directly in the DTD/properties files you can import your translation updates using the archive command in the same way as above.

Using  L10NZilla translate command

The auto translate command can translate an English en-*.jar file for you into your targer language by looking up and evaluating in three steps translatins already stored in the database. So for example, you can translate Mozilla 1.5 with the translations stored in the database. In the three step process of translation, you can specify a preferred archive you want translated texts to be taken from.

In your l10nzilla.properties file the source working directory can be given as the path to the chrome directory of your Mozilla application containing the en-*.jar files.

Give the destination file's working directory as well in the destinationWorkingDirectory property (e.g. C:/package/bin/chrome/)

State the destination's language code also in destinationLanguageCode property.  

At the bottom of the l10nzilla.properties file are the information needed to be inserted (if needed) to content.rdf files for your translation jar file.
E.g
.
author =Risto Reipas, Nalle Puh
localeName=fi-FI
previewURL=
version=1.0.0
displayName=Suomea / Finnish

Then from a command prompt call L10NZilla with translate command, stating the source and target files. E.g.

> java -jar L10NZilla.jar translate en-US.jar fi-FI.jar M14 M15

Examples of other uses for L10NZilla translate :

> java -jar L10NZilla.jar en-win.jar fi-win.jar M14 M15
> java -jar L10NZilla.jar en-mac.jar fi-mac.jar M14 M15
> java -jar L10NZilla.jar en-unix.jar fi-unix.jar M14 M15

The translate command accepts names for up to two archives in the database. The first (in this case M14) is the name of the preferred archive for the translation operation and where it should try to source translations from. L10NZilla will otherwise get its translations from anywhere in the database.
The second gives the name for a new archive in the database that the translate command will create so that you can begin editing your translations immediately with the PHP front in isolation from other archives.

If you want to 'export' translations from the database (especially if you've edited the archive with PHP-L10NZilla and want to see the results in your Mozilla app) use the translation command. So for example if you've been editing M15 in PHP-L10NZilla then use the following command to create your updated JAR file (M15 now being your new 'preferred archive' ):

> java -jar L10NZilla.jar translate
en-US.jar fi-FI.jar M15 None

'None' informs the translate command not to create a new archive.


How To Translate Mozilla with L10NZilla

Because L10NZilla can read and write JAR files, archive translations into a database and inlude texts into a number of file formats you are free to choose whichver tool and/or approach to translate Mozilla.

With L10NZilla it it possible to translate Mozilla Unicode text editors such as Unired or Mozilla Composer itself.

Hand editing the chrome.rdf file and changing all entries of your localisation base:URL  from  e.g.

c:baseURL="jar:resource:/chrome/cy-GB.jar!/locale/cy-GB/....

to

c:baseURL="resource:/chrome/locale/cy-GB/....

Makes Mozilla read your translated texts from files underneath your chrome's new /locale directory, so that when you edit some text in any DTD or properties file, then the change cna be seen immediately the next time you startup Mozilla.

Coupled with the HTML log of DTD/properties files that possibly need translation (in the directory you specify in the 'htmlTranslationResultsDirectory' property in l10nzilla.properties), you have a workable way of working on translating Mozilla with L10NZilla.

The l10nzilla project can be contacted through the mailing list or the member list.
Copyright © 2000-2017. All rights reserved. Terms of Use & Privacy Policy.