Repository navigation
feat(ui): use a rounded CJK font and check message keys - #40
Merged
nekomeowww merged 2 commits intoOct 21, 2026
Merged
Conversation
`t()` accepts any string, so vue-tsc does not catch a misspelled key; it shows the key at runtime. `i18n/keys.test.ts` reads the viewer sources and checks every literal key, `keypath`, and template prefix against the en messages. Also: - zh-Hans says 执行成功率 for the completion rate on the compare and matrix views too (they said 完成率) - remove `countOf` from `format.ts`; nothing calls it after the translation - AGENTS.md: point floating-surface examples to `PreferencesMenu.vue`, and add the rule that viewer text goes through vue-i18n Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quicksand is rounded and has no CJK glyphs; Noto Sans SC beside it read as a different typeface. Resource Han Rounded SC 1.910 (Cyano Hao, SIL OFL 1.1) is a rounded Source Han Sans: - self-hosted as 101 unicode-range WOFF2 slices (about 19 MB) in `client/src/assets/fonts/resource-han-rounded-sc`, loaded per slice like Fontsource, with its OFL license - `scripts/buildCjkFont.py` rebuilds the slices from the release's `ResourceHanRoundedSC-VF.otf`; it shifts the weight axis down by 50, so the viewer's 400 / 500 / 600 draw the font's 450 / 550 / 650 and Chinese text is as dark as the Latin text beside it - replaces `@fontsource-variable/noto-sans-sc` Preferences gets an Appearance group label above Language, and the language trigger is compact (`text-xs`), so its value reads at the size of its label. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Stacked on #39. Review and merge #39 first; this PR's base is
nekomeowww/feat/viewer-i18n.Problem
t()takes any string, so vue-tsc does not catch a misspelled message key. It shows the raw key at runtime.Result
Comparison:
0bf23b4(head of #39) →5a2fd40(head revision ofnekomeowww/feat/viewer-cjk-font). Two commits.38edb53test(ui): check that every message key the viewer passes existsclient/src/i18n/keys.test.tsreads the viewer sources withimport.meta.glob(…, { query: '?raw' }). It checks every literalt('…')key, everykeypath="…", and every template prefix (t(`states.${…}`)) against the en messages.CompareMenu.vuemakes the test fail and name the file and key.countOfis removed fromformat.ts; nothing calls it.AGENTS.md:PreferencesMenu.vue.5a2fd40feat(ui): use a rounded CJK font and group the language under Appearance@fontsource-variable/noto-sans-sc.client/src/assets/fonts/resource-han-rounded-sc, with itsLICENSE.scripts/buildCjkFont.pyrebuilds the slices from the release'sResourceHanRoundedSC-VF.otf(137 MB; not committed).RONDaxis stays variable at its default, 100. Pinning it withfontTools.varLib.instancerfails on this font withInconsistentGlyphOrder. The script's header documents both points.text-xs), so its value reads at the size of its label.The 19 MB of binary fonts go into git. Moving them to Git LFS is a possible follow-up.
CLI changes
No CLI changes.
Report file and viewer API changes
No report file or viewer API changes.
Dependency removed:
@fontsource-variable/noto-sans-sc. The built@vieval/uigrows by about 15 MB net (19 MB of slices in, 4.5 MB of Noto Sans SC out).Validation
At
5a2fd40:pnpm typecheckpasses, andpnpm exec eslint packages/uiis clean.keys.test.ts.pnpm -F @vieval/ui buildpasses, and the 101 slices are indist/client/assets.document.fontsreports the Resource Han Rounded SC slices as loaded, and Chinese text renders with them.🤖 Generated with Claude Code