[systemd-devel] Journal Message Catalog

Lennart Poettering lennart at poettering.net
Thu Feb 14 12:14:43 PST 2013


On Thu, 14.02.13 13:28, Keith Robertson (kroberts at redhat.com) wrote:

> Hi,
> 
> I was looking through the Journal Message Catalog spec [1] and I
> wanted to say kudos.  About time there was something like this for
> linux apps.
> 
> In reading the spec, I do have a concern about the fact that the
> spec seems to want to interleave the various supported locales
> within one catalog file (ie. a text file).  According to [1] the
> different translated messages within the catalog would be suffixed
> by the typical LL_CC (language_country) pattern.
> 
> I think this could be both confusing for people that are actually
> doing the translation and problematic for organizations that want to
> translate.  It might be useful to allow for something like locale
> specific PO (gettext portable object) files.  This would allow
> organizations to send the PO files off to different translation
> centers and have each translation center work independently rather
> than collectively on one monster file with interleaved locales.

Note that you may have multiple catalog files and you can distribute the
translations among multiple files. This leaves full flexibility to the
projects which want to provide message catalog entries. For example,
they could create individual files:

/usr/lib/systemd/catalog/foobar.catalog
/usr/lib/systemd/catalog/foobar-de_DE.catalog
/usr/lib/systemd/catalog/foobar-fr_FR.catalog

and so on, and that's entirely up to the individual project how they
split things up. It's entirely OK if the french version for a specific
message ID is in a different file than the german or the LANG=C
version...

> Further, this would allow the translators to leave the 'message ID'
> alone and not tamper with it by adding a 'suffix'.  The locale
> meta-data could be conveyed by encoding this information into the
> file name in a manner similar to Java[2] or gettext[3].

Generating these catalog files in a way that would be compatible to
gettext is certainly desirable, and this can be done, by the projects at
free will.

> Note: I'm not saying encoding locale into the filename is the best
> way it is just a common way of delivery.  You could, of course, use
> some other sort of meta-data and bind all locales into one binary
> dictionary which is what is currently happening (I think).

We will take all catalog files from /usr/lib/systemd/catalog/*.catalog
and build a binary index out of them with "journalctl
--update-catalog". RPMs that install new catalogs should invoke that
command from their RPM scriptlets.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list