I've tried to neaten up the locale stuff, moving it
all to one part of the tuxpaint.c file. There are some
things I find strange about the code.
First of all, why so many setlocale() calls?
It seems like all except the ones right before
a call to set_current_language() are useless.
Second, why set environment variables? Normally,
one sets environment variables before calling exec().
Within a program, data is usually passed around via
normal C variables.
Third of all, what is with the LANG usage for Polish
and Lithuanian? It looks like a bug.
Fourth, why doesn't Hungarian set LC_ALL like the others?
This too looks like a bug.
Current call graph:
main
setlocale(LC_ALL, "")
setup
parse_options (system conf file)
set_langstr
parse_options (user conf file)
set_langstr
set_langstr \____ either
do_locale_option / order
LANG=foo
setlocale(LC_ALL,"")
setup_language
if polish or lithuanian, set_langstr() (WTF???)
LANGUAGE=foo
LC_ALL=foo
setlocale(LC_ALL, "");
set_current_language
*** setlocale(LC_MESSAGES, NULL) and lots of monkey business ***
load_locale_font
LANG=C
OUTPUT_CHARSET=C
setlocale(LC_ALL, "C")
set_current_language()
*** setlocale(LC_MESSAGES, NULL) and lots of monkey business ***
_______________________________________________
Tuxpaint-dev mailing list
[email protected]
http://tux4kids.net/mailman/listinfo/tuxpaint-dev