feat(commit-message): Generate commit messages in the user's selected UI language instead of always using English.#11994
Conversation
…tion Add support for generating commit messages in the user's selected UI language. The language parameter flows through the entire stack: VSCode extension passes the selected locale, the HTTP API accepts the new field, and the generation service appends language instructions to the system prompt for non-English locales. - Update CommitMessageRequest types to include optional language field - Modify VSCode service to pass selected locale to the API - Append language requirements to system prompt when language is not English - Update OpenAPI specification and regenerate SDK types - Add test coverage for language instruction generation
|
@IOLOII is attempting to deploy a commit to the Kilo Code Team on Vercel. A member of the Team first needs to authorize it. |
| try { | ||
| const { data } = await client.commitMessage.generate( | ||
| { path, selectedFiles: undefined, previousMessage }, | ||
| { path, selectedFiles: undefined, previousMessage, language: selectedLocale(vscode) }, |
There was a problem hiding this comment.
WARNING: Internal locale bundle keys don't always match real language codes/names
selectedLocale(vscode) returns internal i18n bundle keys (ar, br, bs, ..., zht), not necessarily valid ISO language codes or names. Two of these are semantically wrong when forwarded straight into languageInstruction()'s prompt text (packages/opencode/src/kilocode/commit-message/generate.ts):
"br"is this codebase's key for Brazilian Portuguese (seepackages/kilo-vscode/src/services/i18n/br.ts/autocomplete/br.ts), butbris actually the ISO 639-1 code for Breton. Telling the LLM to write "in the following language: br" is likely to confuse it rather than reliably produce Portuguese."zht"(Traditional Chinese) isn't a standard language code/name at all (the standard forms arezh-Hantorzh-TW), so the LLM may not recognize it as an instruction to switch language.
Consider mapping the resolved bundle key to a human-readable language name (or a real ISO code) before sending it as language, e.g. a small lookup table in the i18n module, rather than passing the internal bundle key straight through to the LLM prompt.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
There was a problem hiding this comment.
Thanks for the review! Regarding the br and zht warnings:
I've considered this carefully. While these aren't standard ISO codes, modern LLMs (especially Claude 3.5 Sonnet and GPT-4) have strong contextual understanding. Given that the system prompt explicitly states "Write commit messages in the following language:", the models will naturally parse br as Brazilian Portuguese and zht as Traditional Chinese based on context.
Introducing a hardcoded mapping dictionary would introduce maintenance overhead for every new locale VSCode adds in the future. I believe keeping the code simple and relying on the LLM's inherent capability is a more scalable approach here.
Could you please approve this as an acceptable trade-off for this PR?
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The only PR-owned change since the previous review is a single commit ( All translation issues raised in earlier reviews ( The separate open discussion about internal locale bundle keys ( Files Reviewed (13 files changed since previous review)
Previous Review Summaries (3 snapshots, latest commit 05b0303)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 05b0303)Status: No Issues Found | Recommendation: Merge All previously flagged translation issues have been fixed in the latest commit:
The separate open discussion about internal locale bundle keys ( Files Reviewed (4 files changed since previous review)
Previous review (commit 7188af1)Status: 5 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (25 files changed since previous review, excluding generated SDK/OpenAPI artifacts)
Fix these issues in Kilo Cloud Previous review (commit 32426eb)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (7 files, excluding generated SDK/OpenAPI artifacts)
Reviewed by claude-sonnet-5-20260630 · Input: 50 · Output: 15.8K · Cached: 1.8M Review guidance: REVIEW.md from base branch |
|
(I'm not a maintainer, just another users that use this feature) I think maybe we should have this option in vscode ext setting, instead of Kilo config? |
…ted commit messages Add a new `kilo-code.new.languageCommitMessage` VS Code setting that allows users to choose a specific language for AI-generated commit messages, independent of the UI language. When set to "sync" (default), the commit message language follows the Kilo Code UI language. - Add language selector dropdown to CommitMessageTab settings UI - Add getCommitMessageLanguage() helper in i18n service - Pass languageCommitMessage setting through KiloProvider to webview - Add translation strings for all 20 supported locales
| "settings.commitMessage.language.sync": "Sync med UI-språk", | ||
| "settings.commitMessage.language.title": "Language", | ||
| "settings.commitMessage.language.description": | ||
| "Velg hvilket språk du skal bruke for AI-generasjonerte begjæringsmeldinger:", |
There was a problem hiding this comment.
WARNING: Garbled/incorrect Norwegian translation for the new commit-message language description
"Velg hvilket språk du skal bruke for AI-generasjonerte begjæringsmeldinger:" has two problems:
AI-generasjonerteis not a real Norwegian word (likely meantAI-genererte, "AI-generated").begjæringsmeldingermeans "petition messages", not "commit messages". Elsewhere in this same file,commit message(s)/commit-meldingeris used consistently (see thesettings.commitMessage.prompt.*keys just above).
This string is rendered directly in the new Commit Message settings tab (language.t("settings.commitMessage.language.description")), so Norwegian-language users will see this broken sentence.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| "f.eks. Generer commit messages på spansk i henhold til conventional commits-formatet. Returner KUN commit message.", | ||
|
|
||
| "settings.commitMessage.language.sync": "Sync med UI-språk", | ||
| "settings.commitMessage.language.title": "Language", |
There was a problem hiding this comment.
SUGGESTION: Untranslated English string in the Norwegian bundle
"settings.commitMessage.language.title": "Language" was left in English while every other locale file translates this key (e.g. de.ts → "Sprache", fr.ts → "Langue"). Consider translating to Norwegian, e.g. "Språk".
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| "settings.commitMessage.language.sync": "UI 언어와 동기화", | ||
| "settings.commitMessage.language.title": "언어", | ||
| "settings.commitMessage.language.description": | ||
| "AI 생성된 커AI 메시지에 사용할 언어를 선택하십시오.:", |
There was a problem hiding this comment.
WARNING: Corrupted Korean text in the new commit-message language description
"AI 생성된 커AI 메시지에 사용할 언어를 선택하십시오.:" contains 커AI 메시지, which is garbled — likely meant to be 커밋 메시지 ("commit message"). This string is rendered directly in the new Commit Message settings tab (language.t("settings.commitMessage.language.description")), so Korean-language users will see this corrupted text. (There's also a stray . before the trailing :.)
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| "settings.commitMessage.language.sync": "Sincronización con el idioma de la interfaz de usuario", | ||
| "settings.commitMessage.language.title": "Idioma", | ||
| "settings.commitMessage.language.description": | ||
| "Elija qué idioma usar para los mensajes de compromiso generados por IA:", |
There was a problem hiding this comment.
SUGGESTION: Inconsistent terminology for "commit message" in this new string
"mensajes de compromiso" literally means "commitment messages", not "commit messages". Elsewhere in this same file the term commit message(s) / mensajes de commit is used consistently (see the settings.commitMessage.prompt.* keys just above and settings.model.small.description). Consider aligning this string with the existing terminology.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
…e files Replace literal translations of "commit" with the loanword form in Brazilian Portuguese and Spanish locale dictionaries, correct a Korean typo (커AI → 커밋), translate an untranslated English label in Norwegian, and align terminology with conventional usage across all four affected language packs.
|
@IOLOII we already support to override the custom prompt for the generation. Is that not sufficient to ensure that the prompt is generated in your language? |
|
@marius-kilocode Thanks for the feedback. I’d like to share my personal experience, which is actually what motivated this PR. When I first started using the legacy version of this extension, I immediately felt the need for a dedicated language setting. However, back then, I didn't realize I could achieve the same result by modifying the custom prompt. So, I actually maintained my own fork of the legacy version and implemented a similar feature on my own branch to solve this. I used it for a while and it worked really well for my daily workflow. Now that we’ve migrated to this new version, I naturally wanted to bring that convenience over. I think many users are like me: we don't want to spend time learning how to craft a precise prompt just to set the language. We usually just set the UI language in the settings, and then expect the tool to work right out of the box. That’s why I really like the idea of adding a "Sync with UI Language" option. It provides a "plug-and-play" experience. Even if advanced users prefer to handle it via custom prompts, new or casual users will benefit from this instant convenience. I hope this user-centric perspective makes sense. I'd love to hear your thoughts! |
|
The I pushed a formatting fix to this branch ( |
|
@IOLOII your user-centric argument makes sense and your implementation is mostly sound. Let's merge this, thanks! |
@marius-kilocode Thanks for the review! I appreciate you reminding me about the bun run format command, and I'm glad to have contributed to this project. |

Adds support for generating commit messages in the user's selected UI language. Previously, the "Generate Commit Message" command always produced English commit messages regardless of the user's language setting. Now, the VS Code extension passes the resolved locale to the CLI backend, which appends a language instruction to the system prompt when the language is non-English.
7188af1
Adds support for generating commit messages in the user's selected language, with the ability to either follow the Kilo Code UI language or choose a specific language independently.
32426eb
Issue
Fixes #
Context
Implementation
packages/opencode/src/kilocode/commit-message/types.ts— added optionallanguagefield toCommitMessageRequestpackages/opencode/src/kilocode/server/httpapi/groups/commit-message.ts— addedlanguageto the HTTP API payload schemapackages/opencode/src/kilocode/server/httpapi/handlers/commit-message.ts— forwardslanguagetogenerateCommitMessagepackages/opencode/src/kilocode/commit-message/generate.ts— appends a language requirement to the system prompt whenlanguageis set and not Englishpackages/kilo-vscode/src/services/commit-message/index.ts— passesselectedLocale(vscode)(respectskilo-code.new.languageoverride and VS Code display language) to the backendpackages/opencode/test/kilocode/commit-message/generate.test.ts— added test coverage for language instruction generationpackages/sdk/js/src/v2/gen/*,packages/sdk/openapi.json) from the updated OpenAPI schema.changeset/short-geckos-fry.mdScreenshots / Video
How to Test
zh) viakilo-code.new.language, or change VS Code's display languageManual/local verification
bun test ./test/kilocode/commit-message/— 53 pass, 0 failbun run typecheck— passes forpackages/opencode,packages/kilo-vscode, andpackages/sdk/jsbun run lint— passes forpackages/kilo-vscodebun turbo typecheck— passes (JetBrains requires Java 21; installed and configured locally)Reviewer test steps
bun installif needed./script/generate.tsto confirm SDK is in sync (already done)bun test ./test/kilocode/commit-message/generate.test.tsfrompackages/opencode/Blocked checks and substitute verification
Checklist
Get in Touch