Catch error if locale's file not installed

merge-requests/64/head
Hugo Posnic 2016-12-21 18:32:16 +01:00
parent faf50ea9ab
commit 65a1e9296e
1 changed files with 5 additions and 2 deletions

View File

@ -120,8 +120,11 @@ class ManjaroHello():
:param locale: locale to use
:type locale: str
"""
tr = gettext.translation(self.app, self.locale_path, [locale])
tr.install()
try:
tr = gettext.translation(self.app, self.locale_path, [locale])
tr.install()
except OSError:
print("WARNING: No translation file for '{}' locale".format(locale))
# Dirty code to fix an issue with gettext that can't translate strings from glade files
# Redfining all translatables strings