properties: call bindtextdomain() and bind_textdomain_codeset()
authorDan Winship <danw@gnome.org>
Thu, 13 Jun 2013 15:07:33 +0000 (12:07 -0300)
committerDan Winship <danw@gnome.org>
Wed, 11 Sep 2013 18:21:18 +0000 (14:21 -0400)
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
properties/nm-openvpn.c

index 69c3fbb..cb0c0ce 100644 (file)
@@ -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 = \
index 3e09869..09d8a51 100644 (file)
@@ -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));
 }