root/branches/gajim_0.4.1/common/i18n.py

Revision 359, 0.9 kB (checked in by asterix, 4 years ago)

update my email adress
update copyright
add missing headers

Line 
1##      common/i18n.py
2##
3## Gajim Team:
4##      - Yann Le Boulanger <asterix@lagaule.org>
5##      - Vincent Hanquez <tab@snarc.org>
6##
7##      Copyright (C) 2003-2005 Gajim Team
8##
9## This program is free software; you can redistribute it and/or modify
10## it under the terms of the GNU General Public License as published
11## by the Free Software Foundation; version 2 only.
12##
13## This program is distributed in the hope that it will be useful,
14## but WITHOUT ANY WARRANTY; without even the implied warranty of
15## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16## GNU General Public License for more details.
17##
18
19APP='gajim'
20DIR='Messages'
21
22import locale, gettext
23
24locale.setlocale(locale.LC_ALL, '')
25_translation = None
26
27def init():
28        global _translation
29        try:
30                _translation = gettext.translation(APP, DIR)
31        except IOError:
32                _translation = gettext.NullTranslations()
33
34def _(s):
35        if s == '':
36                return s
37        assert s
38        return _translation.gettext(s)
Note: See TracBrowser for help on using the browser.