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