From ceaeb86d9b7c5d8674151c863551564a15c0924f Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Fri, 23 Mar 2012 11:40:29 +0900 Subject: [PATCH] Enable bindtextdomain in ibus-ui-gtk3. TEST=Linux desktop Review URL: https://codereview.appspot.com/5876049 --- configure.ac | 3 +++ ui/gtk3/Makefile.am | 1 + ui/gtk3/application.vala | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index 1c4b2831..4c8b7f90 100644 --- a/configure.ac +++ b/configure.ac @@ -105,6 +105,9 @@ GETTEXT_PACKAGE=ibus10 AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The prefix for out gettext translation domains.]) +GLIB_DEFINE_LOCALEDIR(GLIB_LOCALE_DIR) +GLIB_LOCALE_DIR=$localedir +AC_SUBST(GLIB_LOCALE_DIR) # For dislpay date. m4_define(ibus_datedisplay, diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am index 0fb9d3c6..87a7373d 100644 --- a/ui/gtk3/Makefile.am +++ b/ui/gtk3/Makefile.am @@ -50,6 +50,7 @@ AM_CFLAGS = \ @X11_CFLAGS@ \ $(INCLUDES) \ -DGETTEXT_PACKAGE=\"@GETTEXT_PACKAGE@\" \ + -DGLIB_LOCALE_DIR=\"@GLIB_LOCALE_DIR@\" \ -DG_LOG_DOMAIN=\"IBUS\" \ -DPKGDATADIR=\"$(pkgdatadir)\" \ -DLIBEXECDIR=\"$(libexecdir)\" \ diff --git a/ui/gtk3/application.vala b/ui/gtk3/application.vala index 280da57a..d49deb4d 100644 --- a/ui/gtk3/application.vala +++ b/ui/gtk3/application.vala @@ -24,12 +24,17 @@ using IBus; using GLib; using Gtk; +public extern const string GETTEXT_PACKAGE; +public extern const string GLIB_LOCALE_DIR; + class Application { private IBus.Bus m_bus; private Panel m_panel; private IBus.Config m_config; public Application(string[] argv) { + GLib.Intl.bindtextdomain(GETTEXT_PACKAGE, GLIB_LOCALE_DIR); + GLib.Intl.bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); IBus.init(); Gtk.init(ref argv); -- 2.34.1