L10N:Creating A New Localization

From Spicebird

Jump to: navigation, search

This document describes how to localize Spicebird.

First, it is important to understand that Spicebird is built using Mozilla Thunderbird, Mozilla Calendar and the Mozilla Platform. A huge number of user interface strings that appear in Spicebird originate from Thunderbird, Calendar and the Platform. The strings in the platform are common to Firefox too. So, if Firefox is localized, it means that platform is localized. If your locale has translations done for your these fundamental blocks of Spicebird, a lot of your localization work for Spicebird is already done. This document explains how to create a new localization for Spicebird if you have localized any of Thunderbird, Calendar or Platform. It also explains how to create a new localization from start if nothing has been localized yet.

Contents

[edit] Check If Someone is Already Working on Your Locale

Before you start, check if your locale already has someone working on it. If there is work already happening, join hands with them and distribute work. The list of teams and their contact details are available on the localization teams page.

[edit] Choose a Locale Code

Every locale is identified by short locale code in Spicebird/Mozilla. You first need to pick a locale code for your locale. If your locale already has a translation for Firefox, Thunderbird or Calendar, simply pick that locale code. Otherwise, follow this Mozilla wiki page for picking a language code.

[edit] Prepare The Environment

If you are on GNU/Linux or Mac you need not do any thing there. Simply open a terminal and follow through. If you are on Windows, you need to download and install current version of MozillaBuild. After installation open a terminal by clicking on any of the start-* batch files in the MozillaBuild installation directory.

[edit] Get The Source

You need to get some Mozilla and Spicebird source code modules before a localization can be created.

First checkout the script that will be used to retrieve the modules and also a helper localization tool that shall be used to create a new locale.

$ export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
$ cvs -z3 co -D "12 Apr 2008 00:00 PDT" mozilla/client.mk mozilla/tools/l10n

Then retrieve the Spicebird changes to this script

$ wget http://www.spicebird.com/pub/mozilla/client_DATE_20080412_0000_PDT.mk -O mozilla/client.mk

Now, checkout all required Mozilla and Spicebird modules

$ cd mozilla
$ make -f client.mk l10n-checkout MOZ_CO_PROJECT=collab

Alternatively, if your locale already has a localization for Mozilla Platform, Thunderbird or Calendar then you can check out those localizations by appending MOZ_CO_LOCALES to the above command.

$ make -f client.mk l10n-checkout MOZ_CO_PROJECT=collab MOZ_CO_LOCALES=xx-yy

where xx-yy is your locale code.

[edit] Create a Spicebird Localization

In this step we create dummy localization files for your language. It is essentially copying all the en-US locale files to your locale directory (if they are missing) so that you can start localizing them. Run the following command if you like create the files for locale xx-yy.

$ make -f tools/l10n/l10n.mk create-xx-yy MOZ_CO_PROJECT=collab

This will create an l10n directory parallel (under the same parent) to the mozilla directory which will contain all the localization files copied from en-US.

Note that if Thunderbird, Calendar or Platform are already localized, the previous step of checking out the source code and localization will have created a l10n directory parallel (under the same parent) to the mozilla directory and the l10n directory will contain all the localizations done for Thunderbird, Calendar and Platform. This step will only create dummy files for Spicebird under the collab directory.

[edit] Localize

Localizing involves translating user interface strings and setting some values properly in the dummy files created in the locale directory ../l10n/xx-yy. Not all directories need to be translated for Spicebird. The required directories are:

  • netwerk
  • security/manager
  • dom
  • toolkit
  • mail
  • editor/ui
  • extensions/spellcheck
  • calendar
  • collab

Files of various types can be seen in this directory. Follow the instructions for localizing given on Mozilla Developer Wiki for assistance on how to localize various files.

[edit] Updating an Out-of-Date Locale

When new strings are added to Spicebird, the localizations become out-of-date in the sense that they do not have the translation for the newly introduced string. You may want to remove strings from the localizations that are no longer used in Spicebird. Further, you may need to find out if your localization has all strings that en-US locale has (some may have got removed or distorted during the editing process). The compare-locales tool helps us in finding out newly added/removed strings and in the process verifying the locale by comparing it string by string to the en-US locale. The instructions to install and use the compare-locales tool is available on the Mozilla Developers Wiki. You will need to provide the option --application=collab to compare-locales.

[edit] Testing the Localization

You can test the localization by creating a language pack. However, dependency software required for the Mozilla build system must first be installed. Please see the Mozilla wiki for list of packages required for Windows, Unix/Linux and Mac OS X. After installing the dependencies, while in the l10n directory created during the dummy localization creation step, issue the following commands:

$ mkdir ../build
$ cd ../build
$ ../mozilla/configure --disable-compile-environment --enable-application=collab
$ make -C collab/locales langpack-xx-yy

This step should build a language pack for the locale xx-yy in the directory dist/install. Install this language pack on the regular English (US) Spicebird. You will now need to set the language to start using it. To do this, go to Edit->Preferences, Advanced Tab, General, Config Editor, then click I'll be careful, I promise! and edit the key general.useragent.locale to your locale. Now restart Spicebird and test your locale.

Note: If you see a messages like the following during the configure step, ignore them.

cat: ../mozilla/xpcom/xpcom-private.h.in: No such file or directory

[edit] Submit Your Localization

  • Create a zip file of the l10n/xx-yy directory that you finished.
  • Create a bug in Spicebird Bugzilla for your localization. The product for it is "Spicebird Localizations" and component is "Default".
  • Submit the zip file as attachment to the bug.

Your localization will be reviewed and committed to the Spicebird localization repository. You can then proceed to apply for an Spicebird SVN account to be able to commit directly to the SVN. For this, create a bug under the "Administration" product of the Bugzilla. The component is "SVN".

If you have localized directories other than collab directory, it means that the Mozilla project can make use of these translations. Please contact the Mozilla localization team for your language and ensure that Thunderbird and Calendar projects also benefit from your work.

Personal tools