-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(commit-message): Generate commit messages in the user's selected UI language instead of always using English. #11994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
32426eb
feat(commit-message): add language parameter to commit message genera…
IOLOII 7188af1
feat(commit-message): add configurable language setting for AI-genera…
IOLOII 05b0303
refactor(locale): standardize commit message terminology across local…
IOLOII f61c502
style(i18n): fix prettier formatting on commit-message language strings
marius-kilocode 10350b9
Merge branch 'main' into main
marius-kilocode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "kilo-code": patch | ||
| "@kilocode/cli": patch | ||
| --- | ||
|
|
||
| Generate commit messages in the user's selected UI language instead of always using English. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 intolanguageInstruction()'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 itto have Kilo Code address this issue.There was a problem hiding this comment.
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?