[network-manager-openvpn] properties: call bindtextdomain() and bind_textdomain_codeset()



commit d3ad57bfd9e73df10771f060d04eae580fc93c8a
Author: Dan Winship <danw gnome org>
Date:   Thu Jun 13 12:07:33 2013 -0300

    properties: call bindtextdomain() and bind_textdomain_codeset()
    
    Make sure gettext knows the translations are in UTF-8, or else they'll
    get garbled if the user's domain isn't UTF-8.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702153

 properties/Makefile.am  |    7 +++----
 properties/nm-openvpn.c |    3 +++
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/properties/Makefile.am b/properties/Makefile.am
index 69c3fbb..cb0c0ce 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -17,16 +17,15 @@ ui_DATA = nm-openvpn-dialog.ui
 libnm_openvpn_properties_la_CFLAGS =                    \
         $(GLIB_CFLAGS)                                  \
         $(GTK_CFLAGS)                                   \
-        $(NM_CFLAGS)                       \
+        $(NM_CFLAGS)                                    \
         $(GNOMEKEYRING_CFLAGS)                          \
         $(DISABLE_DEPRECATED)                           \
         -I$(top_srcdir)/                                \
         -DICONDIR=\""$(datadir)/pixmaps"\"              \
-        -DUIDIR=\""$(uidir)"\"                    \
+        -DUIDIR=\""$(uidir)"\"                          \
         -DG_DISABLE_DEPRECATED                          \
         -DGDK_DISABLE_DEPRECATED                        \
-        -DGNOME_DISABLE_DEPRECATED                      \
-        -DGNOMELOCALEDIR=\"$(datadir)/locale\"          \
+        -DLOCALEDIR=\"$(datadir)/locale\"               \
         -DVERSION=\"$(VERSION)\"
 
 libnm_openvpn_properties_la_LIBADD = \
diff --git a/properties/nm-openvpn.c b/properties/nm-openvpn.c
index 3e09869..09d8a51 100644
--- a/properties/nm-openvpn.c
+++ b/properties/nm-openvpn.c
@@ -764,6 +764,9 @@ nm_vpn_plugin_ui_factory (GError **error)
        if (error)
                g_return_val_if_fail (*error == NULL, NULL);
 
+       bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+       bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
        return NM_VPN_PLUGIN_UI_INTERFACE (g_object_new (OPENVPN_TYPE_PLUGIN_UI, NULL));
 }
 


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