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:
|
||||
lang = locale.getlocale()[0]
|
||||
if lang:
|
||||
return lang.split("_")[0] # Extract just the language code
|
||||
return lang # Return the full language code, including country
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
for env_var in ["LANG", "LANGUAGE", "LC_ALL", "LC_MESSAGES"]:
|
||||
lang = os.environ.get(env_var)
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue