Localizing ChatZilla
So, you want to try and localize ChatZilla? Good on you! This page is here to try and give you an idea how to go about things. If you have questions, or just trouble getting things to work at all, feel free to drop by on #chatzilla on moznet and ask.
What this page is
This page aims to give you an idea of the easiest way to build a localization xpi for ChatZilla. It requires some setting up on Windows and Mac OS X platforms, but should be (nearly) painless on a *nix system. Even on Windows and Mac, the effort will be worth it in the end (unless you enjoy manually constructing your jar and xpi files every time something changes).
What this page is not
This page does NOT provide all-out guides to CVS, Bash, or language problems (wording choices etcetera). It also doesn't apply to localizing the SeaMonkey Suite - if you want help with that, the l10n information pages may be of more assistance to you.
Requirements for the method described below.
- Windows:
This is probably worst of them all. You need to get Cygwin. Install at least the following packages when presented with the horribly badly done list in its installer:- coreutils
- cvs
- sed
- perl (optionally, you can not install this and use ActiveState perl instead)
- zip
- bash
- Mac:
You'll need to install fink.
Using fink from the command line, install the cvs package. If everything went alright during the original install, the perl, sed, bash and zip packages were already installed. - Linux/Unix:
Simple, you need to get the following packages from your distribution:- cvs
- perl
- bash
- sed
- zip
Step 1: Checkout the source
First things first: make sure you have everything listed in the requirements above, and open a terminal:
- On Windows:
Start > Run > Type 'cmd' in the box and hit Return
- On Mac:
Applications > Utilities > Terminal
- On Linux/Unix you should be so familiar with terminals that I need not explain it here.
Once you have opened a terminal, set the CVSROOT environment variable to the mozilla cvs repository. Commands to do so are listed below:
- On Windows:
set CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
-
On Mac and Linux/Unix:
CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
(Note that I'm assuming you're running a bash shell. On Mac, you will be running that unless you changed preferences. On Linux/Unix, you might need to start bash from your ash/tcsh/something-else shell)
Now you can checkout the ChatZilla source. Navigate to a folder where you want to store your localization work using the 'cd' command. Then execute the following command:
cvs co mozilla/extensions/irc
This will get you the ChatZilla source. You'll see lots of filenames flashing by, and after a (hopefully short) while it will be done. Now, to actually build ChatZilla, you need some other files as well. These are not part of the source, but they are required to get the build script to work properly. To get those files, use the following command:
cvs co mozilla/config
Now you have all the source code you need, so let's get going!
Step 2: Making a locale directory
To get started on your localization, you'll want to copy the contents of the 'en-US' directory in mozilla/extensions/irc/xul/locale into a new subdirectory there. The new subdirectory should be named after the locale you're writing a localization for. Examples are de-DE for German, or fr-FR for French.
Step 3: Localize all the files in your new directory.
The single chatzilla.properties file and all the .dtd files will need to be localized in order for your localization to be complete. The chatzilla.properties file is probably hardest, because it is so big. To get things right, there are a couple of things you need to watch out for:
- NEVER localize the cmd.<something>.params strings. These are for internal use, translating them will prevent the use of those commands! You can, however, translate the cmd.<something>.help strings. These will prove useful to users when they are unsure what a command is about.
- Do NOT change the locale.version string. This too is for internal use. For more information, please refer to the comment at the top of the chatzilla.properties file.
- Keep up with changes in ChatZilla. There should be new releases every now and then. Lingering in #chatzilla on moznet when on IRC is probably the best way of getting an idea when these are going to happen. We will release from the code in CVS (you know, where you got your source code from) every now and then. It would be wise to archive releases you have made yourself, and keep up with development on CVS. Silver (James Ross) has made a nifty page which will list any locale changes made to the ChatZilla code.
Step 4: Prepare installation files for your locale package
To actually make a locale package, you'll have to do some more things. If you look in the mozilla/extensions/irc/xpi/locale-resources/ directory, you'll notice a bunch of install files that you need to copy to a new subdirectory based on your locale. If you were localizing ChatZilla into French, you'd copy the files to the directory
mozilla/extensions/irc/xpi/locale-resources/fr-FR/
After copying these files, you should edit them as described in the comments at the top of the files. Make sure to change the UUID in install.rdf. Also note that you should change this UUID once, but keep it the same afterwards - otherwise updates to your localization won't install properly.
UUID generators may be found in any of the following places:
- Microsoft guidgen.exe utility
- Web-based UUID generator
- For the Linux people, your package managing software usually knows about 'libuuid', 'libuuid1' or 'e2fsprogs', which will install a utility called 'uuidgen'. That will do the job fine as well.
- On moznet, the following command will also give you a uuid:
/msg firebot uuid - Microsoft Visual Studio also ships with a uuidgen utility.
Step 5: Make a locale package
When you're done localizing, or just want to try if things work, you can build a localized xpi file of ChatZilla by opening a terminal in the mozilla/extensions/irc/xpi directory in the source code, and using the following command:
bash makelocalexpi.sh ab-CD
where 'ab-CD' is of course the locale code for the localization you did, and the name of the directory in which your localization is saved. If all goes well, you should see a bunch of messages appear in your terminal (but no errors), and a chatzilla-<locale>-<version>.xpi file should have been created in the mozilla/extensions/irc/xpi directory.
This xpi file installs only your localization - that means that users will have to have installed the ChatZilla code from the website. It will also mean that this package could, theoretically, also be used by SeaMonkey users to localize their pre-installed ChatZilla.