mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 04:14:59 +00:00
refactor: Validate locale language result
This commit is contained in:
parent
b8758ca791
commit
17a2773a22
1 changed files with 4 additions and 1 deletions
|
@ -1094,6 +1094,7 @@ class Coder:
|
|||
2. ``locale.getlocale()``
|
||||
3. ``LANG`` / ``LANGUAGE`` / ``LC_ALL`` / ``LC_MESSAGES`` environment variables
|
||||
"""
|
||||
|
||||
# Explicit override
|
||||
if self.chat_language:
|
||||
return self.normalize_language(self.chat_language)
|
||||
|
@ -1102,7 +1103,9 @@ class Coder:
|
|||
try:
|
||||
lang = locale.getlocale()[0]
|
||||
if lang:
|
||||
return self.normalize_language(lang)
|
||||
lang = self.normalize_language(lang)
|
||||
if lang:
|
||||
return lang
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue