Skip to content

Add Simplified Chinese (zh-rCN) translations - #49

Open
Llhhy1 wants to merge 1 commit into
NightMean:mainfrom
Llhhy1:i18n-zh-rCN
Open

Llhhy1 wants to merge 1 commit into
NightMean:mainfrom
Llhhy1:i18n-zh-rCN

Conversation

@Llhhy1

@Llhhy1 Llhhy1 commented Sep 24, 2026 •

Copy link
Copy Markdown

Proposed change

Adds Simplified Chinese (values-zh-rCN) translations.

  • values-zh-rCN/strings.xml — 879 strings + 7 plurals as a pure overlay. English remains the default locale, so no behavior change for existing users. Android 13+ gets a per-app language entry automatically from the resource table; Android 12 follows the system locale. No Kotlin UI code or manifest changes were needed.
  • values/strings.xml — removed translatable="false" from the 618 user-facing strings that are now translated, and added four unit_* labels. No existing text was modified: the diff on existing lines is attribute removals only. Those strings are rendered in the Settings cards, dialogs and log rows, so the flag looked like leftover from the original sample project; keeping it produces 618 Untranslatable warnings once a locale folder exists, and it keeps the strings invisible to translation tooling.
  • SettingRenderers.kt (6 lines) — the duration dropdowns used their stored logic key as the visible label, so 检查频率 rendered days in every language. Labels now come from unit_seconds/minutes/hours/days; the persisted value and the toBaseUnit/fromBaseUnit converters are untouched, so existing preferences keep working.
  • Per-flavor values-zh-rCN with app_label so MissingTranslation stays clean for the dev/beta/stable source sets.
  • Left in English on purpose (31 entries): brand names, unit formats (%1$dms, t/s), sampler parameter names (temperature, top_p, top_k, max_tokens, which mirror the API fields), and input placeholders (hf_…, 8000, IP/CIDR examples).

String names, format placeholders and \n / \u0020 escapes are asserted identical to values/strings.xml by script, so nothing drifts and the concatenated log fragments (logs_event_*) keep their surrounding spaces.

Verification

  • ./gradlew :app:lintStableDebug → 0 errors, 46 warnings — identical to the baseline without the locale folder.
  • aapt2 dump resources on the built APK → default config still Start Server, zh-rCN config returns 启动服务器.
  • Installed on a real arm64 phone and reviewed screen by screen (that is how the days dropdown bug surfaced).

Process: translations were drafted with AI assistance, then reviewed entry by entry against the running app.

Screenshots

Settings in ChineseStatus in ChineseModels in Chinese
SettingsStatusModels

Images are hosted from a zh-screenshots branch of my fork so they stay out of this diff.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements or tests
  • Dependency upgrade
  • Documentation

Additional information

Checklist

  • The code compiles without errors (./gradlew :app:compileStableDebugKotlin)
  • The change is tested and works locally on a real device or emulator
  • No new warnings from ./gradlew lint
  • There is no commented out code in this PR
  • Existing functionality is not broken

- values-zh-rCN overlay: 879 strings + 7 plurals, English stays the default
- drop translatable="false" on the 618 user-facing strings that are now
  translated; text of existing entries is untouched
- localize the duration-unit dropdown labels (the stored values remain the
  seconds/minutes/hours/days logic keys the converters match on)
Llhhy1 added a commit to Llhhy1/OlliteRT that referenced this pull request Sep 24, 2026
Llhhy1 added a commit to Llhhy1/OlliteRT that referenced this pull request Sep 24, 2026
@Llhhy1

Llhhy1 commented Sep 27, 2026

Copy link
Copy Markdown
Author

Friendly nudge — no rush at all, I know this is a solo side project.

Two things I can do to make review easier whenever you get to it:

  1. Split it up: (a) values-zh-rCN overlay + per-flavor app_label, (b) the translatable="false" removals, (c) the 6-line unit-dropdown label fix — three small PRs instead of one.
  2. Shrink it: drop the translatable="false" removals entirely and ship a locale covering only the ~270 currently-translatable strings. Smaller diff, but the Settings screen would stay partly English.

Also FYI: CI hasn't run yet, presumably because workflow runs need approval for a first-time contributor's fork PR. And I'm happy to rebase if main moves ahead.

Whatever you prefer — including "not right now". Thanks for the app either way.

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.

Add Simplified Chinese (zh-Hans) locale?

1 participant