* Fix "locale leak" on newer Linux systems where gettext() seems to cache
authorArt Cancro <ajc@citadel.org>
Thu, 8 Dec 2005 16:49:56 +0000 (16:49 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 8 Dec 2005 16:49:56 +0000 (16:49 +0000)
  its translated messages.  textdomain(textdomain(NULL)) clears the cache.

webcit/ChangeLog
webcit/gettext.c

index ed04cffeeeb69cb8726839498c148c50000829a8..18011f39f1a9db0cc8f372722649ffeda342570c 100644 (file)
@@ -1,5 +1,9 @@
 $Id$
 
+Thu Dec  8 11:48:34 EST 2005 ajc
+* Fix "locale leak" on newer Linux systems where gettext() seems to cache
+  its translated messages.  textdomain(textdomain(NULL)) clears the cache.
+
 Wed Dec  7 22:22:09 EST 2005 ajc
 * Improved the reliability of per-thread locale by unsetting it at the end
   of each transaction.
index 421e668d0b27467ba6d3ceba5cbc2d26db755b52..1f632ca9b701dbbd8f53a21712da9939afb07683 100644 (file)
@@ -180,11 +180,13 @@ void set_selected_language(char *lang) {
  * Activate and deactivate the selected language for this session.
  */
 void go_selected_language(void) {
-       uselocale(wc_locales[WC->selected_language]);
+       uselocale(wc_locales[WC->selected_language]);   /* switch locales */
+       textdomain(textdomain(NULL));                   /* clear the cache */
 }
 
 void stop_selected_language(void) {
-       uselocale(LC_GLOBAL_LOCALE);
+       uselocale(LC_GLOBAL_LOCALE);                    /* switch locales */
+       textdomain(textdomain(NULL));                   /* clear the cache */
 }