From 7cb4c1d7b1d8b6021e5037ff2c591c1a9ccc4c72 Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Tue, 14 May 2019 22:37:05 +0200 Subject: [PATCH] Cleanup of no longer used Gettext flags We don't need HAVE_GETTEXT conditional code --- CMakeLists.txt | 3 --- common/config.h.cmake.in | 9 --------- gnucash/gnucash-bin.c | 24 +++++++++--------------- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd2ef68fb6..0c292d95a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -697,9 +697,6 @@ endif(UNIX OR MINGW) endif(ENABLE_BINRELOC) if (UNIX OR MINGW) -set (HAVE_BIND_TEXTDOMAIN_CODESET 1) -set (HAVE_DCGETTEXT 1) -set (HAVE_GETTEXT 1) set (HAVE_GETTIMEOFDAY 1) set (HAVE_GUILE 1) set (HAVE_LIBM 1) diff --git a/common/config.h.cmake.in b/common/config.h.cmake.in index 654737ea8b..7a2ca2f51e 100644 --- a/common/config.h.cmake.in +++ b/common/config.h.cmake.in @@ -78,9 +78,6 @@ /* Don't use deprecated glib functions */ #cmakedefine G_DISABLE_DEPRECATED 1 -/* Define to 1 if you have the `bind_textdomain_codeset' function. */ -#cmakedefine HAVE_BIND_TEXTDOMAIN_CODESET 1 - /* define if the Boost library is available */ #cmakedefine HAVE_BOOST @@ -93,9 +90,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DBI_DBI_H 1 -/* Define to 1 if you have the `dcgettext' function. */ -#cmakedefine HAVE_DCGETTEXT 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DIRENT_H 1 @@ -120,9 +114,6 @@ /* Define to 1 if you have the `getppid' function. */ #cmakedefine HAVE_GETPPID 1 -/* Define if the GNU gettext() function is already present or preinstalled. */ -#cmakedefine HAVE_GETTEXT 1 - /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine HAVE_GETTIMEOFDAY 1 diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c index c6bc3bd538..7d89027670 100644 --- a/gnucash/gnucash-bin.c +++ b/gnucash/gnucash-bin.c @@ -69,10 +69,8 @@ static QofLogModule log_module = GNC_MOD_GUI; */ #define __MSWIN_CONSOLE__ 0 -#ifdef HAVE_GETTEXT -# include -# include -#endif +#include +#include #ifdef MAC_INTEGRATION # include @@ -848,6 +846,7 @@ redirect_stdout (void) int main(int argc, char ** argv) { + gchar *localedir = gnc_path_get_localedir(); #if !defined(G_THREADS_ENABLED) || defined(G_THREADS_IMPL_NONE) # error "No GLib thread implementation available!" #endif @@ -883,17 +882,12 @@ main(int argc, char ** argv) g_setenv ("LC_ALL", "C", TRUE); setlocale (LC_ALL, "C"); } -#ifdef HAVE_GETTEXT - { - gchar *localedir = gnc_path_get_localedir(); - bindtextdomain(GETTEXT_PACKAGE, localedir); - bindtextdomain("iso_4217", localedir); // For win32 to find currency name translations - bind_textdomain_codeset("iso_4217", "UTF-8"); - textdomain(GETTEXT_PACKAGE); - bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); - g_free(localedir); - } -#endif + bindtextdomain(GETTEXT_PACKAGE, localedir); + bindtextdomain("iso_4217", localedir); // For win32 to find currency name translations + bind_textdomain_codeset("iso_4217", "UTF-8"); + textdomain(GETTEXT_PACKAGE); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + g_free(localedir); gnc_parse_command_line(&argc, &argv); gnc_print_unstable_message();