← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~ted/indicator-messages/i18n into lp:indicator-messages

 

Ted Gould has proposed merging lp:~ted/indicator-messages/i18n into lp:indicator-messages.

Requested reviews:
    Indicator Applet Developers (indicator-applet-developers)

Adding in i18n support.
-- 
https://code.launchpad.net/~ted/indicator-messages/i18n/+merge/11828
Your team ayatana-commits is subscribed to branch lp:indicator-messages.
=== modified file 'Makefile.am'
--- Makefile.am	2009-09-09 14:18:53 +0000
+++ Makefile.am	2009-09-15 21:06:55 +0000
@@ -1,7 +1,8 @@
 
 SUBDIRS = \
 	src \
-	data
+	data \
+	po
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall
 

=== modified file 'configure.ac'
--- configure.ac	2009-09-10 14:03:02 +0000
+++ configure.ac	2009-09-15 21:32:42 +0000
@@ -8,6 +8,8 @@
 
 AM_MAINTAINER_MODE
 
+IT_PROG_INTLTOOL([0.35.0])
+
 AC_ISC_POSIX
 AC_PROG_CC
 AM_PROG_CC_C_O
@@ -67,6 +69,33 @@
 fi
 AC_SUBST(DBUSSERVICEDIR)
 
+##############################
+# Custom Junk
+##############################
+
+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))
+])
+
+###########################
+# Internationalization
+###########################
+
+GETTEXT_PACKAGE=indicator-messages
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default get text domain])
+AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory])
+
+AM_GLIB_GNU_GETTEXT
+
 ###########################
 # Files
 ###########################
@@ -88,6 +117,7 @@
 data/icons/48x48/status/Makefile
 data/icons/scalable/Makefile
 data/icons/scalable/status/Makefile
+po/Makefile.in
 ])
 
 ###########################

=== added directory 'po'
=== added file 'po/POTFILES.in'
--- po/POTFILES.in	1970-01-01 00:00:00 +0000
+++ po/POTFILES.in	2009-09-15 21:13:51 +0000
@@ -0,0 +1,7 @@
+[encoding: UTF-8]
+src/messages-service-dbus.c
+src/indicator-messages.c
+src/messages-service.c
+src/launcher-menu-item.c
+src/im-menu-item.c
+src/app-menu-item.c

=== modified file 'src/messages-service.c'
--- src/messages-service.c	2009-09-09 19:51:19 +0000
+++ src/messages-service.c	2009-09-15 21:17:44 +0000
@@ -21,6 +21,9 @@
 */
 
 #include <string.h>
+#include <locale.h>
+#include <libintl.h>
+#include <config.h>
 #include <pango/pango-utils.h>
 #include <dbus/dbus-glib-bindings.h>
 #include <libindicate/listener.h>
@@ -1219,6 +1222,12 @@
 		return 1;
 	}
 
+	/* Setting up i18n and gettext.  Apparently, we need
+	   all of these. */
+	setlocale (LC_ALL, "");
+	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+	textdomain (GETTEXT_PACKAGE);
+
 	dbus_interface = message_service_dbus_new();
 
 	listener = indicate_listener_ref_default();


Follow ups