[glib/glib.fixtools.i18n: 53/53] gio-tool.c: Don't hardcode localedir on Windows



commit c05817ce437d7d924037d71206c13a6cc3d10506
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jun 14 12:34:58 2019 +0800

    gio-tool.c: Don't hardcode localedir on Windows
    
    We ought to construct the localedir based on the location of the GLib
    DLL, like what the other tools do.

 gio/gio-tool.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/gio/gio-tool.c b/gio/gio-tool.c
index abcd46d05..c0aec7492 100644
--- a/gio/gio-tool.c
+++ b/gio/gio-tool.c
@@ -253,9 +253,20 @@ main (int argc, char **argv)
   const char *command;
   gboolean do_help;
 
+#ifdef G_OS_WIN32
+  gchar *localedir;
+#endif
+
   setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
   textdomain (GETTEXT_PACKAGE);
+
+#ifdef G_OS_WIN32
+  localedir = _glib_get_locale_dir ();
+  bindtextdomain (GETTEXT_PACKAGE, localedir);
+  g_free (localedir);
+#else
   bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
+#endif
 
 #ifdef HAVE_BIND_TEXTDOMAIN_CODESET
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");


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