Standard gettext PO format

Nicolas Goutte nicolasg at
Fri Dec 30 16:05:18 GMT 2005

On Friday 30 December 2005 14:18, Chusslove Illich wrote:
> >> [: Chusslove Illich :]
> >> It does, I've just checked, my oversight. But it also requires that all
> >> languages of the requested catalog are in the same directory, as
> >> bindtextdomain takes only catalog name and directory name.
> >
> > [: Nicolas Goutte :]
> > But if you give the resource dir to bindtextdomain, will it not be the
> > same? Or very similar? (It is not exactly a problem if we need to change
> > where KDE installs the *.gmo files.)
> The problem is in this: imagine you have your KDE_LANG (or LANGUAGE) set to
> aa:bb languages. MO files of bb are in system locale directory, and you
> added a few MO files of aa that you want to test in your user locale
> directory. Gettext couldn't handle this case, as it would search for
> catalogs of both aa and bb in the same place.

Ah, yes, it have not realized it. But indeed if the MO files are laoded as KDE 
resource, this is possible.

As for an example that a user might use, I can think of the system having not 
his language installed and that he install it on its own directories.

> However, I wonder if this flexibility is really needed. We could say that
> playing with several languages and custom MO files is advanced use anyway,
> so such user could also copy the MO files of bb in the example above to
> his user locale directory when testing. (I guess it wouldn't be a problem
> to bind search directory to first catalog/language combination actually
> found.)

The problem is that normal users do not like to copy installed files.

> > I suppose that $LANGUAGE should be defined very early while loading KDE.
> > (However I do not exactly where, as KDE's initialization is not a part
> > of KDE that I know well. Also changing the KControl setting should set
> > it too, somehow.)
> There is code in klocale.cpp which handles changes to catalogs inside
> KLocale (and is called on startup, before any i18n calls), so I guess I
> could read LANGUAGE there and add its contents to catalogs.

I think that we are misunderstanding us about the use of $LANGUAGE.

Have a nice day!

More information about the kde-core-devel mailing list