Fallback to English translation if the current locale isn't found.

This commit is contained in:
LEHAtupointow 2022-06-26 10:48:16 -08:00 committed by GitHub
parent 46bc43d39e
commit ec3df527aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -49,9 +49,14 @@ if os.path.exists("/usr/lib/planet-launcher/"):
sys.path.append("/usr/lib/planet-launcher/")
_ = gettext.translation(
"main", localedir=str(absolute_path) + "/assets/translations/", languages=[LOCALE]
).gettext
try:
_ = gettext.translation(
"main", localedir=str(absolute_path) + "/assets/translations/", languages=[LOCALE]
).gettext
except:
_ = gettext.translation(
"main", localedir=str(absolute_path) + "/assets/translations/", languages=["en"]
).gettext
# Local imports
import launcher