From: Sam S. <sd...@gn...> - 2011-08-24 01:46:49
|
Hi Bruno, > * Bruno Haible <oe...@py...> [2011-08-24 00:10:06 +0200]: > >> on a CentOS system I see >> $ ./clisp -E utf-8 -q -norc -L french -x '(sys::text "Bye.")' >> "? bient??t!" >> on a Ubuntu system I see >> $ ./clisp -E utf-8 -q -norc -L french -x '(sys::text "Bye.")' >> "Bye." >> How do I debug this? > > The checklist from the gettext FAQ at > <http://www.gnu.org/software/gettext/FAQ.html#integrating_noop> should > provide the answer. $ ltrace ./clisp -q -norc -L french -x '(sys::text "Bye.")' 2>&1 | grep setlocale setlocale(0, "C") = "C" setlocale(5, "") = "C" setlocale(0, "") = "C" setlocale(2, "") = "C" setlocale(3, "") = "C" setlocale(4, "") = "C" setlocale(5, "fr_FR") = NULL $ ltrace ./clisp -q -norc -L french -x '(sys::text "Bye.")' 2>&1 | grep textdomain textdomain(NULL) = "messages" textdomain("messages") = "messages" bindtextdomain("clisp", "/home/sds/src/clisp/current/buil"...) = "/home/sds/src/clisp/current/buil"... bindtextdomain("clisplow", "/home/sds/src/clisp/current/buil"...) = "/home/sds/src/clisp/current/buil"... bind_textdomain_codeset(0x6204ce, 0x6204dd, 5, 0, 0) = 0x1a34580 $ ltrace ./clisp -q -norc -L french -x '(sys::text "Bye.")' 2>&1 | grep gettext dgettext(0x6204ce, 0x7fffb2046fa0, 0x7fffb2046fa0, 147, 0x7fffb20472e0) = 0x7fffb2046fa0 dgettext(0x6204ce, 0x7fffb2047b40, 0x7fffb2047b40, 4, 0x7fffb2047bb0) = 0x7fffb2047b40 dgettext(0x6204ce, 0x7fffb2046fa0, 0x7fffb2046fa0, 147, 0x7fffb20472e0) = 0x7fffb2046fa0 So, why does setlocale fail? Apparently because "locale -a" does not list fr_FR. Does setlocale set errno? (the man page is silent). I think init_language is called too early - before the memory is initialized, so we cannot signal lisp errors yet. I think it should be called via C_set_current_language after the memory is initialized and it should raise lisp errors on any failure so that we will never see *current-language* = FRENCH and messages delivered in English. WDYT? -- Sam Steingold (http://sds.podval.org/) on Ubuntu 11.04 (natty) X 11.0.11001000 http://jihadwatch.org http://www.PetitionOnline.com/tap12009/ http://iris.org.il http://ffii.org http://thereligionofpeace.com If at first you don't suck seed, try and suck another seed. |