From f66b916d4b5ac318ecd1c661c6a6744ed0fea60f Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 11 Nov 2024 09:36:23 -0800 Subject: [PATCH] feat: Add language configuration for user communication in prompts --- aider/coders/base_coder.py | 6 ++++++ aider/coders/editblock_prompts.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 232ea6acb..164010140 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -956,12 +956,18 @@ class Coder: platform=platform_text ) + if self.chat_language: + language = self.chat_language + else: + language = "in the same language they are using" + prompt = prompt.format( fence=self.fence, lazy_prompt=lazy_prompt, platform=platform_text, shell_cmd_prompt=shell_cmd_prompt, shell_cmd_reminder=shell_cmd_reminder, + language=language, ) return prompt diff --git a/aider/coders/editblock_prompts.py b/aider/coders/editblock_prompts.py index 05d2a3de3..da2acdf95 100644 --- a/aider/coders/editblock_prompts.py +++ b/aider/coders/editblock_prompts.py @@ -11,7 +11,7 @@ Respect and use existing conventions, libraries, etc that are already present in Take requests for changes to the supplied code. If the request is ambiguous, ask questions. -Always reply to the user in the same language they are using. +Always reply to the user in {language}. Once you understand the request you MUST: