From 9f21e3792aed2ac0c9bbbc94d3e4ff169cc0288a Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sun, 5 Jun 2016 18:52:19 -0700 Subject: remove dependency on dcgettext() While fixing issue #3110 I noticed there is exactly one place we use dcgettext() and that use is completely unnecessary. So remove it. --- src/env.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/env.cpp') diff --git a/src/env.cpp b/src/env.cpp index 84baa76f..c7924aef 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -9,7 +9,9 @@ #include #include #include +#ifdef HAVE__NL_MSG_CAT_CNTR #include +#endif #include #include #include @@ -191,15 +193,13 @@ static void handle_locale(const wchar_t *env_var_name) { const char *new_msg_locale = setlocale(LC_MESSAGES, NULL); debug(3, L"old LC_MESSAGES locale: '%s'", old_msg_locale); debug(3, L"new LC_MESSAGES locale: '%s'", new_msg_locale); +#ifdef HAVE__NL_MSG_CAT_CNTR if (strcmp(old_msg_locale, new_msg_locale)) { - // 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. - debug(2, L"changing message locale from '%s' to '%s'", old_msg_locale, new_msg_locale); + // Make change known to GNU gettext. extern int _nl_msg_cat_cntr; _nl_msg_cat_cntr++; - fish_dcgettext("fish", "Changing language to English", LC_MESSAGES); } +#endif } /// Check if the specified variable is a locale variable. -- cgit v1.2.3