diff options
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | caribou/Makefile.am | 5 | ||||
-rw-r--r-- | caribou/i18n.py.in | 21 | ||||
-rw-r--r-- | caribou/main.py | 1 | ||||
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | po/LINGUAS | 0 | ||||
-rw-r--r-- | po/POTFILES.in | 3 |
8 files changed, 45 insertions, 7 deletions
@@ -14,3 +14,11 @@ bin/caribou install-sh missing py-compile +caribou/i18n.py +mkinstalldirs +po/Makefile.in.in +po/POTFILES +po/stamp-it +*.gmo +m4/intltool.m4 + diff --git a/Makefile.am b/Makefile.am index 6ee3575..60d3a68 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,3 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -SUBDIRS = caribou bin data +SUBDIRS = caribou bin data po diff --git a/caribou/Makefile.am b/caribou/Makefile.am index 7157fe6..dda528c 100644 --- a/caribou/Makefile.am +++ b/caribou/Makefile.am @@ -8,7 +8,10 @@ caribou_PYTHON = \ keyboard.py \ main.py \ opacity.py \ - window.py + window.py \ + i18n.py + +DISTCLEANFILES = i18n.py clean-local: rm -rf *.pyc *.pyo diff --git a/caribou/i18n.py.in b/caribou/i18n.py.in new file mode 100644 index 0000000..067283a --- /dev/null +++ b/caribou/i18n.py.in @@ -0,0 +1,21 @@ +import gettext +from gettext import gettext as _ +import os + +print 'initialized i18n' + +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@") + + diff --git a/caribou/main.py b/caribou/main.py index aef9488..6c978de 100644 --- a/caribou/main.py +++ b/caribou/main.py @@ -3,6 +3,7 @@ import pyatspi import gconf from window import CaribouWindowEntry from keyboard import CaribouKeyboard +from i18n import _ debug = False diff --git a/configure.ac b/configure.ac index cac2ab3..d7cb601 100644 --- a/configure.ac +++ b/configure.ac @@ -26,13 +26,13 @@ AC_SUBST(CARIBOU_CFLAGS) AC_SUBST(CARIBOU_LIBS) dnl == i18n == -#GETTEXT_PACKAGE=caribou -#AC_SUBST(GETTEXT_PACKAGE) -#AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package]) -#AM_GLIB_GNU_GETTEXT +GETTEXT_PACKAGE=caribou +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package]) +AM_GLIB_GNU_GETTEXT dnl == intltool check == -#IT_PROG_INTLTOOL([0.35.0]) +IT_PROG_INTLTOOL([0.35.0]) dnl == Documentation == GNOME_DOC_INIT @@ -40,8 +40,10 @@ GNOME_DOC_INIT dnl == generate makefiles == AC_OUTPUT([ Makefile +po/Makefile.in caribou/Makefile caribou/keyboards/Makefile +caribou/i18n.py bin/Makefile bin/caribou data/Makefile diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/po/LINGUAS diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..1fe1c67 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,3 @@ +[encoding: UTF-8] +caribou/main.py +[type: gettext/glade]data/caribou-prefs.ui |