2011-01-18 09:24:57 +00:00
|
|
|
gettext, i18n, and the po/ subdirectory
|
2015-03-23 11:36:12 +00:00
|
|
|
26-Nov-2013
|
2011-01-18 09:24:57 +00:00
|
|
|
David Cantrell <dcantrell@redhat.com>
|
2015-03-23 11:36:12 +00:00
|
|
|
David Shea <dshea@redhat.com>
|
2011-01-18 09:24:57 +00:00
|
|
|
---------------------------------------
|
|
|
|
|
|
|
|
I have attempted to clean up our po/ subdirectory and bring it in to
|
|
|
|
conformance with GNU gettext tools as well as hook it in to GNU autoconf and
|
|
|
|
GNU automake. The gettext software has templates set up for this already,
|
|
|
|
so I'm just using those.
|
|
|
|
|
|
|
|
From time to time, we may have to update our gettext template files and or
|
|
|
|
expand or reduce the information in the files. How do you know what files
|
|
|
|
do what? Here's an explanation:
|
|
|
|
|
2015-03-23 11:36:12 +00:00
|
|
|
ABOUT-NLS
|
|
|
|
config.rpath
|
2011-01-18 09:24:57 +00:00
|
|
|
m4/gettext.m4
|
|
|
|
m4/iconv.m4
|
|
|
|
m4/nls.m4
|
|
|
|
m4/po.m4
|
2015-03-23 11:36:12 +00:00
|
|
|
m4/...
|
2011-01-18 09:24:57 +00:00
|
|
|
po/Makefile.in.in
|
2015-03-23 11:36:12 +00:00
|
|
|
po/Makevars.template
|
2011-01-18 09:24:57 +00:00
|
|
|
po/Rules-quot
|
|
|
|
po/boldquot.sed
|
|
|
|
po/en@boldquot.header
|
|
|
|
po/en@quot.header
|
|
|
|
po/insert-header.sin
|
|
|
|
po/quot.sed
|
|
|
|
po/remove-potcdate.sin
|
|
|
|
|
2015-03-23 11:36:12 +00:00
|
|
|
These files are copied in when 'autopoint' is run on the source
|
|
|
|
project, which happens as part of autogen.sh. In general, we should never
|
2011-01-18 09:24:57 +00:00
|
|
|
need to touch these files.
|
|
|
|
|
2015-03-23 11:36:12 +00:00
|
|
|
The autopoint tool depends on two macros in configure.ac: AM_GNU_GETTEXT,
|
|
|
|
and AM_GNU_GETTEXT_VERSION([<version>]). From time to time we may need to
|
|
|
|
update the set of gettext files that we use. To do so, update the gettext
|
|
|
|
version number in AM_GNU_GETTEXT_VERSION and run autogen.sh. Be sure to
|
|
|
|
also update the required gettext version in the spec file.
|
|
|
|
|
2011-01-18 09:24:57 +00:00
|
|
|
po/Makevars
|
|
|
|
|
2015-03-23 11:36:12 +00:00
|
|
|
Should be updated when we update gettext files from autopoint with a new
|
|
|
|
gettext version. A file called po/Makevars.template will appear and we
|
|
|
|
can move over our values to the new file and commit it. We do not need to
|
2011-01-18 09:24:57 +00:00
|
|
|
change this file on a regular basis.
|
|
|
|
|
|
|
|
po/POTFILES.in
|
|
|
|
|
|
|
|
This file contains a listing of all source files in the project that
|
|
|
|
have translatable strings.
|
|
|
|
|
2015-03-23 11:36:12 +00:00
|
|
|
Some files can't be handled by gettext directly, such as the GNOME desktop
|
|
|
|
files and anything without a clear filename extension. For these types of
|
|
|
|
files, add a rule to po/Rules-extract to create a file that gettext can
|
|
|
|
handle, and add the name of the generated file to po/POTFILES.in.
|
|
|
|
|
2011-01-18 09:24:57 +00:00
|
|
|
po/LINGUAS
|
|
|
|
|
|
|
|
Space-delimited list of languages available. If a new language is
|
|
|
|
added, it should be added to this file.
|
|
|
|
|
2015-03-23 11:36:12 +00:00
|
|
|
po/Rules-extract
|
|
|
|
|
|
|
|
Extra Makefile rules to process files that gettext can't handle on its
|
|
|
|
own.
|
|
|
|
|
|
|
|
Currently there are two types of files handled in Rules-extract: files in
|
|
|
|
a language that gettext doesn't know, and files in a language that gettext
|
|
|
|
can't figure out from the filename. For the first type of file (.desktop
|
|
|
|
files, consolehelper files), we use intltool-extract to create a C-style
|
|
|
|
header file containing the translatable strings, and for the second we
|
|
|
|
manually run xgettext, forcing a --language setting, and generate an
|
|
|
|
intermediate .po file.
|
|
|
|
|
|
|
|
In both cases, the name of the generated file is what goes in
|
|
|
|
po/POTFILES.in.
|
|
|
|
|
|
|
|
po/anaconda.pot
|
|
|
|
|
|
|
|
This is the template file built by xgettext containing all of the
|
|
|
|
translatable strings. The file is updated and committed to git as part of
|
|
|
|
building a release.
|
|
|
|
|
2011-01-18 09:24:57 +00:00
|
|
|
po/*.po
|
|
|
|
|
2015-03-23 11:36:12 +00:00
|
|
|
Actual translated strings, as maintained by the translation team(s). These
|
|
|
|
files are not stored in git. The po-pull target will pull the latest
|
|
|
|
translations from Transifex.
|