mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
feat: include country in user language detection
This commit is contained in:
parent
86d37e0c25
commit
fe33cef894
1 changed files with 2 additions and 2 deletions
|
@ -744,14 +744,14 @@ class Coder:
|
||||||
try:
|
try:
|
||||||
lang = locale.getlocale()[0]
|
lang = locale.getlocale()[0]
|
||||||
if lang:
|
if lang:
|
||||||
return lang.split("_")[0] # Extract just the language code
|
return lang # Return the full language code, including country
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for env_var in ["LANG", "LANGUAGE", "LC_ALL", "LC_MESSAGES"]:
|
for env_var in ["LANG", "LANGUAGE", "LC_ALL", "LC_MESSAGES"]:
|
||||||
lang = os.environ.get(env_var)
|
lang = os.environ.get(env_var)
|
||||||
if lang:
|
if lang:
|
||||||
return lang.split("_")[0] # Extract just the language code
|
return lang.split(".")[0] # Return language and country, but remove encoding if present
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue