2004-05-17 01:47:14 +02:00
|
|
|
## common/i18n.py
|
|
|
|
##
|
|
|
|
## Gajim Team:
|
2005-01-07 22:52:38 +01:00
|
|
|
## - Yann Le Boulanger <asterix@lagaule.org>
|
2004-06-18 11:25:15 +02:00
|
|
|
## - Vincent Hanquez <tab@snarc.org>
|
2004-05-17 01:47:14 +02:00
|
|
|
##
|
2005-01-07 22:52:38 +01:00
|
|
|
## Copyright (C) 2003-2005 Gajim Team
|
2004-05-17 01:47:14 +02:00
|
|
|
##
|
|
|
|
## 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='Messages'
|
|
|
|
|
|
|
|
import locale, gettext
|
|
|
|
|
2004-11-15 10:43:13 +01:00
|
|
|
locale.setlocale(locale.LC_ALL, '')
|
2004-05-17 01:47:14 +02:00
|
|
|
_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)
|