[Tuxpaint-devel] Bug in locale code?
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: Bill K. <nb...@so...> - 2008-02-19 23:30:20
|
I'm trying to slightly tweak where UI buttons get drawn, on a per-locale-basis
(the font that Pango uses to render Khmer text is very tall, and I thought I
could let it push down a few pixels, rather than squish it or use a smaller
font, which would make it less readable.)
However, I'm discover a problem whereby Tux Paint tries to look up which
locale is being used (an integer representing an index into a variety of
arrays, based on the "LANG_xx" enums defined in i18n.h). Despite using
"putenv()" to set the LC_ALL and LANG variables, setlocale() seems to think
I'm in "en_US.UTF-8".
The Khmer text renders properly in Tux Paint, but at that point in the code
(i18n.c's set_current_language()), where I want to detect what locale we
actually got, I'm getting LANG_EN for English. :(
Can anyone tell what we're doing wrong in there?
The "setlocale(LC_ALL, "");" found at the end of i18n.c's setup_language()
_should_ set all of our locale LC_'s to the one we requested via
"putenv("LC_ALL=...")" (in that same function), right?
The "loc = setlocale(LC_MESSAGES, NULL)" found in set_current_language()
should then putting that same locale into the 'loc' variable, but, as I
mentioned, I'm getting en_US.UTF-8. *shrug*
FWIW, I'm on Ubuntu 7.10 using KDE 3.5.6. I'm asking Tux Paint to use
Khmer by running:
tuxpaint --lang khmer
I'll try it by setting by LANG env. variable, instead and see if that helps.
Thx,
--
-bill!
bi...@ne...
http://www.newbreedsoftware.com/
|