diff options
author | Ted Gould <ted@canonical.com> | 2009-09-16 09:07:14 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-16 09:07:14 -0500 |
commit | ddff85ec43142d492143f6a914217de1df092b8b (patch) | |
tree | 719c6662e22df88314b84d99133185d2220c4064 | |
parent | a30c0ed9436d96f59dab24c58e63a45a40e91628 (diff) | |
parent | 62a047790465aaee453f1cb1cbd9042762f0486b (diff) | |
download | ayatana-indicator-messages-ddff85ec43142d492143f6a914217de1df092b8b.tar.gz ayatana-indicator-messages-ddff85ec43142d492143f6a914217de1df092b8b.tar.bz2 ayatana-indicator-messages-ddff85ec43142d492143f6a914217de1df092b8b.zip |
Merging in i18n branch to add i18n.
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | configure.ac | 30 | ||||
-rw-r--r-- | po/POTFILES.in | 7 | ||||
-rw-r--r-- | src/messages-service.c | 9 |
4 files changed, 48 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 7d58c6b..26c2a33 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = \ src \ - data + data \ + po DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall diff --git a/configure.ac b/configure.ac index 174aec6..ee44f91 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,8 @@ AM_INIT_AUTOMAKE(indicator-messages, 0.2.2) AM_MAINTAINER_MODE +IT_PROG_INTLTOOL([0.35.0]) + AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_C_O @@ -67,6 +69,33 @@ else 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/Makefile data/icons/48x48/status/Makefile data/icons/scalable/Makefile data/icons/scalable/status/Makefile +po/Makefile.in ]) ########################### diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..0d88e74 --- /dev/null +++ b/po/POTFILES.in @@ -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 diff --git a/src/messages-service.c b/src/messages-service.c index 575de8e..e37a721 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -21,6 +21,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>. */ #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 @@ main (int argc, char ** argv) 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(); |