T
Torsten Bronger
Hallöchen!
I have to generate excerpts in different human languages in a
program. In general, the language is not the locale's language, but
set at runtime. Nevertheless, GNU's gettext should be used for the
excerpts. This means that I have to wrap calls to gettext() in a
function that sets the locale temporarily.
The problem is how to do that. Let's assume I need to generate
German snippets. Then I could say
setlocale (LC_MESSAGES, "de");
and
setlocale (LC_MESSAGES, "");
to reset it. However, this doesn't work on my computer. It wants
to see "de_DE". This, however, doesn't work on another computer
which insists on a plain "de". Even worse, I have a report of an
American developer that on his computer none of these variants had
any effect, although German messages were definitely installed.
Is there a reliable way of setting the locale?
Thank you!
Tschö,
Torsten.
I have to generate excerpts in different human languages in a
program. In general, the language is not the locale's language, but
set at runtime. Nevertheless, GNU's gettext should be used for the
excerpts. This means that I have to wrap calls to gettext() in a
function that sets the locale temporarily.
The problem is how to do that. Let's assume I need to generate
German snippets. Then I could say
setlocale (LC_MESSAGES, "de");
and
setlocale (LC_MESSAGES, "");
to reset it. However, this doesn't work on my computer. It wants
to see "de_DE". This, however, doesn't work on another computer
which insists on a plain "de". Even worse, I have a report of an
American developer that on his computer none of these variants had
any effect, although German messages were definitely installed.
Is there a reliable way of setting the locale?
Thank you!
Tschö,
Torsten.