commit 65b8a05197bebda4470586f28c593b3e04f475f8 Author: Richard Hughes Date: Sun Nov 23 17:19:15 2008 +0000 bugfix: enable translations in the client tools. Fixes fd#18674 diff --git a/client/Makefile.am b/client/Makefile.am index 84fec80..45ae396 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -12,6 +12,7 @@ INCLUDES = \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DLIBDIR=\""$(libdir)"\" \ -DVERSION="\"$(VERSION)\"" \ + -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ -DPK_DATA=\"$(pkgdatadir)\" \ -DPK_DB_DIR=\""$(PK_DB_DIR)"\" \ -DEGG_LOG_FILE=\""$(PK_LOG_DIR)/PackageKit"\" \ diff --git a/client/pk-console.c b/client/pk-console.c index c11f8fc..1a007a9 100644 --- a/client/pk-console.c +++ b/client/pk-console.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "egg-debug.h" #include "egg-string.h" @@ -1664,6 +1665,11 @@ main (int argc, char *argv[]) { NULL} }; + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + if (! g_thread_supported ()) g_thread_init (NULL); dbus_g_thread_init (); diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c index 55f84b4..55dbc5b 100644 --- a/client/pk-generate-pack.c +++ b/client/pk-generate-pack.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -192,6 +193,11 @@ main (int argc, char *argv[]) { NULL} }; + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + if (! g_thread_supported ()) g_thread_init (NULL); diff --git a/client/pk-monitor.c b/client/pk-monitor.c index 58572d8..16a31c6 100644 --- a/client/pk-monitor.c +++ b/client/pk-monitor.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -117,6 +118,11 @@ main (int argc, char *argv[]) { NULL} }; + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + if (! g_thread_supported ()) g_thread_init (NULL); dbus_g_thread_init (); diff --git a/src/Makefile.am b/src/Makefile.am index cf53125..0124055 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,6 +15,7 @@ INCLUDES = \ $(POLKIT_CFLAGS) \ $(PYTHON_CFLAGS) \ $(LIBNM_CFLAGS) \ + -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ -DBINDIR=\"$(bindir)\" \ -DSBINDIR=\"$(sbindir)\" \ -DDATADIR=\"$(datadir)\" \ diff --git a/src/pk-main.c b/src/pk-main.c index 85ae3d7..40184b0 100644 --- a/src/pk-main.c +++ b/src/pk-main.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -199,6 +200,11 @@ main (int argc, char *argv[]) { NULL} }; + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + if (! g_thread_supported ()) g_thread_init (NULL); dbus_g_thread_init ();