summaryrefslogtreecommitdiff
path: root/portato/gui/windows/basic.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-09-03 19:17:33 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-09-03 19:17:33 +0200
commit506c6919fa6dd01b738e022e625105d12cd05c48 (patch)
tree8494dffbb6d383c19636e2b4cf681ca57a94c4fd /portato/gui/windows/basic.py
parent5e200de2c506c40d1f2c3152471b1b11d58c4f6f (diff)
downloadportato-506c6919fa6dd01b738e022e625105d12cd05c48.tar.gz
portato-506c6919fa6dd01b738e022e625105d12cd05c48.tar.bz2
portato-506c6919fa6dd01b738e022e625105d12cd05c48.zip
Screw debugging ... prefer the ctypes approach to get rid of yet another c-module.
Diffstat (limited to 'portato/gui/windows/basic.py')
-rw-r--r--portato/gui/windows/basic.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/portato/gui/windows/basic.py b/portato/gui/windows/basic.py
index 46e345e..3cedd69 100644
--- a/portato/gui/windows/basic.py
+++ b/portato/gui/windows/basic.py
@@ -20,13 +20,18 @@ from functools import wraps
import os.path
from ...constants import TEMPLATE_DIR, APP, LOCALE_DIR
-from ...helper import error, debug
+from ...helper import error
# for the GtkBuilder to translate correctly :)
-from . import gettext
-old_charset = gettext.set_gtk_gettext(APP, LOCALE_DIR)
-debug("Changed from old charset '%s' to UTF-8.", old_charset)
-del old_charset
+import ctypes
+try:
+ getlib = ctypes.cdll.LoadLibrary("libgettextlib.so")
+except OSError:
+ error("'libgettextlib.so' cannot be loaded. Might be, that there are no translations available in the GUI.")
+else:
+ getlib.textdomain(APP)
+ getlib.bindtextdomain(APP, LOCALE_DIR)
+ getlib.bind_textdomain_codeset(APP, "UTF-8")
class WrappedTree (object):
__slots__ = ("klass", "tree", "get_widget", "get_ui")