[glib-networking/wip/openssl] proxy/gnome: Don't hardcode paths on Windows



commit 3fa345651423667fdd60d543b498330f881fff28
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue May 10 17:04:03 2016 +0800

    proxy/gnome: Don't hardcode paths on Windows
    
    Use GLib'w Windows APIs to construct the path for the translations
    dynamically on Windows.

 proxy/gnome/gnome-proxy-module.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/proxy/gnome/gnome-proxy-module.c b/proxy/gnome/gnome-proxy-module.c
index 88d0a27..c4fa1f5 100644
--- a/proxy/gnome/gnome-proxy-module.c
+++ b/proxy/gnome/gnome-proxy-module.c
@@ -19,13 +19,29 @@
 
 #include "config.h"
 
+#include <glib/gi18n-lib.h>
+
 #include "gproxyresolvergnome.h"
 
 
 void
 g_io_module_load (GIOModule *module)
 {
+  gchar *basedir, *localedir;
+
   g_proxy_resolver_gnome_register (module);
+
+#ifdef G_OS_WIN32
+  basedir = g_win32_get_package_installation_directory_of_module (NULL);
+  localedir = g_build_filename (basedir, "share", "locale", NULL);
+  g_free (basedir);
+#else
+  localedir = g_strdup (LOCALE_DIR);
+#endif
+
+  bindtextdomain (GETTEXT_PACKAGE, localedir);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+  g_free (localedir);
 }
 
 void


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