macOS: Ensure the LANG environment variable is set

Fixes #90
This commit is contained in:
Kovid Goyal
2017-06-25 20:44:16 +05:30
parent 3d5c65eaea
commit 62db44c71e
3 changed files with 32 additions and 1 deletions
+12
View File
@@ -228,7 +228,19 @@ def on_glfw_error(code, msg):
safe_print('[glfw error] ', msg, file=sys.stderr)
def ensure_osx_locale():
# Ensure the LANG env var is set. See
# https://github.com/kovidgoyal/kitty/issues/90
from .fast_data_types import cocoa_get_lang
if 'LANG' not in os.environ:
lang = cocoa_get_lang()
if lang is not None:
os.environ['LANG'] = lang + '.UTF-8'
def main():
if isosx:
ensure_osx_locale()
locale.setlocale(locale.LC_ALL, '')
if os.environ.pop('KITTY_LAUNCHED_BY_LAUNCH_SERVICES',
None) == '1' and getattr(sys, 'frozen', True):