[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Information about gettext

From: Bruno Haible
Subject: Re: Information about gettext
Date: Wed, 28 May 2008 00:10:36 +0200
User-agent: KMail/1.5.4


S├ębastien Morand wrote:
> Your address was gived to me by people of address@hidden

You could also have used the address that is displayed by 'gettext --help'.

> I would like to have some information about gettext implementation.
> I spend some hours to understand design and choices in the gettext
> tools which is widely used in the OpenSource softwares for
> internationalization.
> My test was to create 2 hello.mo files in 2 languages and put them in
> the correct directory : locale/en/LC_MESSAGES/hello.mo and
> locale/fr/LC_MESSAGES/hello.mo.
> Then I try to get them worked. Under FreeBSD, no problem, under
> Ubuntu, doesn't work.

The general answer for this question is found in the FAQ at
(The FAQ is also part of the gettext distribution.)

> The point was, the gettext function was trying
> to read a file located in /usr/lib/locales/fr in order to accept to
> set up the locale.
> So my questions are:
> 1) Why it is required to have this directory set up in order to use
> gettext? If I try my application in a plateform where this definitions
> are missing my localization doesn't work anymore, even if I have the
> correct path and definition in my code !

This was a choice made in the implementation of glibc. Unlike with other
libc implementation, in GNU libc the user is able to create locales by
himself; the system can therefore assume that the appropriate locale is
present. You need the locale also for other tasks like sorting, interpreting
regular expressions, querying the user, etc. So if the locale is missing but
gettext worked nevertheless, the result for the user would be suboptimal

> 2) Where can I find the format of LC_TELEPHONE, LC_ADDRESS and so on.
> Only LC_MESSAGES looks like really documented, i would like to be able
> to use the other file in my applications.

These locale categories are more or less specified in the ISO 14652 draft 
See also


reply via email to

[Prev in Thread] Current Thread [Next in Thread]