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 make a language pack for ChatZilla. It doesn't require much setting up on any major platform.
What this page is not
This page does NOT provide all-out guides to Python, Mercurial, or language problems (wording choices etc.) If you need help with Mercurial, check out this. It also doesn't apply to localizing SeaMonkey - if you want help with that, the Mozilla Wiki is the right site for you.
Throughout this guide, 'ab-CD' means the locale code for your localization. That means that, if you were to localize ChatZilla into French or German, you would replace it with 'fr-FR' or 'de-DE', respectively.
Requirements for the method described below
On Windows, Linux, or OS X, the only required software package is Python. It is also recommended to install Mercurial for keeping in line with development. After installing them, you will probably want to add yourself in the Localization Teams section of the Mozilla Wiki so that the l10n leads know whom to assign bugs when something is not as it should be.
1. Get the source code
First things first: make sure you have Mercurial and Python installed, and open a terminal:
Start > Run > Type 'cmd' in the box and press Enter
Applications > Utilities > Terminal
Linux and Unix users should be so familiar with terminals that I need not explain it here.
Once you have opened a terminal, navigate to a folder where you want to store your localization work using the 'cd' command. Then execute the following command:
hg clone http://hg.mozilla.org/chatzilla
This will get you the ChatZilla source. You'll see a few messages, and after a (hopefully short) while it will be done.
If you do not wish to use Mercurial for getting the source code and maintaining your localization, you can just download the ChatZilla source code as a .zip archive.
2. Make a locale directory
To get started on your localization, you'll want to copy the en-US directory in the locales directory into a new subdirectory there. The new subdirectory should be named after the language code of the locale you're writing a localization for.
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 will probably take the longest time to localize because it's so big. To get things right, there are a couple of things you need to keep in mind:
- 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 be useful to users when they are unsure of what a certain command does.
- 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 Mercurial (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 Mercurial. Silver (James Ross) has made a nifty page which will list any locale changes made to the ChatZilla code.
4. Make a locale package
When you're done localizing, or just want to try if things work, you can make a language pack for ChatZilla by opening a terminal in the xpi directory in the source code, and using the following command:
python makexpi.py ab-CD
If all goes well, you will see a few messages appear in your terminal (but no errors), and a chatzilla-locale-version.xpi file will be created in the 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 can also be used by SeaMonkey users to localize their preinstalled ChatZilla.
5. Test out your localization
Open the language pack in the host application (the program you use ChatZilla in). For Firefox and SeaMonkey, the directions are the same: select 'Open File' from the 'File' menu, choose your language pack file, and restart the application.
Then, open ChatZilla and check out some things:
- that all strings fit in the space that they are given,
- that all %S replacements work correctly,
- that each accesskey is used only once in each menu, etc.; all the usual localization checks.
6. Start distributing your language pack
When you think you have fixed all possible bugs in your localization, you might want to consider releasing it to the public. You could ask an admin of a local Mozilla community site to upload your language pack to their server. Alternatively, you might upload it to the official Mozilla Add-ons site. Finally, you can ask the ChatZilla web admin to add a link to the site your language pack has been published on.
Appendix: Bundling your localization with SeaMonkey
It is possible to ship your ChatZilla localization with SeaMonkey for an even more complete Internet experience. Just follow these steps.
1. Get a copy of the l10n repository for your locale
Installing Mercurial was optional in the previous section, but here it's mandatory. After installing it, open a terminal, navigate to a directory where you want to save the l10n repository, and execute the following command:
hg clone http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-CD
Note that some locales might not have the -CD part here.
2. Make a Mercurial patch containing your localization work
Copy the ab-CD subdirectory from the locales directory in the chatzilla repository to the extensions directory in the l10n repository (you'll need to create the extensions directory if it doesn't exist) and rename the new copy from 'ab-CD' to 'irc'. After doing so, open a terminal, navigate to the l10n repository and execute the following command:
hg diff > /%S/chatzilla-locale.patch
where %S is the path to your desktop. This will create a file that, in Mercurial terminology, is called a "patch".
3. Create a bug to get the patch into Mercurial
- Choose your locale from the 'Component' menu.
- In the 'Description' field, ask someone who has Mercurial access to upload the patch to Mercurial.
- Attach the patch file by pressing the 'Add an attachment' button.
4. Create a bug to get your locale built
Wait for someone to upload the patch to Mercurial, then file another bug.
- In the 'Summary' field, type "Add ab-CD to ChatZilla all-locales".
- This time you can leave the 'Description' field empty.
5. Download SeaMonkey with ChatZilla
Once your locale has been added to all-locales, you could either try a nightly build, or wait for an official release.