aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-07-20 09:11:49 +1000
committerGravatar axel <axel@liljencrantz.se>2006-07-20 09:11:49 +1000
commit40ed01f6f2e8d32e94f71dd19ebe71d9c5d5e556 (patch)
treeeee36fce20f82dfceeba79669d1d34e7f3cba9b3 /env.c
parentb2e2743195a103561047d1be6e448a07a414c12d (diff)
Move a few pieces of implementation-specific kludges related to different gettext implementations out of env.c and into fallback.c
darcs-hash:20060719231149-ac50b-c930a77ae76249b27f800f1d61146482c8f005c9.gz
Diffstat (limited to 'env.c')
-rw-r--r--env.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/env.c b/env.c
index 2729af8f..22984ace 100644
--- a/env.c
+++ b/env.c
@@ -31,6 +31,10 @@
#include <ncurses/term.h>
#endif
+#if HAVE_LIBINTL_H
+#include <libintl.h>
+#endif
+
#include <errno.h>
@@ -305,16 +309,17 @@ static void handle_locale()
if( wcscmp( wsetlocale( LC_MESSAGES, (void *)0 ), old ) != 0 )
{
- /* Try to make change known to gettext. */
-#ifdef HAVE__NL_MSG_CAT_CNTR
- {
- extern int _nl_msg_cat_cntr;
- ++_nl_msg_cat_cntr;
- }
-#elif HAVE_DCGETTEXT
- dcgettext("fish","Changing language to English",LC_MESSAGES);
-#endif
-
+ /*
+ Try to make change known to gettext. Both changing
+ _nl_msg_cat_cntr and calling dcgettext might potentially
+ tell some gettext implementation that the translation
+ strings should be reloaded. We do both and hope for the
+ best.
+ */
+ extern int _nl_msg_cat_cntr;
+ ++_nl_msg_cat_cntr;
+ dcgettext( "fish", "Changing language to English", LC_MESSAGES );
+
if( is_interactive )
{
debug( 0, _(L"Changing language to English") );