Merge pull request #423 from grant-olson/language_only_localization_fallback
Fallback to language only localization
This commit is contained in:
commit
28b6b743e3
|
@ -3405,8 +3405,20 @@ def run():
|
||||||
app = QtGui.QApplication(sys.argv)
|
app = QtGui.QApplication(sys.argv)
|
||||||
translator = QtCore.QTranslator()
|
translator = QtCore.QTranslator()
|
||||||
|
|
||||||
|
lang_countrycode = str(locale.getdefaultlocale()[0])
|
||||||
|
translation = "translations/bitmessage_" + lang_countrycode
|
||||||
|
|
||||||
|
if not os.path.isfile(translation + ".pro"):
|
||||||
|
# Don't have fully localized translation, try language only
|
||||||
|
lang = lang_countrycode[0:2]
|
||||||
|
translation = "translations/bitmessage_" + lang
|
||||||
|
|
||||||
|
if not os.path.isfile(translation + ".pro"):
|
||||||
|
# Don't have language either, default to 'Merica USA! USA!
|
||||||
|
translation = "translations/bitmessage_en_US"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
translator.load("translations/bitmessage_" + str(locale.getdefaultlocale()[0]))
|
translator.load(translation)
|
||||||
#translator.load("translations/bitmessage_fr_BE") # test French
|
#translator.load("translations/bitmessage_fr_BE") # test French
|
||||||
except:
|
except:
|
||||||
# The above is not compatible with all versions of OSX.
|
# The above is not compatible with all versions of OSX.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user