fix(i18n): use ASCII colon and space in zh_CN/zh_TW commit examples#572
Open
vlaw wants to merge 1 commit into
Open
fix(i18n): use ASCII colon and space in zh_CN/zh_TW commit examples#572vlaw wants to merge 1 commit into
vlaw wants to merge 1 commit into
Conversation
The Chinese (Simplified and Traditional) few-shot examples in src/i18n/zh_CN.json and src/i18n/zh_TW.json used a fullwidth colon (U+FF1A) between the conventional-commit type/scope and the subject. All 13 other locales use an ASCII colon plus a space. The fullwidth form is inconsistent with the conventional commit spec, so when zh_CN or zh_TW is selected the LLM tends to mirror it and emits non-conforming commit headers (e.g. `fix:xxx` or `fix(server.ts):xxx`). That breaks downstream tooling such as commitlint, semantic-release, release-please and changesets. Replace the fullwidth colon with ': ' in the four commit example strings of each file. Type names (e.g. 修正/功能) are left untouched to keep this change minimal and focused on the format regression.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The
commitFix/commitFeat/commitFixOmitScope/commitFeatOmitScopefew-shot examples in the Simplified and Traditional Chinese locales use a fullwidth colon (U+FF1A) between the type/scope and the subject. All 13 other locales use an ASCII colon plus a space.fix:(ASCII)fix(server.ts):…(fullwidth)修正(server.ts):…(fullwidth)Problem
The fullwidth form is not valid in the Conventional Commits spec, which requires an ASCII
:followed by a space. When the user selectszh_CNorzh_TW, the LLM tends to mirror the example and produces non-conforming headers such as:That breaks downstream tooling that parses commit headers:
@commitlintrules (type-enum,header-format)semantic-release,release-please,changesetsChange
Replace
:with:(ASCII colon + single space) in the four commit example strings of each file. Type names (修正/功能) are intentionally left untouched to keep the change minimal and scoped to the format regression — translating type names is a separate design discussion.Test plan
python3 -m json.tooland anodeparsebuildstep isnpx rimraf out && node esbuild.config.js; this PR only touches i18n strings, no TS changes, sotsc --noEmitis unaffected)ocowithOCO_LANGUAGE=zh_CNandOCO_LANGUAGE=zh_TWand confirm generated commit headers usefix:/feat:form