Use gettext replace locale
authorPeng Huang <shawn.p.huang@gmail.com>
Fri, 11 Dec 2009 07:46:56 +0000 (15:46 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Fri, 11 Dec 2009 07:46:56 +0000 (15:46 +0800)
ui/gtk/Makefile.am
ui/gtk/ibus-ui-gtk.in
ui/gtk/main.py

index d51b89e..4aba5f1 100644 (file)
@@ -64,5 +64,7 @@ gtkpanel.xml: gtkpanel.xml.in
 test:
        $(ENV) DBUS_DEBUG=true \
                IBUS_PREFIX=@prefix@ \
+               IBUS_DATAROOTDIR=@datarootdir@ \
+               IBUS_LOCALEDIR=@localedir@ \
                PYTHONPATH=$(top_srcdir) \
                $(PYTHON) $(srcdir)/main.py
index 8781e4a..2c4460d 100644 (file)
 # License along with this program; if not, write to the
 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 # Boston, MA  02111-1307  USA
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datarootdir=@datarootdir@
 export IBUS_PREFIX=@prefix@
+export IBUS_DATAROOTDIR=@datarootdir@
+export IBUS_LOCALEDIR=@localedir@
+
 exec python @prefix@/share/ibus/ui/gtk/main.py $@
 
index 50eba52..60c5209 100644 (file)
@@ -25,7 +25,7 @@ import sys
 import getopt
 import ibus
 import gtk
-import locale
+import gettext
 import panel
 import notifications
 
@@ -77,5 +77,7 @@ def main():
     launch_panel()
 
 if __name__ == "__main__":
-    locale.bind_textdomain_codeset("ibus", "UTF-8")
+    localedir = os.getenv("IBUS_LOCALEDIR")
+    gettext.bindtextdomain("ibus", localedir)
+    gettext.bind_textdomain_codeset("ibus", "UTF-8")
     main()