Skip to content

fix(i18n): exclude unused plural forms from language pack coverage - #120

Merged
brkfun merged 1 commit into
BRF-Tech:mainfrom
chengjie:fix/language-pack-plural-coverage
Oct 17, 2026
Merged

brkfun merged 1 commit into
BRF-Tech:mainfrom
chengjie:fix/language-pack-plural-coverage

Conversation

@chengjie

Copy link
Copy Markdown
Contributor

What & why

A complete Chinese or Japanese language pack can be reported as partially translated because LanguageRows counts English plural forms that the target locale never selects. For a catalogue containing files and files_one, Chinese needs only files, but currently reports 50% coverage. This also explains why a complete Chinese pack can show 97% in the store dry-run while passing the locale-aware completeness validator.

Use the existing srvtext.Categories CLDR rules to exclude inapplicable catalogue plural forms from both Total and Translated. A suffix is treated as a plural form only when its base key is also in the catalogue, so standalone keys such as standalone_one remain required. Shipped key counts, unknown-key handling, blank-value handling and percentage rounding are preserved. English still requires its singular forms, and shipping unnecessary singular translations cannot inflate coverage.

Type

  • Bug fix
  • Feature
  • Docs
  • Refactor / chore

Checklist

  • Backend: cd backend && go build ./... && go vet ./... && go test -timeout 30m ./... passes
  • Frontend (if touched): pnpm -C packages/core typecheck and the relevant build pass
  • Added/updated tests for the change where it makes sense
  • Updated docs (docs/, README.md) and CHANGELOG.md if user-facing
  • No secrets, credentials or environment-specific hostnames added

Notes for reviewers

  • Added regression tests for Chinese, zh-Hans-CN, Japanese, English and Russian, including missing real translations, redundant forms and orphan suffix keys.
  • Confirmed the new regression tests fail against unchanged upstream main and pass with this fix.
  • go test ./internal/wasmplugin ./internal/srvtext -count=1 -timeout=5m passes. The full backend build/vet/test suite was not run; frontend code is unchanged.
  • The store validator will need to use a build containing this fix before its displayed coverage changes.

@brkfun

brkfun commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Thanks a lot, @chengjie! This is in and ships with filex 0.57.0.

It also takes care of the coverage number the store showed for your pack while we were sorting out #118: once the store's checker runs on 0.57, a complete Chinese pack shows 100%.

And your Chinese language pack is approved and listed in the store now. Thank you for translating filex, and for the careful reports along the way.

@brkfun
brkfun merged commit cbc86f8 into BRF-Tech:main Oct 17, 2026
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