From a77cd1a8a08ad952b3c0e4028602a92ed4ab0627 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Wed, 20 Jul 2005 01:34:11 +0000 Subject: [PATCH] gettext support in gajim-remote needs i18n in its path --- scripts/i18n.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/i18n.py diff --git a/scripts/i18n.py b/scripts/i18n.py new file mode 100644 index 000000000..a9387ae25 --- /dev/null +++ b/scripts/i18n.py @@ -0,0 +1,41 @@ +## common/i18n.py +## +## Gajim Team: +## - Yann Le Boulanger +## - Vincent Hanquez +## - Nikos Kouremenos +## - Dimitur Kirov +## +## Copyright (C) 2003-2005 Gajim Team +## +## 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; version 2 only. +## +## 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. +## + +APP='gajim' +DIR='../po' + +import locale +import gettext + +locale.setlocale(locale.LC_ALL, '') +_translation = None + +def init(): + global _translation + try: + _translation = gettext.translation(APP, DIR) + except IOError: + _translation = gettext.NullTranslations() + +def _(s): + if s == '': + return s + assert s + return _translation.gettext(s)