summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-11-13 10:29:37 -0500
committerDan Winship <danw@gnome.org>2014-11-13 17:18:42 -0500
commit53f5e9afa466b0b1517cbac208ed01ab8f4b6274 (patch)
tree405cdbb4148855694518c4916b865775bac9cf2e
parent3bfb163a74fb98698b03d8a605b0164869a2ed4a (diff)
downloadNetworkManager-53f5e9afa466b0b1517cbac208ed01ab8f4b6274.tar.gz
libnm*: fix library gettext usage
Libraries need to include <gi18n-lib.h>, not <gi18n.h>, so that _() will get defined to "dgettext (GETTEXT_DOMAIN, string)" rather than "gettext (string)" (which will use the program's default domain, which works fine for programs in the NetworkManager tree, but not for external users). Likewise, we need to call bindtextdomain() so that gettext can find the translations if the library is installed in a different prefix from the program using it (and bind_textdomain_codeset(), so it will know the translations are in UTF-8 even if the locale isn't). (The fact that no one noticed this was broken before is because the libraries didn't really start returning useful translated strings much until 0.9.10, and none of the out-of-tree clients have been updated to actually show those strings to users yet.)
-rw-r--r--libnm-core/Makefile.am1
-rw-r--r--libnm-core/crypto.c2
-rw-r--r--libnm-core/crypto_gnutls.c2
-rw-r--r--libnm-core/crypto_nss.c2
-rw-r--r--libnm-core/nm-connection.c2
-rw-r--r--libnm-core/nm-setting-8021x.c2
-rw-r--r--libnm-core/nm-setting-adsl.c2
-rw-r--r--libnm-core/nm-setting-bluetooth.c2
-rw-r--r--libnm-core/nm-setting-bond.c2
-rw-r--r--libnm-core/nm-setting-bridge-port.c2
-rw-r--r--libnm-core/nm-setting-bridge.c2
-rw-r--r--libnm-core/nm-setting-cdma.c2
-rw-r--r--libnm-core/nm-setting-connection.c2
-rw-r--r--libnm-core/nm-setting-dcb.c2
-rw-r--r--libnm-core/nm-setting-gsm.c2
-rw-r--r--libnm-core/nm-setting-infiniband.c2
-rw-r--r--libnm-core/nm-setting-ip-config.c2
-rw-r--r--libnm-core/nm-setting-ip4-config.c2
-rw-r--r--libnm-core/nm-setting-ip6-config.c2
-rw-r--r--libnm-core/nm-setting-olpc-mesh.c2
-rw-r--r--libnm-core/nm-setting-ppp.c2
-rw-r--r--libnm-core/nm-setting-pppoe.c2
-rw-r--r--libnm-core/nm-setting-team-port.c2
-rw-r--r--libnm-core/nm-setting-team.c2
-rw-r--r--libnm-core/nm-setting-vlan.c2
-rw-r--r--libnm-core/nm-setting-vpn.c2
-rw-r--r--libnm-core/nm-setting-wimax.c2
-rw-r--r--libnm-core/nm-setting-wired.c2
-rw-r--r--libnm-core/nm-setting-wireless-security.c2
-rw-r--r--libnm-core/nm-setting-wireless.c2
-rw-r--r--libnm-core/nm-setting.c2
-rw-r--r--libnm-core/nm-utils.c4
-rw-r--r--libnm-glib/nm-device.c2
-rw-r--r--libnm-glib/nm-remote-connection.c2
-rw-r--r--libnm-util/Makefile.am1
-rw-r--r--libnm-util/crypto.c2
-rw-r--r--libnm-util/crypto_gnutls.c2
-rw-r--r--libnm-util/crypto_nss.c2
-rw-r--r--libnm-util/nm-connection.c2
-rw-r--r--libnm-util/nm-setting-8021x.c2
-rw-r--r--libnm-util/nm-setting-adsl.c2
-rw-r--r--libnm-util/nm-setting-bluetooth.c2
-rw-r--r--libnm-util/nm-setting-bond.c2
-rw-r--r--libnm-util/nm-setting-bridge-port.c2
-rw-r--r--libnm-util/nm-setting-bridge.c2
-rw-r--r--libnm-util/nm-setting-cdma.c2
-rw-r--r--libnm-util/nm-setting-connection.c2
-rw-r--r--libnm-util/nm-setting-dcb.c2
-rw-r--r--libnm-util/nm-setting-gsm.c2
-rw-r--r--libnm-util/nm-setting-infiniband.c2
-rw-r--r--libnm-util/nm-setting-ip4-config.c2
-rw-r--r--libnm-util/nm-setting-ip6-config.c2
-rw-r--r--libnm-util/nm-setting-olpc-mesh.c2
-rw-r--r--libnm-util/nm-setting-ppp.c2
-rw-r--r--libnm-util/nm-setting-pppoe.c2
-rw-r--r--libnm-util/nm-setting-team-port.c2
-rw-r--r--libnm-util/nm-setting-team.c2
-rw-r--r--libnm-util/nm-setting-vlan.c2
-rw-r--r--libnm-util/nm-setting-vpn.c2
-rw-r--r--libnm-util/nm-setting-wimax.c2
-rw-r--r--libnm-util/nm-setting-wired.c2
-rw-r--r--libnm-util/nm-setting-wireless-security.c2
-rw-r--r--libnm-util/nm-setting-wireless.c2
-rw-r--r--libnm-util/nm-setting.c2
-rw-r--r--libnm-util/nm-utils.c4
-rw-r--r--libnm/nm-device-adsl.c2
-rw-r--r--libnm/nm-device-bond.c2
-rw-r--r--libnm/nm-device-bridge.c2
-rw-r--r--libnm/nm-device-bt.c2
-rw-r--r--libnm/nm-device-ethernet.c2
-rw-r--r--libnm/nm-device-generic.c2
-rw-r--r--libnm/nm-device-infiniband.c2
-rw-r--r--libnm/nm-device-modem.c2
-rw-r--r--libnm/nm-device-olpc-mesh.c2
-rw-r--r--libnm/nm-device-team.c2
-rw-r--r--libnm/nm-device-vlan.c2
-rw-r--r--libnm/nm-device-wifi.c2
-rw-r--r--libnm/nm-device-wimax.c2
-rw-r--r--libnm/nm-device.c2
-rw-r--r--libnm/nm-manager.c2
-rw-r--r--libnm/nm-object.c2
-rw-r--r--libnm/nm-remote-connection.c2
-rw-r--r--libnm/nm-remote-settings.c2
-rw-r--r--libnm/nm-vpn-plugin-old.c2
84 files changed, 90 insertions, 80 deletions
diff --git a/libnm-core/Makefile.am b/libnm-core/Makefile.am
index 785db1d7df..8fab84bcbf 100644
--- a/libnm-core/Makefile.am
+++ b/libnm-core/Makefile.am
@@ -5,6 +5,7 @@ SUBDIRS = . tests
AM_CPPFLAGS = \
-I${top_srcdir}/include \
-DG_LOG_DOMAIN=\""libnm"\" \
+ -DLOCALEDIR=\"$(datadir)/locale\" \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
diff --git a/libnm-core/crypto.c b/libnm-core/crypto.c
index a695747109..e54d101e48 100644
--- a/libnm-core/crypto.c
+++ b/libnm-core/crypto.c
@@ -28,7 +28,7 @@
#include <strings.h>
#include <unistd.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "crypto.h"
#include "nm-errors.h"
diff --git a/libnm-core/crypto_gnutls.c b/libnm-core/crypto_gnutls.c
index 97609f0a76..e123830d2c 100644
--- a/libnm-core/crypto_gnutls.c
+++ b/libnm-core/crypto_gnutls.c
@@ -24,7 +24,7 @@
#include "config.h"
#include <glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gcrypt.h>
#include <gnutls/gnutls.h>
diff --git a/libnm-core/crypto_nss.c b/libnm-core/crypto_nss.c
index b75fcf6662..e7cf2eb030 100644
--- a/libnm-core/crypto_nss.c
+++ b/libnm-core/crypto_nss.c
@@ -24,7 +24,7 @@
#include "config.h"
#include <glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <prinit.h>
#include <nss.h>
diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c
index b7d0c9e9fa..a432baa48b 100644
--- a/libnm-core/nm-connection.c
+++ b/libnm-core/nm-connection.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <glib-object.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <string.h>
#include "nm-connection.h"
#include "nm-connection-private.h"
diff --git a/libnm-core/nm-setting-8021x.c b/libnm-core/nm-setting-8021x.c
index 29fc2b84aa..2cad0234a2 100644
--- a/libnm-core/nm-setting-8021x.c
+++ b/libnm-core/nm-setting-8021x.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-8021x.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-adsl.c b/libnm-core/nm-setting-adsl.c
index bc56d481c3..00bcef5431 100644
--- a/libnm-core/nm-setting-adsl.c
+++ b/libnm-core/nm-setting-adsl.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-adsl.h"
#include "nm-setting-ppp.h"
diff --git a/libnm-core/nm-setting-bluetooth.c b/libnm-core/nm-setting-bluetooth.c
index 7c852d6bb2..41a0b4c2ff 100644
--- a/libnm-core/nm-setting-bluetooth.c
+++ b/libnm-core/nm-setting-bluetooth.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bluetooth.h"
#include "nm-setting-cdma.h"
diff --git a/libnm-core/nm-setting-bond.c b/libnm-core/nm-setting-bond.c
index d16b3cb88d..c5402c1a64 100644
--- a/libnm-core/nm-setting-bond.c
+++ b/libnm-core/nm-setting-bond.c
@@ -26,7 +26,7 @@
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bond.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-bridge-port.c b/libnm-core/nm-setting-bridge-port.c
index 5ffa8c0fbc..c594656b21 100644
--- a/libnm-core/nm-setting-bridge-port.c
+++ b/libnm-core/nm-setting-bridge-port.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bridge-port.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-bridge.c b/libnm-core/nm-setting-bridge.c
index d34f330d8f..6758b77930 100644
--- a/libnm-core/nm-setting-bridge.c
+++ b/libnm-core/nm-setting-bridge.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bridge.h"
#include "nm-connection-private.h"
diff --git a/libnm-core/nm-setting-cdma.c b/libnm-core/nm-setting-cdma.c
index 2d37f652bc..ebbbda740d 100644
--- a/libnm-core/nm-setting-cdma.c
+++ b/libnm-core/nm-setting-cdma.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-cdma.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-connection.c b/libnm-core/nm-setting-connection.c
index 8d7b9af959..323c129615 100644
--- a/libnm-core/nm-setting-connection.c
+++ b/libnm-core/nm-setting-connection.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-utils.h"
#include "nm-utils-private.h"
diff --git a/libnm-core/nm-setting-dcb.c b/libnm-core/nm-setting-dcb.c
index e7fcdff2b7..6b213db7b6 100644
--- a/libnm-core/nm-setting-dcb.c
+++ b/libnm-core/nm-setting-dcb.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-dcb.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-gsm.c b/libnm-core/nm-setting-gsm.c
index fbcdca1bc7..22f8cdbad6 100644
--- a/libnm-core/nm-setting-gsm.c
+++ b/libnm-core/nm-setting-gsm.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-gsm.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-infiniband.c b/libnm-core/nm-setting-infiniband.c
index c098164b0f..ec193fdbf8 100644
--- a/libnm-core/nm-setting-infiniband.c
+++ b/libnm-core/nm-setting-infiniband.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-infiniband.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c
index 64f3cdfbaf..25f7c82f01 100644
--- a/libnm-core/nm-setting-ip-config.c
+++ b/libnm-core/nm-setting-ip-config.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <arpa/inet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ip-config.h"
#include "nm-setting-ip4-config.h"
diff --git a/libnm-core/nm-setting-ip4-config.c b/libnm-core/nm-setting-ip4-config.c
index d2f6c69277..4f451f5eb4 100644
--- a/libnm-core/nm-setting-ip4-config.c
+++ b/libnm-core/nm-setting-ip4-config.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ip4-config.h"
#include "nm-setting-private.h"
diff --git a/libnm-core/nm-setting-ip6-config.c b/libnm-core/nm-setting-ip6-config.c
index 94605fcc30..50dbc3c723 100644
--- a/libnm-core/nm-setting-ip6-config.c
+++ b/libnm-core/nm-setting-ip6-config.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ip6-config.h"
#include "nm-setting-private.h"
diff --git a/libnm-core/nm-setting-olpc-mesh.c b/libnm-core/nm-setting-olpc-mesh.c
index 43383abf59..7be5dcadfd 100644
--- a/libnm-core/nm-setting-olpc-mesh.c
+++ b/libnm-core/nm-setting-olpc-mesh.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-olpc-mesh.h"
#include "nm-dbus-interface.h"
diff --git a/libnm-core/nm-setting-ppp.c b/libnm-core/nm-setting-ppp.c
index d67d6329bd..01f798ea7b 100644
--- a/libnm-core/nm-setting-ppp.c
+++ b/libnm-core/nm-setting-ppp.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ppp.h"
#include "nm-setting-private.h"
diff --git a/libnm-core/nm-setting-pppoe.c b/libnm-core/nm-setting-pppoe.c
index 93e26ff91b..ac6764d069 100644
--- a/libnm-core/nm-setting-pppoe.c
+++ b/libnm-core/nm-setting-pppoe.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-pppoe.h"
#include "nm-setting-ppp.h"
diff --git a/libnm-core/nm-setting-team-port.c b/libnm-core/nm-setting-team-port.c
index 834f7b3cca..db765b948c 100644
--- a/libnm-core/nm-setting-team-port.c
+++ b/libnm-core/nm-setting-team-port.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-team-port.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-team.c b/libnm-core/nm-setting-team.c
index 231d80d673..dec6a8f6fb 100644
--- a/libnm-core/nm-setting-team.c
+++ b/libnm-core/nm-setting-team.c
@@ -22,7 +22,7 @@
#include <string.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-team.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-vlan.c b/libnm-core/nm-setting-vlan.c
index b9f2274d6d..c1b9940ff1 100644
--- a/libnm-core/nm-setting-vlan.c
+++ b/libnm-core/nm-setting-vlan.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-vlan.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-vpn.c b/libnm-core/nm-setting-vpn.c
index 1f2ffc9126..b317a72a48 100644
--- a/libnm-core/nm-setting-vpn.c
+++ b/libnm-core/nm-setting-vpn.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <errno.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-vpn.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-wimax.c b/libnm-core/nm-setting-wimax.c
index 2a2f29ee26..541c0bbfe7 100644
--- a/libnm-core/nm-setting-wimax.c
+++ b/libnm-core/nm-setting-wimax.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wimax.h"
#include "nm-setting-private.h"
diff --git a/libnm-core/nm-setting-wired.c b/libnm-core/nm-setting-wired.c
index 1047d23ee6..1a75ef5c05 100644
--- a/libnm-core/nm-setting-wired.c
+++ b/libnm-core/nm-setting-wired.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wired.h"
#include "nm-utils.h"
diff --git a/libnm-core/nm-setting-wireless-security.c b/libnm-core/nm-setting-wireless-security.c
index 05eb0c4705..9a7b5a591d 100644
--- a/libnm-core/nm-setting-wireless-security.c
+++ b/libnm-core/nm-setting-wireless-security.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wireless-security.h"
#include "nm-setting-8021x.h"
diff --git a/libnm-core/nm-setting-wireless.c b/libnm-core/nm-setting-wireless.c
index 564023b9b1..b481e54046 100644
--- a/libnm-core/nm-setting-wireless.c
+++ b/libnm-core/nm-setting-wireless.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wireless.h"
#include "nm-dbus-interface.h"
diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c
index cbbc4408f5..278c21b1b2 100644
--- a/libnm-core/nm-setting.c
+++ b/libnm-core/nm-setting.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include "nm-setting.h"
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index 37f9ca0cf4..dce475569e 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -26,6 +26,7 @@
#include <netinet/ether.h>
#include <arpa/inet.h>
#include <uuid/uuid.h>
+#include <libintl.h>
#include <gmodule.h>
#include "nm-utils.h"
@@ -242,6 +243,9 @@ nm_utils_init (GError **error)
if (!initialized) {
initialized = TRUE;
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
if (!crypto_init (error))
return FALSE;
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
index 88d9ce8a9e..53d2a69f74 100644
--- a/libnm-glib/nm-device.c
+++ b/libnm-glib/nm-device.c
@@ -23,7 +23,7 @@
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gudev/gudev.h>
#include "NetworkManager.h"
diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c
index 4feba8b10e..3a70e81ed4 100644
--- a/libnm-glib/nm-remote-connection.c
+++ b/libnm-glib/nm-remote-connection.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <gio/gio.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <NetworkManager.h>
#include <nm-utils.h>
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index 88915bf0c7..f0a885afcd 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
-I${top_srcdir} \
-I${top_srcdir}/include \
-DG_LOG_DOMAIN=\""libnm-util"\" \
+ -DLOCALEDIR=\"$(datadir)/locale\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
diff --git a/libnm-util/crypto.c b/libnm-util/crypto.c
index d5f7608d6e..8a10af9453 100644
--- a/libnm-util/crypto.c
+++ b/libnm-util/crypto.c
@@ -28,7 +28,7 @@
#include <strings.h>
#include <unistd.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "crypto.h"
diff --git a/libnm-util/crypto_gnutls.c b/libnm-util/crypto_gnutls.c
index 9c20f589e8..03cb1b4761 100644
--- a/libnm-util/crypto_gnutls.c
+++ b/libnm-util/crypto_gnutls.c
@@ -24,7 +24,7 @@
#include "config.h"
#include <glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gcrypt.h>
#include <gnutls/gnutls.h>
diff --git a/libnm-util/crypto_nss.c b/libnm-util/crypto_nss.c
index 1e589ea709..52ee261d4a 100644
--- a/libnm-util/crypto_nss.c
+++ b/libnm-util/crypto_nss.c
@@ -24,7 +24,7 @@
#include "config.h"
#include <glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <prinit.h>
#include <nss.h>
diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c
index 1268d20ca3..a1350f5445 100644
--- a/libnm-util/nm-connection.c
+++ b/libnm-util/nm-connection.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <glib-object.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <dbus/dbus-glib.h>
#include <string.h>
#include "nm-connection.h"
diff --git a/libnm-util/nm-setting-8021x.c b/libnm-util/nm-setting-8021x.c
index 94a26e18fd..c11ce0fe57 100644
--- a/libnm-util/nm-setting-8021x.c
+++ b/libnm-util/nm-setting-8021x.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-8021x.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-adsl.c b/libnm-util/nm-setting-adsl.c
index 5b0ae2baf9..601ebc2b2a 100644
--- a/libnm-util/nm-setting-adsl.c
+++ b/libnm-util/nm-setting-adsl.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-adsl.h"
#include "nm-setting-ppp.h"
diff --git a/libnm-util/nm-setting-bluetooth.c b/libnm-util/nm-setting-bluetooth.c
index 487f366e18..4a9c8eb643 100644
--- a/libnm-util/nm-setting-bluetooth.c
+++ b/libnm-util/nm-setting-bluetooth.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <net/ethernet.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-param-spec-specialized.h"
#include "nm-dbus-glib-types.h"
diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c
index 515f3d5980..6d6210886d 100644
--- a/libnm-util/nm-setting-bond.c
+++ b/libnm-util/nm-setting-bond.c
@@ -27,7 +27,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bond.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-bridge-port.c b/libnm-util/nm-setting-bridge-port.c
index 366efe016d..ae38a8e8ba 100644
--- a/libnm-util/nm-setting-bridge-port.c
+++ b/libnm-util/nm-setting-bridge-port.c
@@ -25,7 +25,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-bridge-port.h"
#include "nm-utils.h"
diff --git a/libnm-util/nm-setting-bridge.c b/libnm-util/nm-setting-bridge.c
index fda46842be..86d1e781e0 100644
--- a/libnm-util/nm-setting-bridge.c
+++ b/libnm-util/nm-setting-bridge.c
@@ -25,7 +25,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <linux/if_ether.h>
#include "nm-setting-bridge.h"
diff --git a/libnm-util/nm-setting-cdma.c b/libnm-util/nm-setting-cdma.c
index f60869a589..44a893c7bb 100644
--- a/libnm-util/nm-setting-cdma.c
+++ b/libnm-util/nm-setting-cdma.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-cdma.h"
#include "nm-utils.h"
diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c
index c767170aae..80e225b91b 100644
--- a/libnm-util/nm-setting-connection.c
+++ b/libnm-util/nm-setting-connection.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-utils.h"
#include "nm-dbus-glib-types.h"
diff --git a/libnm-util/nm-setting-dcb.c b/libnm-util/nm-setting-dcb.c
index 6192d76399..45661b4bf2 100644
--- a/libnm-util/nm-setting-dcb.c
+++ b/libnm-util/nm-setting-dcb.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-dcb.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c
index 5b91a4c0ff..a17d18b7e5 100644
--- a/libnm-util/nm-setting-gsm.c
+++ b/libnm-util/nm-setting-gsm.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-gsm.h"
#include "nm-utils.h"
diff --git a/libnm-util/nm-setting-infiniband.c b/libnm-util/nm-setting-infiniband.c
index 71942c60ea..cc7a8bfd91 100644
--- a/libnm-util/nm-setting-infiniband.c
+++ b/libnm-util/nm-setting-infiniband.c
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <dbus/dbus-glib.h>
#include <linux/if_infiniband.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-infiniband.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c
index c86e061fb9..c5115c5950 100644
--- a/libnm-util/nm-setting-ip4-config.c
+++ b/libnm-util/nm-setting-ip4-config.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ip4-config.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c
index e13587bb7b..7d0ed33e22 100644
--- a/libnm-util/nm-setting-ip6-config.c
+++ b/libnm-util/nm-setting-ip6-config.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ip6-config.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-olpc-mesh.c b/libnm-util/nm-setting-olpc-mesh.c
index e67ac9601c..e4b6dae5b6 100644
--- a/libnm-util/nm-setting-olpc-mesh.c
+++ b/libnm-util/nm-setting-olpc-mesh.c
@@ -25,7 +25,7 @@
#include <string.h>
#include <netinet/ether.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "NetworkManager.h"
#include "nm-setting-olpc-mesh.h"
diff --git a/libnm-util/nm-setting-ppp.c b/libnm-util/nm-setting-ppp.c
index 041253a96a..a01d3e106f 100644
--- a/libnm-util/nm-setting-ppp.c
+++ b/libnm-util/nm-setting-ppp.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-ppp.h"
#include "nm-setting-private.h"
diff --git a/libnm-util/nm-setting-pppoe.c b/libnm-util/nm-setting-pppoe.c
index 08a0ea2975..deaeb2e883 100644
--- a/libnm-util/nm-setting-pppoe.c
+++ b/libnm-util/nm-setting-pppoe.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-pppoe.h"
#include "nm-setting-ppp.h"
diff --git a/libnm-util/nm-setting-team-port.c b/libnm-util/nm-setting-team-port.c
index c2914ce2bb..878b29720f 100644
--- a/libnm-util/nm-setting-team-port.c
+++ b/libnm-util/nm-setting-team-port.c
@@ -24,7 +24,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-team-port.h"
#include "nm-utils.h"
diff --git a/libnm-util/nm-setting-team.c b/libnm-util/nm-setting-team.c
index 27a9e8a668..9efb39321b 100644
--- a/libnm-util/nm-setting-team.c
+++ b/libnm-util/nm-setting-team.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-team.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-vlan.c b/libnm-util/nm-setting-vlan.c
index a42c60e096..f5e14558fd 100644
--- a/libnm-util/nm-setting-vlan.c
+++ b/libnm-util/nm-setting-vlan.c
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-vlan.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c
index ea44d9988b..472ebbc3f3 100644
--- a/libnm-util/nm-setting-vpn.c
+++ b/libnm-util/nm-setting-vpn.c
@@ -25,7 +25,7 @@
#include <errno.h>
#include <stdlib.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-vpn.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-wimax.c b/libnm-util/nm-setting-wimax.c
index 12e60a46d2..acb00f5e9d 100644
--- a/libnm-util/nm-setting-wimax.c
+++ b/libnm-util/nm-setting-wimax.c
@@ -25,7 +25,7 @@
#include <string.h>
#include <net/ethernet.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wimax.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c
index a852b25ac8..5a90d7ddec 100644
--- a/libnm-util/nm-setting-wired.c
+++ b/libnm-util/nm-setting-wired.c
@@ -26,7 +26,7 @@
#include <net/ethernet.h>
#include <netinet/ether.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wired.h"
#include "nm-param-spec-specialized.h"
diff --git a/libnm-util/nm-setting-wireless-security.c b/libnm-util/nm-setting-wireless-security.c
index 555b8955ca..052a9327ba 100644
--- a/libnm-util/nm-setting-wireless-security.c
+++ b/libnm-util/nm-setting-wireless-security.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting-wireless-security.h"
#include "nm-setting-8021x.h"
diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c
index 87a9b55b8c..d6693cb9f5 100644
--- a/libnm-util/nm-setting-wireless.c
+++ b/libnm-util/nm-setting-wireless.c
@@ -26,7 +26,7 @@
#include <net/ethernet.h>
#include <netinet/ether.h>
#include <dbus/dbus-glib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "NetworkManager.h"
#include "nm-setting-wireless.h"
diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c
index f5026a4c0a..4df2bced1d 100644
--- a/libnm-util/nm-setting.c
+++ b/libnm-util/nm-setting.c
@@ -23,7 +23,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-setting.h"
#include "nm-setting-private.h"
diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c
index a5113538dd..371bb49ca8 100644
--- a/libnm-util/nm-utils.c
+++ b/libnm-util/nm-utils.c
@@ -26,6 +26,7 @@
#include <netinet/ether.h>
#include <linux/if_infiniband.h>
#include <uuid/uuid.h>
+#include <libintl.h>
#include <gmodule.h>
#include "nm-utils.h"
@@ -234,6 +235,9 @@ nm_utils_init (GError **error)
if (!initialized) {
initialized = TRUE;
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
if (!crypto_init (error))
return FALSE;
diff --git a/libnm/nm-device-adsl.c b/libnm/nm-device-adsl.c
index b509335837..99771548f8 100644
--- a/libnm/nm-device-adsl.c
+++ b/libnm/nm-device-adsl.c
@@ -29,7 +29,7 @@
#include "nm-setting-connection.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE)
diff --git a/libnm/nm-device-bond.c b/libnm/nm-device-bond.c
index af6d3d18f7..6bb673233d 100644
--- a/libnm/nm-device-bond.c
+++ b/libnm/nm-device-bond.c
@@ -21,7 +21,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-bridge.c b/libnm/nm-device-bridge.c
index 6d5367402e..ce28f2c2f4 100644
--- a/libnm/nm-device-bridge.c
+++ b/libnm/nm-device-bridge.c
@@ -21,7 +21,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c
index 0f949372e8..7752646457 100644
--- a/libnm/nm-device-bt.c
+++ b/libnm/nm-device-bt.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c
index a8db0ffc06..be2cb4dc40 100644
--- a/libnm/nm-device-ethernet.c
+++ b/libnm/nm-device-ethernet.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-generic.c b/libnm/nm-device-generic.c
index 93c9dccc9b..3ed0fa7e63 100644
--- a/libnm/nm-device-generic.c
+++ b/libnm/nm-device-generic.c
@@ -21,7 +21,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-device-generic.h"
#include "nm-device-private.h"
diff --git a/libnm/nm-device-infiniband.c b/libnm/nm-device-infiniband.c
index 2d755ba44f..bce8a87aa2 100644
--- a/libnm/nm-device-infiniband.c
+++ b/libnm/nm-device-infiniband.c
@@ -21,7 +21,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-modem.c b/libnm/nm-device-modem.c
index a2911f0841..dcbb447a2f 100644
--- a/libnm/nm-device-modem.c
+++ b/libnm/nm-device-modem.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-olpc-mesh.c b/libnm/nm-device-olpc-mesh.c
index b881687ffc..108e533982 100644
--- a/libnm/nm-device-olpc-mesh.c
+++ b/libnm/nm-device-olpc-mesh.c
@@ -21,7 +21,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-team.c b/libnm/nm-device-team.c
index e892d827cc..cff1d71849 100644
--- a/libnm/nm-device-team.c
+++ b/libnm/nm-device-team.c
@@ -21,7 +21,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-vlan.c b/libnm/nm-device-vlan.c
index 57acb7a8ef..b34b3e14d2 100644
--- a/libnm/nm-device-vlan.c
+++ b/libnm/nm-device-vlan.c
@@ -21,7 +21,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c
index 493bd79b56..4a19f2e5a5 100644
--- a/libnm/nm-device-wifi.c
+++ b/libnm/nm-device-wifi.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device-wimax.c b/libnm/nm-device-wimax.c
index e400057ab4..f199b669fa 100644
--- a/libnm/nm-device-wimax.c
+++ b/libnm/nm-device-wimax.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
diff --git a/libnm/nm-device.c b/libnm/nm-device.c
index 66e9cc078d..e80ac707d8 100644
--- a/libnm/nm-device.c
+++ b/libnm/nm-device.c
@@ -23,7 +23,7 @@
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gudev/gudev.h>
#include "nm-dbus-interface.h"
diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c
index e0301fd34c..11c4db9f3b 100644
--- a/libnm/nm-manager.c
+++ b/libnm/nm-manager.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <nm-utils.h>
#include "nm-manager.h"
diff --git a/libnm/nm-object.c b/libnm/nm-object.c
index 21a6ad7f8b..f02c09c2e2 100644
--- a/libnm/nm-object.c
+++ b/libnm/nm-object.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <gio/gio.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <stdio.h>
#include <nm-utils.h>
diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c
index 0c5370588f..3afe7f8eb9 100644
--- a/libnm/nm-remote-connection.c
+++ b/libnm/nm-remote-connection.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <gio/gio.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <nm-dbus-interface.h>
#include <nm-utils.h>
diff --git a/libnm/nm-remote-settings.c b/libnm/nm-remote-settings.c
index 633d25dba9..d37e366617 100644
--- a/libnm/nm-remote-settings.c
+++ b/libnm/nm-remote-settings.c
@@ -22,7 +22,7 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <nm-dbus-interface.h>
#include <nm-connection.h>
diff --git a/libnm/nm-vpn-plugin-old.c b/libnm/nm-vpn-plugin-old.c
index c4d7de4326..e6843f7e18 100644
--- a/libnm/nm-vpn-plugin-old.c
+++ b/libnm/nm-vpn-plugin-old.c
@@ -29,7 +29,7 @@
#include <signal.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include "nm-glib-compat.h"