auto-detect language

This commit is contained in:
steffen123
2010-08-15 20:50:49 +02:00
parent 21211a7669
commit b4317bba2a
14 changed files with 156 additions and 39 deletions
+12 -3
View File
@@ -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?)