Standard gettext PO format

Josef Spillner spillner at
Fri Dec 30 13:23:17 GMT 2005

El Viernes, 30. Diciembre 2005 13:05, Chusslove Illich escribió:
> First, if LC_ALL is not set to some existing system locale, or set to
> POSIX, or not set at all, Gettext will not provide translation. No matter
> what is in LANGUAGE, or anywhere else. Bruno Haible, the maintainer of
> Gettext, says this behavior is not a bug, but prescribed by POSIX.

setlocale(LC_ALL, "") is commonly needed for all gettext'ized programs. This 
is not news. I'd simply summarise the above as: is is a strange behaviour 
prescribed by POSIX.

> Second, current KDE code has a feature that when KCatalog is destroyed, the
> catalog file is "unloaded". Gettext has no such explicit provision. What
> is the need of this unloading, is there a situation in KDE where catalogs
> could just accumulate and accumulate?

Note that when unloading is not in place, you really need to increase the 
(external) _nl_msg_cat_cntr variable, or otherwise cached results might give 
back wrong translation values.

> Third, there is no way to tell if Gettext found a translation, or just
> returned a fallback string. If the language priority is not handled by
> Gettext, as I did above, than I must consider translation equal to
> fallback as translation not being found (and then check next language in
> queue). This might be no issue, but it is dirty and I feel uncomfortable.

Another reason to request some changes in gettext. In fact there are a lot of 
functions which should be added while still retaining backwards 
compatibility, like the above or the ability to load catalogs directly 
(specifying a file name).


More information about the kde-core-devel mailing list