24 lines
849 B
Diff
24 lines
849 B
Diff
upstreamed in https://github.com/lutris/lutris/pull/4496
|
|
|
|
--- a/lutris/util/system.py
|
|
+++ b/lutris/util/system.py
|
|
@@ -431,9 +431,15 @@
|
|
|
|
def get_locale_list():
|
|
"""Return list of available locales"""
|
|
- with subprocess.Popen(['locale', '-a'], stdout=subprocess.PIPE) as locale_getter:
|
|
- output = locale_getter.communicate()
|
|
- locales = output[0].decode('ASCII').split() # locale names use only ascii characters
|
|
+ try:
|
|
+ with subprocess.Popen(['locale', '-a'], stdout=subprocess.PIPE) as locale_getter:
|
|
+ output = locale_getter.communicate()
|
|
+ locales = output[0].decode('ASCII').split() # locale names use only ascii characters
|
|
+ except FileNotFoundError:
|
|
+ if lang := os.environ.get('LANG', ''):
|
|
+ locales = [lang]
|
|
+ else:
|
|
+ locales = []
|
|
return locales
|
|
|
|
|