bugfix #27: use default msg marker if no localization found
This commit is contained in:
parent
64454e42f1
commit
894fab9c68
1 changed files with 9 additions and 2 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
#encoding: utf-8
|
#encoding: utf-8
|
||||||
|
|
||||||
|
def default_gettext( msg ):
|
||||||
|
return msg
|
||||||
|
|
||||||
def theme():
|
def theme():
|
||||||
import os
|
import os
|
||||||
import gettext
|
import gettext
|
||||||
|
|
@ -9,8 +12,12 @@ def theme():
|
||||||
gv = os.popen("g++ -dumpversion").read().strip()
|
gv = os.popen("g++ -dumpversion").read().strip()
|
||||||
|
|
||||||
# get the current translations of gcc
|
# get the current translations of gcc
|
||||||
t = gettext.translation("gcc-"+gv)
|
try:
|
||||||
_ = t.gettext
|
t = gettext.translation("gcc-"+gv)
|
||||||
|
except IOError:
|
||||||
|
_ = default_gettext
|
||||||
|
else:
|
||||||
|
_ = t.gettext
|
||||||
# _("msg") will return the given message, translated
|
# _("msg") will return the given message, translated
|
||||||
|
|
||||||
# if the locale is unicode
|
# if the locale is unicode
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue