Skip to content

Create strings.xml for Chinese localization - #294

Merged
jeiel85 merged 2 commits into
jeiel85:mainfrom
ALILEX-1:main
Aug 9, 2026
Merged

Create strings.xml for Chinese localization#294
jeiel85 merged 2 commits into
jeiel85:mainfrom
ALILEX-1:main

Conversation

@ALILEX-1

@ALILEX-1 ALILEX-1 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Add Chinese (Simplified) localization for app strings.

Add Chinese (Simplified) localization for app strings.
The translation itself is complete — 317 strings and 9 plurals, exact key
parity with `values/strings.xml`, every format specifier matching. What
was missing is everything around it, because both translation gates in
this repo take a hard-coded locale list and `values-zh` was in neither.
It would have shipped without any check ever looking at it.

- `ResourceParityTest` gains `values-zh` in the key-parity list.
- `UntranslatedStringTest` gains `"zh"` in `LOCALES` and `"zh" to
  emptySet()` in `LANGUAGE_COINCIDENCES`. Both are needed: the map is
  read with `.getValue()`, so a locale without an entry throws instead
  of failing. `emptySet()` is right — the ten values identical to
  English are exactly `STRUCTURALLY_IDENTICAL`, same as ja and ko.
- Drops `quantity="one"` from all 9 plurals. Chinese has only `other`
  in CLDR, so that item can never be selected; both items carried the
  same text and only the second was ever used. ko and ja, the other
  locales with no plural distinction, already ship `other` only.

`raw-zh/starter_notes.md` is still missing, so a Chinese device falls
back to the English sample notes on first launch. That is a working
fallback, not a break, and `localizedStarterNotesExist` says in a
comment why zh is absent from its list rather than leaving the gap to
look like an oversight.

Verified: ResourceParityTest and UntranslatedStringTest pass with zh
registered; `:app:lintRelease` is green. The one lint warning on the new
file is `TypographyEllipsis` on `search_notes_hint`, which the English
source and values-ja/ko/es/fr all carry too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jeiel85

jeiel85 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Thank you — this is a genuinely careful piece of work, and it holds up to the checks I can actually run:

  • 317 strings and 9 plurals, exact key parity with values/strings.xml. Nothing missing, nothing extra.
  • Every format specifier matches — all positional (%1$s, %1$d, %2$d, %3$d) arguments line up with the source on all 21 formatted strings.
  • \n escapes preserved on every multi-line string.
  • The right things were left untranslated — app name, URLs, Apache License 2.0, Material You, tag_result_format. That is exactly the set the other five locales leave alone, and getting it wrong in either direction is the usual way a translation PR breaks something.
  • You carried over the explanatory comments from the source file (the archive noun-vs-verb note, the elapsed_* note). That is the tell that you read the file rather than fed it through a machine.

Rather than send you back and forth over repo plumbing you have no reason to know about, I pushed a follow-up commit to this branch. Three things, all of them our side of the fence:

  1. Registered zh in the two translation gates. This repo checks translations with ResourceParityTest and UntranslatedStringTest, and both take a hard-coded locale list — so values-zh would have shipped without either of them ever looking at it. That is our design, not something a contributor should have to discover.
  2. Dropped quantity="one" from the 9 plurals. Chinese has only other in CLDR, so that item can never be selected; values-ko and values-ja ship other only for the same reason.
  3. Kept the directory as values-zh. Worth naming since it is a real fork in the road: values-zh is a language-level match, so Traditional locales (zh-Hant-TW, zh-Hant-HK) get your Simplified text rather than falling back to English. I decided that is the better default — a partially-understood UI beats an English one, and a zh-Hant locale can be added later without moving this file. If you meant it strictly as Simplified-only, say so and I will rename it.

Verified before pushing: both gate tests pass with zh registered, and :app:lintRelease is green. The one lint warning on your file is TypographyEllipsis on search_notes_hint — the English source and values-ja/ko/es/fr all carry the same one, so you matched the house style exactly.

One thing left, if you are willing

app/src/main/res/raw-<locale>/starter_notes.md holds the six sample notes a user sees on first launch. There is no raw-zh yet, so a Chinese device falls back to the English ones. That works, so it is not blocking this PR — but it is the first screen anyone sees, and it is 136 lines of actual prose rather than UI labels. I would rather not write it myself: I can diff a file and count keys, but I cannot tell whether the sentences sound like something a person would write, which is the entire value of what you contributed here.

If you would like to take it, a separate PR is perfect. If not, that is completely fine — say so and I will find another way.

The public side of Chinese support — landing page, privacy policy, README — is in #295, waiting on this one. You are credited in THANKS.md there.

@jeiel85
jeiel85 merged commit 06454cd into jeiel85:main Aug 9, 2026
5 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