1 ############################################################################
2 # Copyright (C) 2005 by Reithinger GmbH
5 # This file is part of faces.
7 # faces is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # faces is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the
19 # Free Software Foundation, Inc.,
20 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 ############################################################################
28 def _get_translation():
30 return gettext
.translation("faces")
34 path
= os
.path
.dirname(sys
.argv
[0])
35 path
= os
.path
.join(path
, "resources", "faces", "locale")
37 path
= os
.path
.split(__file__
)[0]
38 path
= os
.path
.join(path
, "locale")
40 return gettext
.translation("faces", path
)
45 trans
= _get_translation()
46 if trans
: return trans
.ugettext
47 return lambda msg
: msg
51 trans
= _get_translation()
52 if trans
: return trans
.charset()
53 return locale
.getpreferredencoding()