[gnome-commander] Modernize translation infrastructure using glib-i18n.h



commit 5d79d1aafe18476cd48174c1b917422d96dd0735
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Sat Feb 18 20:49:51 2017 +0100

    Modernize translation infrastructure using glib-i18n.h

 configure.ac |    4 ----
 src/main.cc  |   16 +++-------------
 src/utils.cc |    5 -----
 3 files changed, 3 insertions(+), 22 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 67679a5..14ebfad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -290,10 +290,6 @@ fi
 AC_SUBST(PREFIX)
 
 
-dnl Set PACKAGE_LOCALE_DIR in config.h.
-AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${PREFIX}/${DATADIRNAME}/locale", [definition of PACKAGE_LOCALE_DIR])
-
-
 dnl Set PIXMAPS_DIR in config.h.
 AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${PREFIX}/share/pixmaps/${PACKAGE}", [pixmaps location])
 
diff --git a/src/main.cc b/src/main.cc
index 6aa8a2d..7c8276e 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -25,6 +25,7 @@ extern "C"
 }
 
 #include <config.h>
+#include <glib/gi18n.h>
 #include <locale.h>
 #include <unique/unique.h>
 #include <libgnomeui/gnome-ui-init.h>
@@ -53,10 +54,6 @@ gchar *start_dir_right;
 gchar *config_dir;
 gchar *debug_flags;
 
-#ifdef HAVE_LOCALE_H
-struct lconv *locale_information;
-#endif
-
 extern gint created_files_cnt;
 extern gint deleted_files_cnt;
 extern int created_dirs_cnt;
@@ -109,17 +106,10 @@ int main (int argc, char *argv[])
         return 0;
     }
 
-#ifdef ENABLE_NLS
-    bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
+    setlocale (LC_ALL, "");
+    bindtextdomain (PACKAGE, DATADIR "/locale");
     bind_textdomain_codeset (PACKAGE, "UTF-8");
     textdomain (PACKAGE);
-#endif
-
-#ifdef HAVE_LOCALE_H
-    if (setlocale(LC_ALL, "") == NULL)
-        g_warning ("Error while processing locales, call to setlocale failed");
-    locale_information = localeconv();
-#endif
 
     gnome_cmd_mime_config();
 
diff --git a/src/utils.cc b/src/utils.cc
index 835efff..059969a 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -20,7 +20,6 @@
  */
 
 #include <config.h>
-#include <locale.h>
 #include <errno.h>
 #include <dirent.h>
 #include <fnmatch.h>
@@ -47,10 +46,6 @@ struct TmpDlData
     gpointer *args;
 };
 
-#ifdef HAVE_LOCALE_H
-extern struct lconv *locale_information;
-#endif
-
 #define FIX_PW_HACK
 #define STRINGS_TO_URIS_CHUNK 1024
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]