mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 12:58:07 +01:00
Applied LC_MESSAGES patch from David Paleino
This commit is contained in:
12
wicd/misc.py
12
wicd/misc.py
@@ -313,16 +313,20 @@ def get_gettext():
|
|||||||
# http://www.learningpython.com/2006/12/03/translating-your-pythonpygtk-application/
|
# http://www.learningpython.com/2006/12/03/translating-your-pythonpygtk-application/
|
||||||
local_path = wpath.translations
|
local_path = wpath.translations
|
||||||
langs = []
|
langs = []
|
||||||
|
osLanguage = os.environ.get('LANGUAGE', None)
|
||||||
|
if osLanguage:
|
||||||
|
langs += osLanguage.split(":")
|
||||||
|
osLanguage = None
|
||||||
|
osLanguage = os.environ.get('LC_MESSAGES', None)
|
||||||
|
if osLanguage:
|
||||||
|
langs += osLanguage.split(":")
|
||||||
try:
|
try:
|
||||||
lc, encoding = locale.getdefaultlocale()
|
lc, encoding = locale.getdefaultlocale()
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
print str(e)
|
print str(e)
|
||||||
print "Default locale unavailable, falling back to en_US"
|
print "Default locale unavailable, falling back to en_US"
|
||||||
if (lc):
|
if (lc):
|
||||||
langs = [lc]
|
langs += [lc]
|
||||||
osLanguage = os.environ.get('LANGUAGE', None)
|
|
||||||
if (osLanguage):
|
|
||||||
langs += osLanguage.split(":")
|
|
||||||
langs += ["en_US"]
|
langs += ["en_US"]
|
||||||
lang = gettext.translation('wicd', local_path, languages=langs,
|
lang = gettext.translation('wicd', local_path, languages=langs,
|
||||||
fallback=True)
|
fallback=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user