Skip to content

feat(i18n): hold zh-CN to Chinese typography - #1673

Merged
MBombeck merged 6 commits into
MBombeck:release/v1.50.0from
Remedy233:feat/150-zh-typography
Nov 30, 2026
Merged

MBombeck merged 6 commits into
MBombeck:release/v1.50.0from
Remedy233:feat/150-zh-typography

Conversation

@Remedy233

Copy link
Copy Markdown

What this does

Adds the zh-CN typography rules from #1528 as a guard, and the pass over the
bundle that makes it green. This is the piece the maintainer asked for in the
#1664 review:

A small zh-CN-only guard next to src/__tests__/i18n-typography-glyphs.test.ts
(……, 、 in lists, no space before a measure word, 「」 and 『』 exempt),
plus the pass over the bundle that makes it green.

The rules, and why each one is zh-CN-scoped

A rule about Chinese measure words says nothing useful about German or Korean,
so the guard reads one bundle rather than adding a fifth opinion to a guard that
already holds every language to a shared floor.

1. No space before a measure word. A number and the word counting it are one
word in Chinese: 3天, not 3 天. The count reaches the value three ways and
all three are checked — a placeholder ({count} 条), an ICU plural body's #
({count, plural, other {# 条测量}}), and digits (至少 12 个字符).

2. The ellipsis is full. ……, not a lone …. A single one reads as a
trailing fragment in Chinese typesetting; the pair is the mark.

3. Lists use 、. A half-width comma between two Han characters is the
shape a machine translation leaves behind. No value had one, so this rule guards
against regression rather than fixing anything — which is worth having, because
it is the rule a future translator is most likely to break.

4. 「」 and 『』 are exempt. They are the Chinese quote marks. The glyph
guard's ban on dashes and middle dots has nothing to say about them, and the
exemption is written into the test so nobody "corrects" them to “”.

The pass over the bundle

Rule Findings Now
space before a measure word 1190 0
lone … 3 0
half-width comma between Han characters 0 0

The measure-word findings, by word: 天 237, 个 97, 条 80, 次 74, 小时 56,
分钟 35, 周 20, 份 19, 月 13, 年 12, 步 9, 岁 7, 秒 4, 片 1.

Latin units keep their space. 82 kg, 120 mmHg, 10 mg/dL and 5 % are
untouched, because a space there is correct. The test asserts that too, so the
guard cannot be "improved" into stripping them.

One thing that moved with the bundle

The snooze glossary concept anchored on 稍后提醒我({minutes} 分钟). After
the pass the bundle reads 稍后提醒我({minutes}分钟), so the glossary term
moved with it — the glossary guard fails when the two disagree, which is how
this was caught.

Checks

  • the new guard, i18n-zh-typography: 11/11
  • glossary-guard: 114/114
  • the rest of the i18n family, all green: type and glyphs, count plural, English
    leak, dose vocabulary, drift, title sentence case, boot catalogs, reverse
    coverage, call-site coverage
  • tsc --noEmit: clean

Base

Based on feat/150-zh-cn-locale (#1664), because the bundle this guard reads
only exists there. Once #1664 lands on release/v1.50.0 this retargets to it and
the diff becomes the guard, the bundle pass and the glossary term — nothing else.

Refs #1528.

The rules from MBombeck#1528, as a guard rather than a convention, alongside the pass
over the bundle that makes it green.

Four rules, all scoped to `zh-CN.json`:

- **No space before a measure word.** A number and the word counting it are one
  word in Chinese: `3天`, not `3 天`. The count arrives three ways — a
  placeholder (`{count}`), an ICU plural body's `#`, or digits — and all
  three are checked.
- **The ellipsis is full.** `……`, not a lone `…`, which reads as a trailing
  fragment in Chinese typesetting.
- **Lists use `、`**, not a half-width comma between two Han characters.
- **`「」` and `『』` are exempt.** The glyph guard's ban on dashes and middle
  dots has nothing to say about them, and the exemption is written down so
  nobody corrects them to `“”`.

The bundle pass removed **1190** spaces before measure words and turned **3**
lone ellipses into `……`. No value had a half-width comma between Han
characters, so that rule guards against regression rather than fixing anything.

Latin units keep their space: `82 kg`, `120 mmHg`, `10 mg/dL` and `5 %`
are untouched, because a space there is correct. The test says so, so a later
reader cannot "fix" the guard into stripping those too.

One glossary term moved with the bundle: the `snooze` concept anchored on
`稍后提醒我({minutes} 分钟)` and now matches `稍后提醒我({minutes}分钟)`.

Verified: the new guard 11/11, the glossary guard 114/114, and the i18n family
(type-glyphs, count-plural, english-leak, dose-vocabulary, drift, title-case,
boot catalogs, reverse and call-site coverage) green.
MBombeck and others added 5 commits November 28, 2026 21:17
Resolve the zh-CN conflict: keep the zh-CN wording from this branch, take
the keys release added or removed, and apply the measure-word spacing rule
to the new score-page and imaging strings.
@MBombeck
MBombeck merged commit a1643d9 into MBombeck:release/v1.50.0 Nov 30, 2026
41 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.

2 participants