[Top][All Lists]

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

Bug#250488: LANGUAGE should be allowed to work even under C locale (fwd)

From: Santiago Vila
Subject: Bug#250488: LANGUAGE should be allowed to work even under C locale (fwd)
Date: Sun, 27 Jun 2004 20:11:40 +0200 (CEST)


Received this from the debian bug system:

---------- Forwarded message ----------
From: Bill Allombert <address@hidden>
To: Debian Bug Tracking System <address@hidden>
Date: Sun, 23 May 2004 11:53:25 +0200
Subject: Bug#250488: LANGUAGE should be allowed to work even under C locale

Package: gettext
Version: 0.14.1-2
Severity: wishlist

Hello Santiago,

gettext/intl/dcigettext.c:1219 include the following comment:

  /* Ignore LANGUAGE if the locale is set to "C" because
     1. "C" locale usually uses the ASCII encoding, and most international
        messages use non-ASCII characters. These characters get displayed
        as question marks (if using glibc's iconv()) or as invalid 8-bit
        characters (because other iconv()s refuse to convert most non-ASCII
        characters to ASCII). In any case, the output is ugly.
     2. The precise output of some programs in the "C" locale is specified
        by POSIX and should not depend on environment variables like
        "LANGUAGE".  We allow such programs to use gettext().  */

gettext should provide a way to use LANGUAGE even if locale is set to "C"

What I want to do is to generate a file encoded in UTF-8 with a string
translated in all the locales at once, like a .desktop file:

Name[ca]=Shells per a X
Name[es]=Consolas X
Name[fr]=Terminaux graphiques
Name[it]=Terminali per X
Name[pl]=PowÅ<82>oki dla X
Name[pt_BR]=Shells Gráficos
Name[tr]=X kabukları
Name[uk]=X Ñ<82>еÑ<80>мÑ<96>нали

For that purpose I use the following snippet from
info gettext "Being a `gettext' grok":

            /* Change language.  */
            setenv ("LANGUAGE", lang, 1);

            /* Make change known.  */
              extern int  _nl_msg_cat_cntr;

It works quite well unless the locale is set to C, which do not make
sense since I use a separate domain for error message.  So error message
are in the current locale, while the file output by the program should
be locale independant.

So is there a way to work around this gratuituous limitation ?
Is there a better way to proceed ?

Bill. <address@hidden>

Imagine a large red swirl here.

reply via email to

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