Hi, From: GOTO Masanori <[EMAIL PROTECTED]> Subject: Re: Gettext and LC_MESSAGES Date: Sat, 10 Jun 2000 06:06:22 +0900
> gettext depends on the success of setlocale(), in most case. > In case of that the system does not have setlocale() function, > it try to get locale information using own library. Though Debian system has setlocale(), gettext doesn't depend on the success of setlocale(). An example is LANG=de. All of setlocale(*, "de") [* = LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME] fail, while German messages are displayed for LANG=de as follows: -------------------------------- ~$ LANG=de ls foobar ls: foobar: Datei oder Verzeichnis nicht gefunden -------------------------------- I found an another problem on locale system. -------------------------------- ~$ locale -a | grep de de de_AT de_BE de_CH de_DE de_LU deutsch -------------------------------- /usr/bin/locale is included in libc6 package. > ? LC_MONETARY ? The way to display money ($100.00 and so on) should depend on LC_MONETARY locale category. This may be used for spreadsheet. > gettext and XFont* are different issue. Separate. I suspect that XFontSet doesn't work with 8bit characters for LANG=de because setlocale() fails and XmbDrawString() works within ASCII character set. Thus, I think gettext and setlocale() should work together. However, whether this suspect is right or not, the way for users to configure their locale should be united. I think it is confising that LANG=de gives German message for gettext while setlocale(*, "de") fails and XFontSet falls into ASCII character set. > However, I agree that we should use not XFontStruct but XFontset. This is not always true. While I work with upstream developers of a few X clients, I found many people think XFontSet is not 8-bit clean and only for multibyte-language-speaking people. This is why many softwares such as IceWM and so on has user-configuration item whether XFontStruct or XFontSet is used. Though the truth is that these people (who think XFontSet is not 8-bit clean) only don't know about locale. However, they have their reason; LANG=de gives German messages and it is natural that they think that LANG=de is a correct locale specification. And more, there may be a system where locale database is not installed. Thus, my solution was to use XFontStruct when (1) setlocale() fails, (2) setlocale() returns "C", or (3) setlocale() returns "POSIX", otherwise use XFontSet. (The beta version of Blackbox and the CVS version of Sawfish adopt this mechanism. I am also starting to work with IceWM and Window Maker.) --- Tomohiro KUBOTA <[EMAIL PROTECTED]> http://surfchem0.riken.go.jp/~kubota/

