Skip to content

feat(commit-message): Generate commit messages in the user's selected UI language instead of always using English.#11994

Merged
marius-kilocode merged 5 commits into
Kilo-Org:mainfrom
IOLOII:main
Jul 8, 2026
Merged

feat(commit-message): Generate commit messages in the user's selected UI language instead of always using English.#11994
marius-kilocode merged 5 commits into
Kilo-Org:mainfrom
IOLOII:main

Conversation

@IOLOII

@IOLOII IOLOII commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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 optional language field to CommitMessageRequest
  • packages/opencode/src/kilocode/server/httpapi/groups/commit-message.ts — added language to the HTTP API payload schema
  • packages/opencode/src/kilocode/server/httpapi/handlers/commit-message.ts — forwards language to generateCommitMessage
  • packages/opencode/src/kilocode/commit-message/generate.ts — appends a language requirement to the system prompt when language is set and not English
  • packages/kilo-vscode/src/services/commit-message/index.ts — passes selectedLocale(vscode) (respects kilo-code.new.language override and VS Code display language) to the backend
  • packages/opencode/test/kilocode/commit-message/generate.test.ts — added test coverage for language instruction generation
  • Regenerated SDK (packages/sdk/js/src/v2/gen/*, packages/sdk/openapi.json) from the updated OpenAPI schema
  • Added changeset: .changeset/short-geckos-fry.md

Screenshots / Video

before after
Generated commit messages are always in English Generated commit messages follow the user's selected Kilo Code / VS Code language
image image
image image

How to Test

  1. Open a workspace with git changes staged
  2. Set Kilo Code language to a non-English locale (e.g., zh) via kilo-code.new.language, or change VS Code's display language
  3. Use the "Generate Commit Message" command from the Source Control panel
  4. The generated commit message should be in the selected language

Manual/local verification

  • bun test ./test/kilocode/commit-message/ — 53 pass, 0 fail
  • bun run typecheck — passes for packages/opencode, packages/kilo-vscode, and packages/sdk/js
  • bun run lint — passes for packages/kilo-vscode
  • Root bun turbo typecheck — passes (JetBrains requires Java 21; installed and configured locally)

Reviewer test steps

  1. Check out the branch
  2. Run bun install if needed
  3. Run ./script/generate.ts to confirm SDK is in sync (already done)
  4. Run bun test ./test/kilocode/commit-message/generate.test.ts from packages/opencode/
  5. Optionally test manually in VS Code with a non-English language setting

Blocked checks and substitute verification

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

…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
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

@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) },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (see packages/kilo-vscode/src/services/i18n/br.ts / autocomplete/br.ts), but br is 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 are zh-Hant or zh-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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kilocode-bot

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?

@kilo-code-bot

kilo-code-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The only PR-owned change since the previous review is a single commit (f61c502) that reformats 13 locale files so the settings.commitMessage.language.description string fits on one line, satisfying format:check/prettier. It is a pure whitespace/line-join change — the translated text is byte-for-byte identical before and after in every file, so none of the previously-fixed translations regressed.

All translation issues raised in earlier reviews (no.ts garbled description + untranslated "Language", ko.ts corrupted text, es.ts/br.ts terminology) remain fixed as of commit 05b0303, unchanged by this formatting-only commit.

The separate open discussion about internal locale bundle keys (br, zht) not matching real language codes when forwarded to the LLM prompt (packages/kilo-vscode/src/services/commit-message/index.ts / packages/kilo-vscode/src/services/i18n/index.ts) is untouched by this commit and remains an open thread for the author/reviewers to resolve.

Files Reviewed (13 files changed since previous review)
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts
  • packages/kilo-vscode/webview-ui/src/i18n/it.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts
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:

  • no.ts — garbled Norwegian description and untranslated "Language" string both corrected
  • ko.ts — corrupted Korean text fixed
  • es.ts — terminology aligned with "commit" used elsewhere in the file
  • br.ts — terminology aligned with "commit" used elsewhere in the file

The separate open discussion about internal locale bundle keys (br, zht) not matching real language codes when forwarded to the LLM prompt (packages/kilo-vscode/src/services/commit-message/index.ts) is unchanged in this diff and remains an open thread for the author/reviewers to resolve.

Files Reviewed (4 files changed since previous review)
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts

Previous review (commit 7188af1)

Status: 5 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/i18n/no.ts 1637 Garbled Norwegian translation ("AI-generasjonerte begjæringsmeldinger") for the new commit-message language description, rendered in the settings UI
packages/kilo-vscode/webview-ui/src/i18n/ko.ts 1617 Corrupted Korean text ("커AI 메시지") in the new commit-message language description, rendered in the settings UI

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/src/i18n/no.ts 1635 Untranslated English string ("Language") left in the Norwegian bundle
packages/kilo-vscode/webview-ui/src/i18n/es.ts 1663 Inconsistent terminology ("mensajes de compromiso") vs. "commit message" used elsewhere in the same file
packages/kilo-vscode/webview-ui/src/i18n/br.ts 1655 Inconsistent terminology ("mensagens de entrega") vs. "commit message" used elsewhere in the same file
Files Reviewed (25 files changed since previous review, excluding generated SDK/OpenAPI artifacts)
  • packages/kilo-vscode/package.json — new languageCommitMessage setting; enum/enumDescriptions verified aligned
  • packages/kilo-vscode/src/KiloProvider.ts — forwards new setting to webview
  • packages/kilo-vscode/src/services/commit-message/index.ts — now uses getCommitMessageLanguage
  • packages/kilo-vscode/src/services/i18n/index.ts — new getCommitMessageLanguage helper (resolves the previously-flagged bundle-key mismatch is unchanged/still an open discussion on the existing thread, not re-flagged here)
  • packages/kilo-vscode/webview-ui/src/components/settings/CommitMessageTab.tsx — new language selector UI
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts - 1 issue
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts
  • packages/kilo-vscode/webview-ui/src/i18n/da.ts
  • packages/kilo-vscode/webview-ui/src/i18n/de.ts
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts - 1 issue
  • packages/kilo-vscode/webview-ui/src/i18n/fr.ts
  • packages/kilo-vscode/webview-ui/src/i18n/it.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts - 1 issue
  • packages/kilo-vscode/webview-ui/src/i18n/nl.ts
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts - 2 issues
  • packages/kilo-vscode/webview-ui/src/i18n/pl.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts
  • packages/kilo-vscode/webview-ui/src/i18n/tr.ts
  • packages/kilo-vscode/webview-ui/src/i18n/uk.ts
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts

Fix these issues in Kilo Cloud

Previous review (commit 32426eb)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/src/services/commit-message/index.ts 98 Internal i18n bundle keys (br, zht) don't match real language codes/names when forwarded to the LLM prompt
Files Reviewed (7 files, excluding generated SDK/OpenAPI artifacts)
  • .changeset/short-geckos-fry.md
  • packages/kilo-vscode/src/services/commit-message/index.ts - 1 issue
  • packages/opencode/src/kilocode/commit-message/generate.ts
  • packages/opencode/src/kilocode/commit-message/types.ts
  • packages/opencode/src/kilocode/server/httpapi/groups/commit-message.ts
  • packages/opencode/src/kilocode/server/httpapi/handlers/commit-message.ts
  • packages/opencode/test/kilocode/commit-message/generate.test.ts

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5-20260630 · Input: 50 · Output: 15.8K · Cached: 1.8M

Review guidance: REVIEW.md from base branch main

@trim21

trim21 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

(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
@IOLOII

IOLOII commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

trim21

32426eb
Is this okay? @trim21

@trim21

trim21 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

trim21

32426eb 这样可以可还行? @trim21

thanks

"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:",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-generasjonerte is not a real Norwegian word (likely meant AI-genererte, "AI-generated").
  • begjæringsmeldinger means "petition messages", not "commit messages". Elsewhere in this same file, commit message(s) / commit-meldinger is used consistently (see the settings.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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 메시지에 사용할 언어를 선택하십시오.:",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/kilo-vscode/webview-ui/src/i18n/br.ts Outdated
@IOLOII IOLOII changed the title Generate commit messages in the user's selected UI language instead of always using English. feat(commit-message): Generate commit messages in the user's selected UI language instead of always using English. Jul 7, 2026
…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.
@marius-kilocode

Copy link
Copy Markdown
Collaborator

@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?
image

@IOLOII

IOLOII commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@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!

@marius-kilocode

Copy link
Copy Markdown
Collaborator

The format:check CI job was failing on 13 of the 20 locale files — the new settings.commitMessage.language.description key was written in the multi-line form, but prettier expects it on a single line.

I pushed a formatting fix to this branch (style(i18n): fix prettier formatting on commit-message language strings) so CI can go green. For future changes, run bun run format in packages/kilo-vscode/ before pushing to keep formatting consistent.

@marius-kilocode marius-kilocode enabled auto-merge (squash) July 8, 2026 08:10
@marius-kilocode

Copy link
Copy Markdown
Collaborator

@IOLOII your user-centric argument makes sense and your implementation is mostly sound. Let's merge this, thanks!

@IOLOII

IOLOII commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

The format:check CI job was failing on 13 of the 20 locale files — the new settings.commitMessage.language.description key was written in the multi-line form, but prettier expects it on a single line.

I pushed a formatting fix to this branch (style(i18n): fix prettier formatting on commit-message language strings) so CI can go green. For future changes, run bun run format in packages/kilo-vscode/ before pushing to keep formatting consistent.

@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.

@marius-kilocode marius-kilocode merged commit eefd891 into Kilo-Org:main Jul 8, 2026
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants