Skip to end of metadata
Go to start of metadata
L10n Team internal docs

This page is mostly for the I18n/L10n Team use.

Updating the POT file

To update the POT (template) file, from the directory containing the checked-out repository (trunk, branches/v1.1, etc.) do the following:

Updating a PO file (merging POT into PO)

If we have a regenerated POT file, we need to migrate the new additions to different languages' PO files. (If necessary, first install gettext and gettext-devel on your machine using apt-get from the subdirectory /pub/gnu/gettext/ on your favorite GNU mirror.) This is done by merging the POT's changes into the PO file; in the below example we update the PO file in place:

Or, for all languages:

After this step, the PO file contains new strings from the POT file either as new positions (i.e., untranslated), or (if the strings are similar to something that was in the PO file earlier) 'intelligently translated' by gettext and marked as 'fuzzy'.

The strings that were in the PO file before the merge, but are not longer present in the POT file (i.e., got 'retired' from CiviCRM) are not deleted, but commented out and moved to the bottom of the PO file. This serves both future translators (how was this translated earlier?) and the gettext's algorithm for 'intelligent translations'.

Updating a MO file (recompiling PO into MO)

Gettext does not use the PO files directly - the PO files have to be compiled into MO binaries. This is done with the following command (as before, this shows how to change the MO file in place):

Or, for all languages:

Synchronising the repository with Pootle

Currently, we allow everyone to help us in translating CiviCRM by using our Pootle installation. This means that we have to somehow coordinate not only updating the PO files from new POT templates (when the CiviCRM strings change), but also updating the PO files in repository with the ones updated by Pootle users.

The current strategy if as follows ([local] denotes a local machine, [salix] denotes the Pootle-hosting server) - please remember to work on the Pootle-hosting server as the pootle user:

  1. [local] regenerate the POT file (via bin/extractor.php)
  2. [local] commit the POT file to the repository
  3. [salix] stop Pootle
  4. [salix] check out the POT file from the repository
  5. [salix] update the PO files from the POT (via msgmerge) for all languages
  6. [salix] rebuild the MO files from the PO files (via msgcat and msgfmt) for all languages
  7. [salix] commit the regenerated PO and MO files to the repository
  8. [salix] start Pootle
Labels
  • None

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.