Skip to content

fix(i18n): use ASCII colon and space in zh_CN/zh_TW commit examples#572

Open
vlaw wants to merge 1 commit into
di-sukharev:masterfrom
vlaw:fix/i18n-zh-colon-format
Open

fix(i18n): use ASCII colon and space in zh_CN/zh_TW commit examples#572
vlaw wants to merge 1 commit into
di-sukharev:masterfrom
vlaw:fix/i18n-zh-colon-format

Conversation

@vlaw

@vlaw vlaw commented Jul 6, 2026

Copy link
Copy Markdown

Summary

The commitFix/commitFeat/commitFixOmitScope/commitFeatOmitScope few-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.

Locale Header separator
en, de, fr, it, es_ES, pt_br, nl, ru, pl, cs, sv, ja, ko, vi_VN, th, tr, id_ID fix: (ASCII)
zh_CN fix(server.ts):… (fullwidth)
zh_TW 修正(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 selects zh_CN or zh_TW, the LLM tends to mirror the example and produces non-conforming headers such as:

fix(server.ts):将端口变量…
修正:將端口變數…

That breaks downstream tooling that parses commit headers:

  • @commitlint rules (type-enum, header-format)
  • semantic-release, release-please, changesets
  • any other conventional-commit-aware automation

Change

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

  • JSON validity verified with python3 -m json.tool and a node parse
  • CI passes (the build step is npx rimraf out && node esbuild.config.js; this PR only touches i18n strings, no TS changes, so tsc --noEmit is unaffected)
  • Manual: run oco with OCO_LANGUAGE=zh_CN and OCO_LANGUAGE=zh_TW and confirm generated commit headers use fix: / feat: form

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

1 participant