From: Till K. <til...@gm...> - 2008-08-04 14:41:20
|
I have tried your test program on a system with English, French, and German locales installed and get no translated text in the output. My locale settings: till@till-laptop:~/gutenprint/cvs/HEAD/print$ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= till@till-laptop:~/gutenprint/cvs/HEAD/print$ Also running with "LC_ALL=" or "LC_ALL=en_GB.ISO-8859-1" did not change anything. Till Till Roger Leigh wrote: > Roger Leigh <rl...@wh...> writes: > >> As a result, I would suggest >> >> - simplifying stp_setlocale by removing the langage->locale mappings >> (no longer needed). It could even just wrap setlocale with no >> additional work. >> >> - simplify genppd set_language by simply doing >> setenv("LANGUAGE, language, 1); >> >> By not messing with the locale, we remove the need for exotic locales >> to exist--we just rely on the user having a working non-C locale. >> >> Obviously, this needs testing on Solaris and BSD systems (I guess >> MacOS X won't use this code). Does anyone have access to such systems >> to test? > > If anyone could test using the program I posted, that would be very > helpful. Testing on other BSD, Solaris, UNIX and Linux systems would > be great. I'm using glibc-2.7/gettext-0.17. > > http://nagini.vm.bytemark.co.uk/~rleigh/gettext-test.c > http://nagini.vm.bytemark.co.uk/~rleigh/gutenprint.mo > > You'll need to > - save gutenprint.mo as <foo>/de_GB/LC_MESSAGES/gutenprint.mo > - set localedir to <foo> in gettext-test.c > - set _GNU_SOURCE to _BSD_SOURCE in gettext-test.c (or whatever needs > doing to get setenv() prototyped on BSD) > > Build with "gcc -std=c99 -o gettext-test gettext-test.c > Run ./gettext-test > > You should see something similar to: > > % ./gettext-test > setlocale1: en_GB.ISO-8859-1 > setlocale2: (null) > setlocale3: en_GB.ISO-8859-1 > domain: /usr/share/locale > codset (null)->UTF-8 > selected-domain: gutenprint > lookup: Foto aus fünf Farben gemischt > dlookup: Foto aus fünf Farben gemischt > > To make the test most realistic, start by setting a non-UTF-8-locale > such as en_GB.ISO-8859-1 (any locale except C that is not UTF-8 is > good). This tests correct recoding into UTF-8. This is also why we > are using an ISO-8859-1 message catalogue. Above we see correct UTF-8 > output for a catalogue without a valid system locale, which is the > objective. > > > Regards, > Roger > |