auto-detect language
This commit is contained in:
+12
-3
@@ -20,9 +20,18 @@ import sys
|
||||
import re
|
||||
import Queue
|
||||
|
||||
import gettext
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"])
|
||||
trans.install()
|
||||
import locale
|
||||
lang=locale.getdefaultlocale()[0][0:2]
|
||||
print "lang:", lang
|
||||
if lang=="en":
|
||||
def _(string): return string
|
||||
else:
|
||||
import gettext
|
||||
try:
|
||||
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
|
||||
trans.install()
|
||||
except IOError:
|
||||
def _(string): return string
|
||||
|
||||
# if path is set to use an old version of python look for a new one:
|
||||
# (does this work in linux?)
|
||||
|
||||
Reference in New Issue
Block a user