summaryrefslogtreecommitdiff
path: root/inputmethod/ibus/patches/patch-setup_i18n.py
diff options
context:
space:
mode:
Diffstat (limited to 'inputmethod/ibus/patches/patch-setup_i18n.py')
-rw-r--r--inputmethod/ibus/patches/patch-setup_i18n.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/inputmethod/ibus/patches/patch-setup_i18n.py b/inputmethod/ibus/patches/patch-setup_i18n.py
new file mode 100644
index 00000000000..910980eaba4
--- /dev/null
+++ b/inputmethod/ibus/patches/patch-setup_i18n.py
@@ -0,0 +1,28 @@
+$NetBSD: patch-setup_i18n.py,v 1.1 2012/05/02 09:11:44 obache Exp $
+
+* fix translations fail
+ http://code.google.com/p/ibus/issues/detail?id=1453
+
+--- setup/i18n.py.orig 2012-02-02 04:54:54.000000000 +0000
++++ setup/i18n.py
+@@ -20,6 +20,7 @@
+ # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ # Boston, MA 02111-1307 USA
+
++import locale
+ import gettext
+ import os
+
+@@ -30,5 +31,12 @@ N_ = lambda a: a
+
+ def init():
+ localedir = os.getenv("IBUS_LOCALEDIR")
++ # Python's locale module doesn't provide all methods on some
++ # operating systems like FreeBSD
++ try:
++ # for non-standard localedir
++ locale.bindtextdomain(DOMAINNAME, localedir)
++ except AttributeError:
++ pass
+ gettext.bindtextdomain(DOMAINNAME, localedir)
+ gettext.bind_textdomain_codeset(DOMAINNAME, "UTF-8")