Repository navigation
Add Simplified Chinese (zh-CN) locale - #1
Conversation
|
@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 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 |
|
@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 🙂 |
What
Adds Simplified Chinese (
zh-CN) as a third UI language, alongside Italian and English. The default locale staysitand 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 ICUmatchbranches are preserved exactly, verified by a merge/validation script (PROBLEMS=0).Locale wiring
app/ui/project.inlang/settings.json— addzh-CNtolocales.app/ui/src/lib/appearance.svelte.ts— addzh-CNtoLOCALES.app/ui/src/lib/appearance-names.ts— display name简体中文.app/ui/src/lib/bindings.ts— widen the generatedLocaleunion to"it" | "en" | "zh-CN".crates/nd-store/src/settings.rs— addZhCnwith#[serde(rename = "zh-CN")]to the RustLocaleenum. Required:appearance_setdeserializesAppearancevia serde, so without this the new locale would be rejected and the setting would silently revert.app/ui/src/lib/prefs.ts— typeCellStyle.locale/showNumber()withLocaleinstead of'it' | 'en'; otherwiseGrid.sveltefails type checking. No logic change (Chinese follows the existingenbranch).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)pnpm -C app/ui checkpnpm exec svelte-check --tsconfig ./tsconfig.json --fail-on-warnings(the wrapper's>/dev/nullfails on Windows cmd)pnpm -C app/ui buildnode scripts/licenses.mjs --checkpnpm i18nit/en/zh-CNfor every messagecargo fmt --all --check,cargo clippy ... -D warningscargo build --releaseof the same Rust changes passed onwindows-latestsettings.appearance.localepersisted aszh-CNin SQLiteHappy to fix anything the CI flags.
Notes
en.json/it.json, so the rule about adding strings to both files does not apply here. The language label简体中文sits inappearance-names.tsnext to the existing hard-codedItaliano/Englishlabels, matching the surrounding code.it/en; Chinese users currently get the English manual. Translating the manual is a separate, much larger effort.it-IT/en-GBbranches, so Chinese follows English-style formatting. Left unchanged to keep this PR language-only.CONTRIBUTING.mdsuggests 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.