Checking a language into CVS
If you are storing a language in the Translate SF CVS then you will need to
follow these instructions.
Versioning and version names
We tag versions like this:
mozilla-N.N-branch (for a branch)
mozilla-N.N.N (for a tagged release)
mozilla-N.N-afrikaans-import (for any other event we simply rewrite after the
product and version)
Preparing
If you are importing relatively old data then you will need to do some
preperation.
Migrate to the latest version or closest version.
pomigrate nso templates
This will bring the files up to date. We do not use the -c option yet simply
because we want a relatively clean import. We also leave any pofilter checks
till after the data is in CVS. This is to prevent any loss of data.
Next check for unitialised or redundant files as we don't want to import those.
poorphan -l nsa_ZA nso templates
check to see that the redundant files have not moved. Move these to the new
place if needed. Initialise the remaining files but do not delete any extra
files. Initialisation seems to make all msgstr == msgid which could be a
problem. If you supply a locale (-l af_ZA) to poorphan then they will be
initialised as blank or untranslated.
Importing
If you have a large number of files that you have for instance migrated from
one version to another then you can use the CVS import facility. You will
usually do this for a version on a branch. So check what these should be
called. Most bracnhes already exist for the POT files. Check these out and
find out what they are called and what their version nubers are - they should
be odd numbers like 1.1.15.
Change to the directory that you want to import:
cd po/1.7/nso
First check and clean the directory. You may need to delete files to prevent
them being imported:
.tmp
x.diff
pomigrate produced .po~ will be ignored by cvs import
Try:
find . -type f | egrep -v ".po$|.po~$"
Now perform the import:
cvs import -b 1.1.15 -d -m "Mozilla 1.7.3 Northern Sotho PO files" po/mozilla/nso mozilla-1-7-branch mozilla-1-7-3-nso-import-from-1-6a
Note:
- version is 1.1.15 obtained by doing a "cvs log" on a file in
po/mozilla/templates
- descriptive message -m mentions product, version, language and file type
- directory is the destination directory in the repository here we import into
nso the Northern Sotho direcotry use ISO codes for languages
- The branch names we also looked up
- The tag is descriptive in that we state its an import of 1.7.3 work. This
allows us to backtrack if needed but also to fix error later and retag a
1.7.3 release being different from the import.
Do a cvs up to get the data from CVS.
Post import
In this stage make sure that you check all changes before commiting them to CVS
by performing the following after every operation.
cvs diff -u nso > x.diff
vim x.diff # fix any errors and rerun if needed
cvs ci nso
Make sure all encodings are correct
poreencode UTF-8 nso
Now perform a migration with compendium:
pomigrate -c nso templates
This will update the files with some rough translations.
Remove any redundant files
poorphan nso templates
Now run through the checks in pofilter to improve the quality of the import,
most important tests are: accelerators, variables, escapes
pofilter --mozilla -t XXXXX -i nso -o nso-check
vim `find nso-check -name "*.po"`
pomerge -i nso-check -o nso -t nso
Note: make sure that the merge does not make fuzzy obsolete message unfuzzy
as this will make the next pomigrate unreliable.
One last time to fill in any blanks through changes we made with the filtering.
pomigrate -c nso templates
Post cleanup
Use mozrdfcreate to migrate the .rdf files and check them
Copy package/install.js from templates to package/ for the language and edit
the file.
Build a test XPI and release
po2moz -l xx-XX -x CVS -x x.diff -x \*.po~ -t langenus.xpi po mozilla-N.N-language.xpi
Creating a PO tarball
Create a PO tarball to match the XPI
tar cvjf mozilla-N.N.N-po-LANGUAGE.tar.bz2 --exclude CVS --exclude \*.po~ --exclude x.diff LANG
e.g.
tar cvjf mozilla-1.7.3-po-afrikaans.tar.bz2 --exclude CVS --exclude \*.po~ --exclude x.diff af/
TODO: Branching, Tagging