From 433f2908a045399c9811047d68904dc7f6cfd7fa Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 1 May 2025 17:28:56 -0700 Subject: [PATCH] feat: add language normalization to convert locale codes to names using Babel or fallback map --- aider/coders/base_coder.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 0b946ea1d..855f34e8a 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -15,6 +15,13 @@ import time import traceback from collections import defaultdict from datetime import datetime + +# Optional dependency: used to convert locale codes (eg ``en_US``) +# into human-readable language names (eg ``English``). +try: + from babel import Locale # type: ignore +except ImportError: # Babel not installed – we will fall back to a small mapping + Locale = None from json.decoder import JSONDecodeError from pathlib import Path from typing import List