Localizing ChatZilla
This page explains the process for localizing ChatZilla but does not go into depth on more general issues, such as using Mercurial or localizing SeaMonkey. You will need basic command-line skills. If you have any questions or issues localizing ChatZilla, or just want to chat with fellow users and developers, feel free to drop by in #chatzilla on moznet.
Definitions
- ab-CD
- This text is used to refer to the locale code for your localization. You should replace every occurance with your localization's correct code. For example, French would likely use 'fr-FR'.
Requirements
- Python is required for all localizations.
- Mercurial may be used to easily keep up-to-date with new changes in ChatZilla, but is not required.
- Optionally update the Mozilla Localization Teams so people know who's working on what.
1. Get the source code
With Mercurial
- Open a terminal or Command Prompt.
- Navigate to the folder you want to store the code using the cd command.
- Run the command "hg clone http://hg.mozilla.org/chatzilla" - this will take a short while.
Without Mercurial
- Download the ZIP archive.
- Extract the files into the folder you want to store the code.
2. Make locale directory
To get started on your localization, copy the locales/en-US directory to locales/ab-CD. Remember that ab-CD should be named after the language code of the locale you're writing a localization for.
3. Localize files
You need to localize the following files:
- locales/ab-CD/chrome/chatzilla.properties
- locales/ab-CD/chrome/*.dtd
- locales/ab-CD/defines.inc
While you are localizing these files, please remember:
- Do open and save all files as UTF-8 without BOM.
- Do localize entries of the form cmd.something.help as these are the command descriptions shown to the user.
- Do not localize entries of the form cmd.something.params as these are the parameters for commands, which need to match up to the code.
- Do not change locale.version as this is necessary to detect mismatched language packs. There are further details of this requirement in comments at the begginning of chatzilla.properties.
- Do keep up with new versions of ChatZilla, if you can. The ChatZilla nightly builds page may be helpful, as it lists which files have changed - search for "locales/en-US" to find all potentially relevant changes. You are welcome to linger in #chatzilla as well.
- Do keep archives/copies of localization releases you have made, in case you need to refer back to them.
4. Make locale package
You can create a locale package at any time to check how things are coming along, or when you're done. Please note that this will overwrite a locale package of the same language and version.
- Open a terminal or Command Prompt.
- Navigate to the xpi folder inside the ChatZilla code using the cd command.
- Run the command "python makexpi.py ab-CD".
If all goes well, a xpi/chatzilla-ab-CD-version.xpi file will be created. This file installs only your localization - that means users will have to install ChatZilla separately. It can also be used by SeaMonkey users to localize their preinstalled ChatZilla.
5. Test your localization
- In the host application (Firefox, SeaMonkey, etc.), open the xpi/chatzilla-ab-CD-version.xpi file, e.g. from the menu "File > Open File...".
- Restart the host application and open ChatZilla.
- Check that all strings fit in the space that they are given.
- Check that all %S replacements are working correctly.
- Check that each accesskey is used only once in each menu.
- ...and all the usual localization checks.
6. Distributing your localization
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.
- You could upload it to the official Mozilla Add-ons site.
- You can ask in #chatzilla to have a link added to the official homepage. You can also do this by creating a pull request for the homepage in GitHub.
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
Create yourself an account on Mozilla's Bugzilla, then file a bug.
- 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.