From d24890e69306b28a2c8a5dc199d54aeef4d5a1e6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Jun 2026 02:38:39 +0000 Subject: [PATCH 1/4] feat: add Bangla (Bangladesh) commit language option --- README.md | 2 +- README.zh_CN.md | 2 +- package.json | 2 ++ src/prompts.ts | 31 +++++++++++++++++++++---------- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7431fee..0dec5f0 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ In the VSCode settings, locate the "ai-commit" configuration options and configu | CLAUDE_API_KEY | string | None | No | Anthropic API key. Leave empty to use Claude CLI (authenticated via `claude setup-token`). Required when `AI_PROVIDER` is `claude` | | CLAUDE_MODEL | string | claude-sonnet-4-5-20250929 | No | Claude model to use | | CLAUDE_TEMPERATURE | number | 0.7 | No | Controls randomness. Range: 0–1 | -| AI_COMMIT_LANGUAGE | string | English | Yes | Supports 19 languages | +| AI_COMMIT_LANGUAGE | string | English | Yes | Supports 20 languages | | SYSTEM_PROMPT | string | None | No | Custom system prompt | ## ⌨️ Local Development diff --git a/README.zh_CN.md b/README.zh_CN.md index 9a76cf8..c9847f6 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -77,7 +77,7 @@ | CLAUDE_API_KEY | string | None | 否 | Anthropic API 密钥。留空可使用 Claude CLI(通过 `claude setup-token` 认证)。`AI_PROVIDER` 为 `claude` 时需配置 | | CLAUDE_MODEL | string | claude-sonnet-4-5-20250929 | 否 | Claude 使用的模型 | | CLAUDE_TEMPERATURE | number | 0.7 | 否 | 控制输出随机性。范围:0–1 | -| AI_COMMIT_LANGUAGE | string | English | 是 | 支持 19 种语言 | +| AI_COMMIT_LANGUAGE | string | English | 是 | 支持 20 种语言 | | SYSTEM_PROMPT | string | None | 否 | 自定义系统提示词 | ## ⌨️ 本地开发 diff --git a/package.json b/package.json index 0314328..9db80ad 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "Dutch", "Portuguese", "Vietnamese", + "Bangla (Bangladesh)", "English", "Spanish", "Swedish", @@ -85,6 +86,7 @@ "Nederlands", "português", "tiếng Việt", + "বাংলা (বাংলাদেশ)", "english", "español", "Svenska", diff --git a/src/prompts.ts b/src/prompts.ts index 59f80e3..37d239c 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -1,16 +1,26 @@ import { ConfigKeys, ConfigurationManager } from './config'; +const getLanguageInstruction = (language: string): string => { + if (language === 'Bangla (Bangladesh)') { + return 'Bangla (Bangladesh) with Bangladeshi tone and accent'; + } + return language; +}; + /** * Initializes the main prompt for generating commit messages. * * @param {string} language - The language to be used in the prompt. * @returns {Object} - The main prompt object containing role and content. */ -const INIT_MAIN_PROMPT = (language: string) => ({ - role: 'system', - content: - ConfigurationManager.getInstance().getConfig(ConfigKeys.SYSTEM_PROMPT) || - `# Git Commit Message Guide +const INIT_MAIN_PROMPT = (language: string) => { + const languageInstruction = getLanguageInstruction(language); + + return { + role: 'system', + content: + ConfigurationManager.getInstance().getConfig(ConfigKeys.SYSTEM_PROMPT) || + `# Git Commit Message Guide ## Role and Purpose @@ -61,20 +71,20 @@ You will act as a git commit message generator. When receiving a git diff, you w - No capitalization - No period at end - Max 50 characters -- Must be in ${language} +- Must be in ${languageInstruction} ### Body - Bullet points with "-" - Max 72 chars per line - Explain what and why -- Must be in ${language} +- Must be in ${languageInstruction} - Use【】for different types ## Critical Requirements 1. Output ONLY the commit message -2. Write ONLY in ${language} +2. Write ONLY in ${languageInstruction} 3. NO additional text or explanations 4. NO questions or comments 5. NO formatting instructions or metadata @@ -104,8 +114,9 @@ OUTPUT: - rename port variable to uppercase (PORT) to follow constant naming convention - add environment variable port support for flexible deployment -Remember: All output MUST be in ${language} language. You are to act as a pure commit message generator. Your response should contain NOTHING but the commit message itself.` -}); +Remember: All output MUST be in ${languageInstruction} language. You are to act as a pure commit message generator. Your response should contain NOTHING but the commit message itself.` + }; +}; /** * Retrieves the main commit prompt. From 577888d6248e67de7d35d082eac823961de8bbec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Jun 2026 02:39:51 +0000 Subject: [PATCH 2/4] refactor: map language-specific prompt instructions --- src/prompts.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/prompts.ts b/src/prompts.ts index 37d239c..4290e71 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -1,10 +1,11 @@ import { ConfigKeys, ConfigurationManager } from './config'; +const LANGUAGE_INSTRUCTIONS: Record = { + 'Bangla (Bangladesh)': 'Bangla (Bangladesh) with Bangladeshi tone and accent' +}; + const getLanguageInstruction = (language: string): string => { - if (language === 'Bangla (Bangladesh)') { - return 'Bangla (Bangladesh) with Bangladeshi tone and accent'; - } - return language; + return LANGUAGE_INSTRUCTIONS[language] ?? language; }; /** From a61225d71040df7be38c72d6cd55b633a1be16b8 Mon Sep 17 00:00:00 2001 From: tarikmanoar Date: Tue, 2 Jun 2026 12:08:08 +0600 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8C=90=20i18n(prompts):=20refine=20Ba?= =?UTF-8?q?ngla=20(Bangladesh)=20to=20standard=20formal=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace "Bangladeshi tone and accent" instruction that produced colloquial/regional dialect (হইল, থিকা, লাইগা) with standard formal Bangla (প্রমিত বাংলা) - Add LANGUAGE_STYLE_NOTES with explicit do/don't word forms to steer output toward professional written Bangla as used in Bangladesh - Keep technical terms in English; inject notes only for languages that define them Co-Authored-By: Claude Opus 4.8 (1M context) --- src/prompts.ts | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/prompts.ts b/src/prompts.ts index 4290e71..dcf9b3e 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -1,13 +1,40 @@ import { ConfigKeys, ConfigurationManager } from './config'; const LANGUAGE_INSTRUCTIONS: Record = { - 'Bangla (Bangladesh)': 'Bangla (Bangladesh) with Bangladeshi tone and accent' + 'Bangla (Bangladesh)': 'standard formal Bangla (প্রমিত বাংলা) as used in Bangladesh' }; const getLanguageInstruction = (language: string): string => { return LANGUAGE_INSTRUCTIONS[language] ?? language; }; +/** + * Optional language-specific style notes appended to the prompt. These steer + * the model toward natural, correct usage for a given locale. + */ +const LANGUAGE_STYLE_NOTES: Record = { + 'Bangla (Bangladesh)': `## Bangla (Bangladesh) Language Rules + +- Write in Standard Formal Bangla (প্রমিত বাংলা), exactly as used in professional writing in Bangladesh. +- Use correct standard spelling. Do NOT use colloquial, spoken, or regional dialect spellings. +- Required word forms (use the left form, never the right): + - "থেকে" (NOT "থিকা") + - "করা হয়েছে" / "যোগ করা হয়েছে" / "সরানো হয়েছে" (NOT "হইল" / "করা হইল") + - "জন্য" (NOT "লাইগা" / "জইন্য") + - "পুরনো" / "পুরাতন" (NOT "পুরান") + - "এখান" / "এখানে" (NOT "এইখান" / "এইখানে") + - "হলো" (NOT "হইল") +- Prefer the perfect form "… করা হয়েছে" over the colloquial "… করা হইল". +- Use vocabulary common in Bangladesh — avoid West Bengal (India) specific words. +- Keep the tone neutral, professional, and concise, like a Bangladeshi software engineer writing a commit message. +- Keep technical terms (variable names, API names, file names, type/scope keywords) in English.` +}; + +const getLanguageStyleNote = (language: string): string => { + const note = LANGUAGE_STYLE_NOTES[language]; + return note ? `\n${note}\n` : ''; +}; + /** * Initializes the main prompt for generating commit messages. * @@ -16,6 +43,7 @@ const getLanguageInstruction = (language: string): string => { */ const INIT_MAIN_PROMPT = (language: string) => { const languageInstruction = getLanguageInstruction(language); + const languageStyleNote = getLanguageStyleNote(language); return { role: 'system', @@ -81,7 +109,7 @@ You will act as a git commit message generator. When receiving a git diff, you w - Explain what and why - Must be in ${languageInstruction} - Use【】for different types - +${languageStyleNote} ## Critical Requirements 1. Output ONLY the commit message From e9f13fac211573a7cde50cd728f975d3e266a424 Mon Sep 17 00:00:00 2001 From: tarikmanoar Date: Tue, 2 Jun 2026 12:19:33 +0600 Subject: [PATCH 4/4] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(prompts):=20a?= =?UTF-8?q?ddress=20review=20feedback=20on=20Bangla=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use the language name (not a descriptive phrase) in the "Must be in " / "in language" lines so they stay grammatical; move all descriptive guidance into the appended style note - getLanguageStyleNote now returns the raw note; INIT_MAIN_PROMPT owns the surrounding blank-line spacing so output stays consistent with/without a note - Drop the now-unused LANGUAGE_INSTRUCTIONS map and getLanguageInstruction Co-Authored-By: Claude Opus 4.8 (1M context) --- src/prompts.ts | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/prompts.ts b/src/prompts.ts index dcf9b3e..1b6da47 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -1,16 +1,11 @@ import { ConfigKeys, ConfigurationManager } from './config'; -const LANGUAGE_INSTRUCTIONS: Record = { - 'Bangla (Bangladesh)': 'standard formal Bangla (প্রমিত বাংলা) as used in Bangladesh' -}; - -const getLanguageInstruction = (language: string): string => { - return LANGUAGE_INSTRUCTIONS[language] ?? language; -}; - /** * Optional language-specific style notes appended to the prompt. These steer - * the model toward natural, correct usage for a given locale. + * the model toward natural, correct usage for a given locale. The language + * name itself is still used in the prompt's "Must be in " lines; + * these notes only add extra guidance, so they read grammatically regardless + * of how descriptive they are. */ const LANGUAGE_STYLE_NOTES: Record = { 'Bangla (Bangladesh)': `## Bangla (Bangladesh) Language Rules @@ -31,8 +26,7 @@ const LANGUAGE_STYLE_NOTES: Record = { }; const getLanguageStyleNote = (language: string): string => { - const note = LANGUAGE_STYLE_NOTES[language]; - return note ? `\n${note}\n` : ''; + return LANGUAGE_STYLE_NOTES[language] ?? ''; }; /** @@ -42,8 +36,10 @@ const getLanguageStyleNote = (language: string): string => { * @returns {Object} - The main prompt object containing role and content. */ const INIT_MAIN_PROMPT = (language: string) => { - const languageInstruction = getLanguageInstruction(language); - const languageStyleNote = getLanguageStyleNote(language); + const styleNote = getLanguageStyleNote(language); + // Owns the spacing around the optional note so the surrounding template + // keeps consistent single blank lines whether or not a note is present. + const styleSection = styleNote ? `\n${styleNote}\n` : ''; return { role: 'system', @@ -100,20 +96,20 @@ You will act as a git commit message generator. When receiving a git diff, you w - No capitalization - No period at end - Max 50 characters -- Must be in ${languageInstruction} +- Must be in ${language} ### Body - Bullet points with "-" - Max 72 chars per line - Explain what and why -- Must be in ${languageInstruction} +- Must be in ${language} - Use【】for different types -${languageStyleNote} +${styleSection} ## Critical Requirements 1. Output ONLY the commit message -2. Write ONLY in ${languageInstruction} +2. Write ONLY in ${language} 3. NO additional text or explanations 4. NO questions or comments 5. NO formatting instructions or metadata @@ -143,7 +139,7 @@ OUTPUT: - rename port variable to uppercase (PORT) to follow constant naming convention - add environment variable port support for flexible deployment -Remember: All output MUST be in ${languageInstruction} language. You are to act as a pure commit message generator. Your response should contain NOTHING but the commit message itself.` +Remember: All output MUST be in ${language} language. You are to act as a pure commit message generator. Your response should contain NOTHING but the commit message itself.` }; };