Use bindtextdomain to specify localedir
authorChoe Hwanjin <choe.hwanjin@gmail.com>
Sat, 21 Mar 2009 11:10:29 +0000 (20:10 +0900)
committerChoe Hwanjin <choe.hwanjin@gmail.com>
Sat, 21 Mar 2009 11:10:29 +0000 (20:10 +0900)
Set textdomain dir to localedir which is spcified on configure stage.
config.py file has the prefix configuration.

configure.ac
setup/config.py.in [new file with mode: 0644]
setup/main.py

index 8bc5e2b..0009cf6 100644 (file)
@@ -81,6 +81,7 @@ src/Makefile
 src/hangul.xml.in
 setup/Makefile
 setup/ibus-setup-hangul
+setup/config.py
 icons/Makefile
 m4/Makefile
 ])
diff --git a/setup/config.py.in b/setup/config.py.in
new file mode 100644 (file)
index 0000000..afa73b6
--- /dev/null
@@ -0,0 +1,22 @@
+# vim:set et sts=4 sw=4:
+#
+# ibus-hangul - The Hangul Engine For IBus
+#
+# Copyright (c) 2009 Choe Hwanjin <choe.hwanjin@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+prefix = "@prefix@"
+localedir = "@prefix@/share/locale"
index 7bc3415..2238ea1 100644 (file)
@@ -24,9 +24,10 @@ import gobject
 import gtk
 import gtk.glade as glade
 import ibus
+import gettext
+import config
 
-from gettext import dgettext
-_ = lambda a : dgettext("ibus-hangul", a)
+_ = lambda a : gettext.dgettext("ibus-hangul", a)
 
 class Setup ():
     def __init__ (self):
@@ -34,9 +35,9 @@ class Setup ():
         self.__config = self.__bus.get_config()
        self.__config.connect("value-changed", self.on_value_changed, None)
 
-       glade.textdomain("ibus-hangul")
+       glade.bindtextdomain("ibus-hangul", config.localedir)
        glade_file = os.path.join(os.path.dirname(__file__), "setup.glade")
-       self.__xml = glade.XML(glade_file)
+       self.__xml = glade.XML(glade_file, domain="ibus-hangul")
 
        self.__hangul_keyboard = self.__xml.get_widget("HangulKeyboard")
        model = gtk.ListStore(str, str, int)
@@ -95,4 +96,5 @@ class Setup ():
         return self.__config.set_value("engine/Hangul", name, v)
 
 if __name__ == "__main__":
+    gettext.bindtextdomain("ibus-hangul", config.localedir)
     Setup().run()