mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +02:00
fix: fallback to en_US when locale code is invalid
This commit is contained in:
@@ -297,10 +297,7 @@ def ensure_macos_locale() -> None:
|
|||||||
lang = cocoa_get_lang()
|
lang = cocoa_get_lang()
|
||||||
if lang is not None:
|
if lang is not None:
|
||||||
if not locale_is_valid(lang):
|
if not locale_is_valid(lang):
|
||||||
if lang.startswith('en_'):
|
lang = 'en_US'
|
||||||
lang = 'en_US'
|
|
||||||
else:
|
|
||||||
log_error(f'Could not set LANG Cocoa returns language as: {lang}')
|
|
||||||
os.environ['LANG'] = f'{lang}.UTF-8'
|
os.environ['LANG'] = f'{lang}.UTF-8'
|
||||||
set_LANG_in_default_env(os.environ['LANG'])
|
set_LANG_in_default_env(os.environ['LANG'])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user