aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Kelemen <kelemeng@ubuntu.com>2014-02-13 13:27:40 +0000
committerTarmac <Unknown>2014-02-13 13:27:40 +0000
commitbeef368b66e12255b5cd38d55432e991b6f640f4 (patch)
tree2ea4448311dc267a3b9537511851d07bd11726d1
parent6938c6e6c6a640d22a3e841a474796166351a428 (diff)
parent2e3c872852cd04c8ecde424478126176ed9d80c6 (diff)
downloadayatana-indicator-printers-beef368b66e12255b5cd38d55432e991b6f640f4.tar.gz
ayatana-indicator-printers-beef368b66e12255b5cd38d55432e991b6f640f4.tar.bz2
ayatana-indicator-printers-beef368b66e12255b5cd38d55432e991b6f640f4.zip
Add proper i18n support. Fixes LP:1279605. Fixes: https://bugs.launchpad.net/bugs/1279605.
Approved by PS Jenkins bot, Lars Uebernickel.
-rw-r--r--configure.ac13
-rw-r--r--src/indicator-printers-service.c7
2 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b5f425e..78211c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,10 +11,23 @@ AM_PROG_CC_C_O
AM_SILENT_RULES([yes])
AC_CONFIG_MACRO_DIR([m4])
+AC_DEFUN([AC_DEFINE_PATH], [
+ test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+ ac_define_path=`eval echo [$]$2`
+ ac_define_path=`eval echo [$]ac_define_path`
+ $1="$ac_define_path"
+ AC_SUBST($1)
+ ifelse($3, ,
+ AC_DEFINE_UNQUOTED($1, "$ac_define_path"),
+ AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3))
+])
+
IT_PROG_INTLTOOL([0.35.0])
GETTEXT_PACKAGE=indicator-printers
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext package])
+AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory])
AM_GLIB_GNU_GETTEXT
AC_CONFIG_HEADER(config.h)
diff --git a/src/indicator-printers-service.c b/src/indicator-printers-service.c
index fb85069..737fed4 100644
--- a/src/indicator-printers-service.c
+++ b/src/indicator-printers-service.c
@@ -21,6 +21,7 @@
#include <gtk/gtk.h>
#include <cups/cups.h>
#include "dbus-names.h"
+#include "config.h"
#include "cups-notifier.h"
#include "indicator-printers-menu.h"
@@ -146,6 +147,12 @@ service_shutdown (IndicatorService *service, gpointer user_data)
int main (int argc, char *argv[])
{
+ /* Init i18n */
+ setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
IndicatorService *service;
DbusmenuServer *menuserver;
CupsNotifier *cups_notifier;