diff options
author | Kurtis Rader <krader@skepticism.us> | 2016-06-05 18:52:19 -0700 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-06-05 18:52:19 -0700 |
commit | 9f21e3792aed2ac0c9bbbc94d3e4ff169cc0288a (patch) | |
tree | 0e9ad533e1780e8e0644f960a4a93d22c6fbb152 /src/env.cpp | |
parent | 0b385f145ce6144b5812bd89fa8f73369bcbe57f (diff) |
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.
Diffstat (limited to 'src/env.cpp')
-rw-r--r-- | src/env.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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 <stdbool.h> #include <stddef.h> #include <stdlib.h> +#ifdef HAVE__NL_MSG_CAT_CNTR #include <string.h> +#endif #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> @@ -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. |