DRAFT — DRAFT — DRAFT — DRAFT

How-To Localize Firefox 1.1 in CVS

Mark Tyndall, MLP-Staff
newsgroup discussion / mailing list
Mozilla Localization Project Staff
with special thanks to Pavel Franc, CZilla

This document describes the mechanics of getting a localized version of Firefox into CVS. It assumes you have already registered your l10n project; you have a working installation of CVS; and (for the final step) you have write access to the CVS l10n repository.

There are two scenarios covered here:

  1. A completely new localisation (no Fx 1.0 localisation)
  2. Moving a localisation (from Fx1.0 → Fx 1.1)

For both scenarios, you are aiming to almost duplicate the structure of the en-US locale files; however, the other localisations are held in a different part of the CVS repository. The recommended steps are:

  1. check out the en-US files
  2. check out an already-localized set of files
  3. create your own locale's directory structure
  4. either:
    1. copy the en-US files over into the new structure (if you have no existing files), or
    2. copy over your existing files into the new structure
  5. bring the files up to date
  6. commit the files back into CVS

1. Check out the en-US files from CVS

Prerequisites: open a command prompt in an empty directory. This is where you will be working on your localization.

First, you need to log in to the CVS repository – see [source code via cvs] for platform-specific details. Set your CVSROOT environment variable to :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot, and do:

cvs login

the password is anonymous.

Then, checkout the en-US files from the source. The files you need are in the following directories:

mozilla/browser/locales/en-US
mozilla/dom/locales/en-US
mozilla/extensions/reporter/locales/en-US
mozilla/netwerk/locales/en-US
mozilla/other-licenses/branding/firefox/locales/en-US
mozilla/security/manager/locales/en-US
mozilla/toolkit/locales/en-US

You can put these directories all on one line with the checkout command:

cvs checkout -P mozilla/browser/locales/en-US mozilla/dom/locales/en-US mozilla/extensions/reporter/locales/en-US mozilla/netwerk/locales/en-US mozilla/other-licenses/branding/firefox/locales/en-US mozilla/security/manager/locales/en-US mozilla/toolkit/locales/en-US

Ensure you use the -P option, which doesn't download empty directories.

2. Check out pl files from CVS

you don't have to check out pl files - any locale will do; however, pl files are most likely to be up to date.

You now need to change your CVSROOT to :pserver:anonymous@cvs-mirror.mozilla.org:/l10n (if you have write access, and are intending to add and commit your own localization, use your own username). Then checkout pl/ (or other chosen locale):

cvs checkout -P l10n/pl

Your working directory tree should now look like this:

·firefox/
·-·mozilla/
| |-·browser/locales/en-US/
| |-·dom/locales/en-US/
| |-·extensions/reporter/locales/en-US/
| |-·netwerk/locales/en-US/
| |-·other-licenses/branding/firefox/locales/en-US/
| |-·security/manager/locales/en-US/
| ·-·toolkit/locales/en-US/
·-·l10n/
  ·-·pl/
    |-·browser/
    |-·dom/
    |-·extensions/reporter/
    |-·netwerk/
    |-·other-licenses/branding/firefox/
    |-·security/manager/
    ·-·toolkit/

There is direct correspondence between the upper and lower sections - ie mozilla/browser/locales/en-US/ contains the same directories and files as l10n/pl/browser/. Effectively, the trailing locales/en-US/ has been replaced with the preceding ab-CD.

3, 4. Create and populate your own directory structure

You now need to create your own ab-CD/ or ab/ directory structure, mimicking the pl structure. Do not copy any CVS directories into your locale.

If you have a previous localisation

If you have an existing Fx 1.0 localisation, you can avoid duplicating more work than you need to by re-using the existing files.

Trunk (Fx 1.1+) Aviary Branch (Fx 1.0)
l10n/ab-CD/browser/ came from... mozilla/browser/locales/ab-CD/
l10n/ab-CD/dom/ mozilla/toolkit/locales/ab-CD/chrome/global/$foo/ where $foo = dom, layout, security, webservices, xml
  l10n/ab-CD/dom/accessibility/ mozilla/toolkit/locales/ab-CD/chrome/global/accessible.properties (file split due to platform-specifics)
  l10n/ab-CD/dom/xslt/xslt.properties mozilla/toolkit/locales/ab-CD/chrome/global/layout/xslt.properties
l10n/ab-CD/extensions/reporter/ [new]
l10n/ab-CD/other-licenses/branding/firefox/brand.* mozilla/browser/locales/ab-CD/chrome/global/brand.*
l10n/ab-CD/security/manager/chrome/pip(pki|nss)/ mozilla/toolkit/locales/ab-CD/chrome/global/pip(pki|nss)
l10n/ab-CD/toolkit/ mozilla/toolkit/locales/ab-CD/

The final structure you're aiming for in each directory should match the canonical en-US structure. [compare-locales.pl] is a Perl script which will find non-matching (missing or extraneous) files in the directories.

Next...

Once you've got the files in this layout, you need to either

  1. translate from en-US to your language
  2. find the file-level changes since Fx1.0 (bonsai Is Your Friend™), and incorporate those changes into your files.

Then check your files with [compare-locales.pl], and fix any differences.

That will have taken some time, so ensure you update your en-US. You can use the following command to update the en-US files (in the directory containing them). Make sure you switch back to the main CVSROOT.

cvs update -P mozilla/browser/locales/en-US mozilla/dom/locales/en-US mozilla/extensions/reporter/locales/en-US mozilla/netwerk/locales/en-US mozilla/other-licenses/branding/firefox/locales/en-US mozilla/security/manager/locales/en-US mozilla/toolkit/locales/en-US

The output from this command will list any changed files: those lines begin with a "P ".

Other files to localize:

There are a number of files that compare-locales.pl doesn't check. However, these files must still be localized:

In ab-CD/browser/defines.inc you must change the MOZ_LANGPACK_EID string to your own GUID; this remains constant for a given localization.

The *.rdf help files hold the Contents, Index and Glossary for the Help section.

Adding files to the CVS directory...

If you created your locale next to pl/ (as shown in the box below), and you used your username and password to checkout pl/, skip down to "using cvs add".

·firefox/
·-·mozilla/
·-·l10n/
  ·-·CVS/
  ·-·pl/
  ·-·ab-CD/

Earlier checkout with anonymous CVS

If you checked out l10n/pl/ files with anonymous CVS, you need to:

  1. remove the CVS directory from the l10n/ directory (this will probably mean you'll have to re-check out pl/ files if you need a more current copy); or
  2. Move your ab-CD/ files to another, fresh l10n/ directory.

Option 1:

·firefox/
·-·mozilla/
·-·l10n/
  ·-·CVS/ ←--- Delete this.
  ·-·pl/
  ·-·ab-CD/

Option 2:

·firefox/
·-·mozilla/
·-·l10n/
| ·-·CVS/
| ·-·pl/
·-·mylocale/  
  ·-·l10n/    
    ·-·ab-CD/  ←--- Move ab-CD to here.

You can now carry, following the instructions in "No CVS directories anywhere".

No CVS directories anywhere

If your l10n/ab-CD/ directories were created away from anything else (no CVS directories anywhere) you will need to checkout the l10n/ directory.

$ ls
l10n
$ cvs checkout -l l10n/

This will add a CVS sub-directory to your l10n/ directory, which lets CVS know where to add your files.

Using CVS add

Points to remember:

Navigate into your l10n directory. Now you can cvs add your ab-CD files.

$ cvs [-d :ext:blah] add ab-CD

which should reply something like

Directory l10n/l10n/ab-CD added

There are 2 "l10n"s - one is the repository, the other is the directory containing all the locales.

If that works, then you can cvs add all other files.

Commit your changes

When you've added all the files, you need to commit your changes.

$ cvs commit -m "L10n files for ab-CD, committed for John Smith"

The End

And that's it.

To stay up to date, use bonsai or cvs update on the en-US files. Change your files, and then cvs commit your changes. You only need to use cvs add if new files appear. Of course, look out for notices in n.p.m.l10n or on #l10n for announcements of code freezes. When this occurs, you'll need to get patches for check-in approved.

DRAFT — DRAFT — DRAFT — DRAFT