summaryrefslogtreecommitdiff
path: root/caribou/i18n.py.in
diff options
context:
space:
mode:
authorEitan Isaacson <eitan@monotonous.org>2011-04-24 16:57:28 -0700
committerEitan Isaacson <eitan@monotonous.org>2011-05-02 10:21:08 -0700
commite1ae6ee91507a47cbe2fe537f3107c17390bc0e2 (patch)
tree04ea360d747c6e489e50c9649fe33cd6723f83a8 /caribou/i18n.py.in
parentf195b7aafa878568e7aae8ccc27e3716ae7c21cc (diff)
downloadcaribou-e1ae6ee91507a47cbe2fe537f3107c17390bc0e2.tar.gz
Major re-work of Python modules:
* Created Antler to use new keyboard model via PyGI * Rearanged settings to accomodate view/model seperation. * Created in preferences executable, it will be a standalone generic caribou settings UI where we will eventually get the important stuff in GNOME's control panel. * DBusified the UI.
Diffstat (limited to 'caribou/i18n.py.in')
-rw-r--r--caribou/i18n.py.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/caribou/i18n.py.in b/caribou/i18n.py.in
new file mode 100644
index 0000000..bf7ad0f
--- /dev/null
+++ b/caribou/i18n.py.in
@@ -0,0 +1,19 @@
+import gettext
+from gettext import gettext as _
+import os
+
+def C_(ctx, s):
+ """Provide qualified translatable strings via context.
+ (copied from Orca)"""
+ translated = gettext.gettext('%s\x04%s' % (ctx, s))
+ if '\x04' in translated:
+ # no translation found, return input string
+ return s
+ return translated
+
+gettext.bindtextdomain ("@GETTEXT_PACKAGE@",
+ os.path.join ("@prefix@", "@DATADIRNAME@", "locale"))
+
+gettext.textdomain("@GETTEXT_PACKAGE@")
+
+