Gettext files editors and tools
Gettext files editors
Translators are highly encouraged to use dedicated GNU gettext message
catalogs files (PO files) editing tools. Even though PO files are
plain text files which may be modified with any text editor, the use
of dedicated tools will save translators a lot of time.
This document does not intend to be a reference document about these
tools. Most tools have been packaged for the Debian GNU/Linux
distribution and thus installing them on a Debian system is as easy as
running apt install <package>.
Short list of PO editing tools:
Lokalize (Debian package
lokalize): very complete and
powerful. Needs installing the Qt and KDE Frameworks libraries.
The Lokalize editor (formerly KBabel) is undoubtfully the most complete gettext
message catalogs editor and its use is recommended by the
&i18n-coords;. Its support for non-Latin languages is very
complete, including correct Right-To-Left (RTL) and BiDi support
for Arabic/Hebrew and other RTL languages as well as support for
combined languages such as languages using the Devanagari script.
Gtranslator (Debian package
gtranslator): PO-file editor for the
GNOME Desktop.
Gtranslator is roughly the equivalent of Lokalize for users of the
Gnome environment. Of course, it can be used outside the Gnome
environment with the same drawback as Lokalize.
However, it is not well suited for &d-i; translations as
it does not properly support Plural
Forms. So translators working on files which include
plural forms (base-config are among those
files) should absolutely avoid using Gtranslator.
Poedit (Debian package
poedit): quite complete tool but no
correct handling of non Latin languages on Debian. Uses the
WxWindows toolkit.
Emacs po-mode (Debian package
gettext-el): editing mode for the
Emacs/XEmacs editor. Emacs wizards will probably appreciate
using the same editing environment for gettext message catalog
files.
The Emacs po-mode is however limited when it comes to "advanced"
features such as auto-learning, message compendiums use and
other very useful features for translators.
Gettext files tools
The Debian package gettext includes a whole set of command-line
utilities for handling i18n material.
Several utilities may help translators in manipulating the PO files
contents. For all these utilities, see their respective man pages for
details about their use:
msgcat combines together one or several
files. When used on a single file, it will wrap the file
contents and make it easy to read.
msgmerge may merge together translations from
one or two files as well as update a PO files according to the
contents of a templates file.
msgfmt is aimed at compiling message catalog
files but is also very useful for checking files and get
statistics about their contents. The use of msgfmt
--check --statistics --output-file=/dev/null
&language;.po is highly recommended before commiting a
translation file or sending it to the package maintainer.
Debian specific tools
podebconf-display-po will give translators a rough
idea on how their translation will look like, particularly the screens
length (use this utility on a usual 80x25 terminal). But as cdebconf
and debconf displays slightly differ, and as some scripts do heavy use
of text substitution, one should not fully rely on this program. Running
debian-installer is the only reliable solution to test your translation.
(Note: this does not work for the po files from level 1 under
sublevelX!)
Using podebconf-display-po is mandatory for testing
debconf translations when they are mentioned to be tricky (such as
shadow,
popularity-contest and exim4 translations).
Spellchecking tools
aspell: this package is designed for testing
the spelling in PO files as it will only test the spelling in their
translated part. It relies on the ispell program :
this will then only work with languages for which an ispell dictionary
exists.
Gettext files headers
Translators should not forget to properly fill up the PO files header,
especially the Last-Translator field.
The Project-Id-Version field should be filled
with the package name : this will help translators in translation maintenance.
Plural Forms
Foo