Merge pull request #2392 from manuelVo/2341-fallback-locale

Use fallback locale if locale is configured incorrectly (fixes #2341)
This commit is contained in:
Mathieu Comandon 2019-10-16 06:23:20 -07:00 committed by GitHub
commit 32b1e33d5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,11 @@ if os.path.isdir(os.path.join(LAUNCH_PATH,"../lutris")):
else:
sys.path.insert(0, os.path.normpath(os.path.join(LAUNCH_PATH, "../lib/lutris")))
locale.setlocale(locale.LC_ALL, "")
try:
locale.setlocale(locale.LC_ALL, "")
except locale.Error:
sys.stderr.write("Unsupported locale setting. Using 'C' as fallback locale.\n")
locale.setlocale(locale.LC_ALL, "C")
from lutris.gui.application import Application