Skip to content

Add Simplified Chinese (zh-CN) locale - #1

Merged
maxib0n merged 1 commit into
maxib0n:nextfrom
YNM9000:zh-cn-i18n
Nov 6, 2026
Merged

maxib0n merged 1 commit into
maxib0n:nextfrom
YNM9000:zh-cn-i18n

Conversation

@YNM9000

@YNM9000 YNM9000 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What

Adds Simplified Chinese (zh-CN) as a third UI language, alongside Italian and English. The default locale stays it and no functional behaviour changes.

Why

NiceDB currently ships only Italian and English. This adds a complete Simplified Chinese translation so Chinese-speaking DBAs can use the whole interface. All strings were translated against a fixed glossary for database terminology (schema, row, transaction, ...).

Changes

New translation

  • app/ui/messages/zh-CN.json — all 3,071 message keys translated (3,058 strings, 12 ICU plural structures, $schema). Key set, key order, {placeholder} names and ICU match branches are preserved exactly, verified by a merge/validation script (PROBLEMS=0).

Locale wiring

  • app/ui/project.inlang/settings.json — add zh-CN to locales.
  • app/ui/src/lib/appearance.svelte.ts — add zh-CN to LOCALES.
  • app/ui/src/lib/appearance-names.ts — display name 简体中文.
  • app/ui/src/lib/bindings.ts — widen the generated Locale union to "it" | "en" | "zh-CN".
  • crates/nd-store/src/settings.rs — add ZhCn with #[serde(rename = "zh-CN")] to the Rust Locale enum. Required: appearance_set deserializes Appearance via serde, so without this the new locale would be rejected and the setting would silently revert.
  • app/ui/src/lib/prefs.ts — type CellStyle.locale / showNumber() with Locale instead of 'it' | 'en'; otherwise Grid.svelte fails type checking. No logic change (Chinese follows the existing en branch).
  • app/ui/src/lib/manual.svelte.ts — langOf() was === 'en' ? 'en' : 'it', which would show the Italian manual to Chinese users; now any non-Italian locale falls back to English.

No CI or build workflow is included in this PR.

Checks (per CONTRIBUTING.md)

Check Result
pnpm -C app/ui check 0 errors / 0 warnings via pnpm exec svelte-check --tsconfig ./tsconfig.json --fail-on-warnings (the wrapper's >/dev/null fails on Windows cmd)
pnpm -C app/ui build passed
node scripts/licenses.mjs --check passed (no new dependencies)
pnpm i18n regenerates paraglide with it / en / zh-CN for every message
cargo fmt --all --check, cargo clippy ... -D warnings not run locally (no Rust toolchain on this machine); a full cargo build --release of the same Rust changes passed on windows-latest
real-machine run switched to 简体中文 in Settings, UI rendered correctly, and settings.appearance.locale persisted as zh-CN in SQLite

Happy to fix anything the CI flags.

Notes

  • No new visible strings were added to en.json / it.json, so the rule about adding strings to both files does not apply here. The language label 简体中文 sits in appearance-names.ts next to the existing hard-coded Italiano / English labels, matching the surrounding code.
  • The in-app manual still ships only it / en; Chinese users currently get the English manual. Translating the manual is a separate, much larger effort.
  • Date/number formatting still uses the existing it-IT / en-GB branches, so Chinese follows English-style formatting. Left unchanged to keep this PR language-only.
  • CONTRIBUTING.md suggests opening an issue before changes larger than a fix. I went straight to a PR because the diff is purely additive and easy to review here; if you would rather discuss it in an issue first, I am happy to close this and open one.

By contributing I agree to the GPL-3.0-or-later terms described in CONTRIBUTING.md.

@maxib0n

maxib0n commented Nov 6, 2026

Copy link
Copy Markdown
Owner

@YNM9000 Thanks a lot for this, it’s a great first contribution! The translation is thorough and the langOf fix for the manual is a good catch.

The public repo only receives release commits, so I’m merging this into a next branch first. It will land on main with the next release (0.2.2), with your commits and authorship kept, and you’ll be credited in the changelog.

One follow-up on my side: missing Chinese strings should fall back to English rather than Italian, I’ll handle that.

@maxib0n
maxib0n changed the base branch from main to next November 6, 2026 09:38
@maxib0n
maxib0n merged commit 9db923d into maxib0n:next Nov 6, 2026
@YNM9000
YNM9000 deleted the zh-cn-i18n branch November 7, 2026 00:40
@YNM9000

YNM9000 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@maxib0n Thank you for building NiceDB and releasing it under the GPL. I also appreciate how quickly you merged my PR — seeing the Simplified Chinese translation land in 0.2.2 the same evening, with my authorship kept and credit in the changelog, was such a nice surprise for a first contribution.

Best regards

@maxib0n

maxib0n commented Nov 7, 2026

Copy link
Copy Markdown
Owner

@YNM9000 Thank you, that means a lot! Your translation was the first outside contribution to NiceDB, so it was an easy one to celebrate.

A heads-up: 0.3.0 just came out with quite a few new features (grid improvements, plan history, the write-log restore, a CLI and more), and I translated the ~110 new Chinese strings as a best effort. If you have time to look them over, any corrections are very welcome, as a PR to the next branch like before. No pressure at all.

Thanks again 🙂

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