Abdelrazak Younes wrote: > This last line in particular looks suspicious. Why do we set environment > variable at each translation request?
Because the environment variable determines what language gettext will use, and we don't know what other message was translated before. To my knowledge no library call of gettext exists that takes the language as a function argument rather than an environment variable. > This other chunk of code rings a bell in the context of the hebrew RTL > bug (related to LC_TYPE): > > // CTYPE controls what getmessage thinks what encoding the po file uses > char const * lc_ctype = setlocale(LC_CTYPE, NULL); > string oldCTYPE = lc_ctype ? lc_ctype : ""; But setting LC_TYPE is needed for gettext. > I don't know anything about gettext but this stuff looks awfully > complicated. Couldn't we simplify the thing a bit? I don't think so. This awfully complicated stuff is the result of many bug fixes and a lot of work of several people. It is so complicated because some gettext versions are broken (especially on windows). I once tried to simplify this but only made Michael Gerz angry who suddenly discovered lots of bugs. Unless you really want to spend a lot of time yo learn all aspects about gettext I suggest that you leave this alone. Georg