Mozilla l10n & Mercurial - Windows Configuration

Version: 0.2b (original document)

Last revision: 04 Sep 2008




You need a LDAP account with access to your locale Mercurial repository and the related SSH key (see this wiki page about SVN accounts for localizers).

Useful links:

Phase 1: installing TortoiseHg

Download and install TortoiseHg, reboot your pc. According to Mozilla's Mercurial FAQ, you need to modify/add some parameters inside mercurial.ini. TortoiseHg keeps this file inside the folder c:\program files\tortoisehg.

For TortoiseHg you need to add git = 1 inside the [diff] section, and diff = -p -U 8 inside the [defaults] section.

Mercurial - Mercurial.ini

Phase 2: download en-US files

For Firefox you have to download the whole mozilla-central repository, for Thunderbird the repository is comm-central.

  1. Create a new folder to manage both English and localized strings. I decided to create a folder “firefox 3.1” with two subfolders (“inglese” and “italiano”, so one for English and one for Italian).
  2. Inside this new folder, Right click -> TortoiseHG -> Clone a Repository Mercurial - Clone a repository
  3. As Source Path insert (or, as Destination Path select the folder you have created (Firefox 3.1\inglese) and add “\mozilla-central” at the end of the path (the mozilla-central folder must not exist, it will be created automatically). Mercurial - Set paths
  4. Press Clone in the top-left corner and wait (this procedure can take 10-15 minutes with mozilla-central). Finally you will find a folder mozilla-central (or comm-central) with all the files that you need. Mercurial - Clone finished

Phase 3: download ab-CD files for your locale

All files (Thunderbird, Firefox, Calendar/Sunbird) for your language are stored inside a single repository. The procedure is almost the same already used to download the en-US files.

  1. With my configuration, inside the folder Firefox 3.1\italiano: Right Click -> TortoiseHG -> Clone a Repository. As Source Path insert (ab-CD is your language code), as Destination Path select the folder you have created (Firefox 3.1\italiano) and add the name “ab-CD” to the path (this folder must not exist, in my case the language code is “it”). Press Clone in the top-left corner and wait a few seconds. Mercurial - Set paths
  2. Right click in the ab-CD folder that you have just cloned and select TortoiseHG->Settings->Repository Mercurial - Settings
  3. In the User panel insert your e-mail address as Username. In the Paths panel insert as Default-push the address ssh:// (replace youremailaddress with the real e-mail associated with your LDAP account and ab-CD with your locale code, for example ssh:// for Italian)

Now, if you use Mozilla Translator as your localization tool, you have just to modify the paths for each product (File->Manage products) and you're ready to start your localization.

How to update en-US files

In CVS/SVN you have an UPDATE action to download updated files, with Mercurial you need to SYNC your local repository with the remote one (making a PUSH or a PULL).

To update the en-US files (or even your locale files if more people work on the same repository):

  1. right click inside the folder (comm-central, mozilla-central or your locale folder), select TortoiseHG->Synchronize… press Pull to check the remote repository and verify which files you need to download Mercurial - Pull
  2. Select Update to Tip (bottom of the window) to update the local repository ("tip" is a tag assigned to the most updated revision) Mercurial - Pull

Update your locale (commit changes)

After the "Export to CVS" inside Mozilla Translator, you need to synchronize your local repository with the Mozilla's remote repository.

  1. Open Pageant.exe (included in TortoiseHg program folder) and load your SSH key (in the tray bar double click on the pageant icon and load your private key)
  2. Right click inside the folder with the localized files and select HG Commit…. In this way you're updating your local repository, not the remote one. Mercurial - Pull
  3. As with a CVS/SVN COMMIT, you need to specify a Commit Message Mercurial - Pull
  4. Now you need to synchronize your local Mercurial repository with the remote repository: right click inside the folder and select TortoiseHG->Synchronize… Mercurial - Pull
  5. In the next window, check that the Remote path contains the ssh:// path and not the http:// one. If you press Outgoing you can see the files you're going to send to Mozilla's repository, if you press Push you can start the real sync process. Mercurial - Pull

The first time you connect to ssh:// you should see a warning about the server's host key: press Yes to store the key inside Putty's cache. Mercurial - SSH warning

Add/remove files inside you locale

Like CVS or SVN, with Mercurial you have to mark files that you want to add or remove from your repository. To do this:

In the "Hg Commit" window, you will see the letter:

A couple of considerations:

Check your work

You can check the revision log for your locale using this address (replace ab-CD with your locale code), and maybe subscribe to the RSS feed:

For Firefox localization, you can always use the awesome l10n dashboard.