Skip to content

feat(i18n): add Settings language foundation with English source catalogs - #226

Merged
MiaAI-Lab merged 2 commits into
MiaAI-Lab:mainfrom
oscarlius:codex/i18n-foundation-20261016
Oct 24, 2026
Merged

MiaAI-Lab merged 2 commits into
MiaAI-Lab:mainfrom
oscarlius:codex/i18n-foundation-20261016

Conversation

@oscarlius

@oscarlius oscarlius commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Settings now switches immediately between English and 简体中文, remembers the browser-local preference and updates HTML language while preserving pending edits. This follows the maintainer's foundation decision: one i18next/react-i18next instance, per-namespace English source/fallback JSON, a missing-source-key gate at the start of npm test, and one translated page.

Scope is Settings and its embedded browser-alert controls. Other pages, navigation, the separate Alerts dialog and raw server diagnostics remain English. Plain interpolation and ordinary plurals are used; there is no ICU plugin, intl-messageformat or server/API change. This branch started from official main 3e6d4ef; #194 remains the unchanged integration reference.

Contributor instructions and browser acceptance steps are in README → Interface language. CODEBASE.md and docs/i18n.md are absent from the PR's final tree, shared .gitignore matches the starting main, and CHANGELOG credits @oscarlius (#226). The net PR is 19 files.

Dependencies and checker

  • Exact direct pins: i18next@26.4.2 (published 2026-09-03) and react-i18next@17.0.15 (2026-09-21), both older than two weeks at initial submission. Primary registry metadata: i18next, react-i18next.
  • The committed lockfile adds only those two plus @babel/runtime@7.29.7, html-parse-stringify@4.0.1 and use-sync-external-store@1.7.0. A scoped override pins the reviewed Babel runtime; no existing package resolution changes.
  • The AST gate checks wired keys and rejects missing English source keys/catalogs, duplicate keys, orphan Chinese keys, parameter mismatches, dynamic/ambiguous calls and inline defaults. It does not claim whole-product translation coverage. Per-call { ns }, <Trans> coverage and the current transitive rolldown/parseAst dependency remain the optional follow-ups identified in review; the README records these limits.

Validation

Current head: a72bd3462e8b00e5137df42aff71a66abe967b47. The review follow-up changes documentation and Git tracking only; src/, server/, scripts/, package.json and the lockfile are identical to f4c4c3e.

Fresh checks on 2026-10-17, Node 22.23.2:

  • Windows frontend: 100 files / 802 tests passed, checker fixtures 11/11, source-catalog gate, typecheck and production build passed.
  • Linux native npm test: catalog fixtures 11/11, server 1060/1060 (zero skips) and frontend 100 files / 802 tests passed. Typecheck and production build also passed. Tests ran as a normal user with genuine Python 3.11/zsh in a private mount namespace; host tools were unchanged.
  • git diff --check passed. The two ignored document paths and .gitignore are absent from the net changed-file list.

The initial f4c4c3e validation also passed clean installs on Windows/Linux and 11 browser fixture checks on each platform (desktop/phone switching, reload persistence, no overflow/exposed keys, preserved pending settings and synthetic save). Browser checks were not repeated for this documentation-only follow-up. The existing production chunk-size warning remains. Earlier container validation exposed a timing race in unchanged LLM log draining; this PR does not repair that service-side issue.

Reproduce with supported Node, Python 3.11+, Git and zsh on Linux: npm ci, npm test, npm run typecheck, npm run build. Windows runs the frontend and catalog gates. No production deployment or live device/model operation was performed. Dependency approval and merging remain with the maintainer.

…logs

Start a small foundation from official main following the maintainer decision on MiaAI-Lab#194. Use one i18next/react-i18next loader, browser-local language switching, and source-catalog checks in npm test.

Constraint: Settings only; no ICU, server recognizer, or changes to MiaAI-Lab#194

Confidence: high

Scope-risk: narrow
@MiaAI-Lab

Copy link
Copy Markdown
Owner

Thanks, this follows the direction posted on #194/#200 closely: exact pins for i18next 26.4.2 and react-i18next 17.0.15 (both older than two weeks), a lockfile that adds only three small transitive packages from registry.npmjs.org with integrity hashes, per-namespace English source catalogs, and a key check that runs first in npm test. At f4c4c3e it builds, typechecks and passes the full suite here (server 1059/1060 with no failures, frontend 802/802), the Settings save payload is unchanged, and no secrets, auth or network code is touched. It adds dependencies, so it waits for the maintainer's confirmation before merging. Please fix before then: (1) remove CODEBASE.md and docs/i18n.md from the PR, because main's .gitignore:28,31 ignores docs/ and CODEBASE.md (they were force-added, and a new CODEBASE.md stub would clash with the existing local one); put the contributor notes in a tracked file such as docs/ allow-listed explicitly or in the README. (2) Drop the unrelated .omx/ line from .gitignore. (3) Credit the commit author in the CHANGELOG entry (CHANGELOG.md:13). Optional follow-ups: scripts/i18n-check.mjs does not check t("key", { ns }) or <Trans>, and it imports rolldown/parseAst, which is only a transitive dependency of vite. Leaving it open.

(Review notes prepared with Claude Code on behalf of the maintainer.)

Move the language contributor notes into README, stop tracking the two
ignored documentation paths, restore the shared ignore rules and credit
the original author in CHANGELOG.

Constraint: Address the three required PR 226 changes; preserve PR 194
Confidence: high
Scope-risk: narrow
@oscarlius

Copy link
Copy Markdown
Contributor Author

Thank you for the review. Addressed all three required points in a72bd34:

  1. Removed CODEBASE.md and docs/i18n.md from the tracked tree and moved the language/contributor guidance into README → Interface language.
  2. Removed the .omx/ addition; shared .gitignore now matches the starting main exactly.
  3. Added Thanks to @oscarlius (#226) to the language CHANGELOG entry.

The follow-up changes only documentation/tracking. Runtime code, dependencies and tests are unchanged. Fresh Windows checks passed: frontend 802/802, catalog fixtures 11/11, source-catalog gate, typecheck and build. Fresh native Linux npm test passed: catalog fixtures 11/11, server 1060/1060 with zero skips, frontend 802/802; typecheck and build also passed. git diff --check is clean. The existing build chunk-size warning remains.

The optional { ns } / <Trans> checker coverage and transitive parser dependency remain follow-ups; their current limitations are documented in the README. The original integration PR and its branch are untouched. This remains awaiting your dependency confirmation before merge.

MiaAI-Lab pushed a commit that referenced this pull request Oct 18, 2026
Identify Strata before its llama.cpp compatibility shim and map native JSON
rates with explicit concurrency, activity and idle semantics in both cards.

Constraint: Keep Strata support independent of PR #226.
Confidence: high
Scope-risk: narrow
(cherry picked from commit f715743)
@MiaAI-Lab

Copy link
Copy Markdown
Owner

Re-checked at a72bd34. The three requested changes are in (CODEBASE.md and docs/i18n.md removed with the notes moved to README → Interface language, the .omx/ line dropped, the CHANGELOG credit added); the delta since f4c4c3e is documentation only and it still merges cleanly with main. It adds i18next 26.4.2 and react-i18next 17.0.15 with a lockfile, and adding dependencies is a maintainer decision, so it is not merged by this review pass. Still open as optional follow-ups: scripts/i18n-check.mjs does not check t("key", { ns }) or <Trans>, and it imports rolldown/parseAst, which is only a transitive dependency of vite. Leaving it open for the maintainer's dependency confirmation.

(Review notes prepared with Claude Code on behalf of the maintainer.)

@MiaAI-Lab

MiaAI-Lab commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Status at a72bd34: the review points are addressed and the change is documentation-only since f4c4c3e, but the PR now conflicts with main in CHANGELOG.md and package.json (the test and test:server scripts, whose server glob gained server/prices/ with #231). It adds the dependencies i18next 26.4.2 and react-i18next 17.0.15 with a lockfile, and adding dependencies is a maintainer decision, so it is not merged by this pass. Once that is confirmed, please rebase on main; the optional follow-ups ({ ns }/<Trans> coverage in scripts/i18n-check.mjs, and its import of rolldown/parseAst, a transitive dependency of vite) can follow. Leaving it open for the maintainer's dependency confirmation.

(Review notes prepared with Claude Code on behalf of the maintainer.)

@MiaAI-Lab

Copy link
Copy Markdown
Owner

Status at a72bd34: the review points are addressed and the change is documentation-only since f4c4c3e, but it now conflicts with main (448944c) in CHANGELOG.md and package.json. It adds i18next 26.4.2 and react-i18next 17.0.15 with a lockfile, and adding dependencies is a maintainer decision, so it is not merged in this pass. Once that is confirmed, please rebase; the optional follow-ups ({ ns } and <Trans> coverage in scripts/i18n-check.mjs, and its import of rolldown/parseAst, a transitive dependency of vite) can follow. Leaving it open for the maintainer's dependency confirmation.

(Review notes prepared with Claude Code on behalf of the maintainer.)

@oscarlius

Copy link
Copy Markdown
Contributor Author

Thanks for the follow-up. Could you please confirm whether adding the pinned dependencies i18next@26.4.2 and react-i18next@17.0.15 is acceptable?

Once you confirm, we will rebase this PR onto the latest main, resolve the conflicts in CHANGELOG.md and package.json, and rerun the full test suite, typecheck, and production build before updating this PR.

@MiaAI-Lab

Copy link
Copy Markdown
Owner

The foundation remains within the agreed scope but now has three conflicts with main 00151b5. It adds pinned i18next/react-i18next dependencies (package.json:60-65) and puts the catalog check first in the test script (package.json:13). New dependencies require a maintainer decision under this pass's stop conditions. Leaving this open pending that decision and rebase. (Review notes prepared with Claude Code on behalf of the maintainer.)

@MiaAI-Lab

Copy link
Copy Markdown
Owner

The foundation remains within the recorded scope but has conflicts in CHANGELOG, package metadata and Settings against current main. It adds i18next/react-i18next dependencies (package.json:60) and the catalog check to the test script (package.json:13); all 11 focused checker cases pass. New dependencies require a maintainer decision under this pass's stop conditions. Leaving this open pending that decision and rebase. (Review notes prepared with Claude Code on behalf of the maintainer.)

@MiaAI-Lab
MiaAI-Lab merged commit 0ae456c into MiaAI-Lab:main Oct 24, 2026
@MiaAI-Lab

Copy link
Copy Markdown
Owner

Now on main as 0ae456c (merge of the branch, authorship preserved; CHANGELOG credits @oscarlius). The pinned i18next@26.4.2 and react-i18next@17.0.15 were approved by the maintainer and the lockfile adds only those packages from registry.npmjs.org. The branch still carried toggles and catalog entries for features that main has since removed; those were dropped, and main's newer MQTT and GPU-clock Settings rows stay as plain English for a later catalog batch. The dialog test now lives in src/components/SettingsDialog.i18n.test.tsx and asserts that switching language never writes, rather than counting fetches. Catalog check, typecheck, build and the full suites pass (server 1232 pass, frontend 711 pass). Closing as completed; follow-up catalogs can go in per page on top of it. (Review notes prepared with Claude Code on behalf of the maintainer.)

pavelkubicek added a commit to pavelkubicek/sparkDash that referenced this pull request Oct 27, 2026
78 upstream commits: MQTT publishing (MiaAI-Lab#248), harness occupancy helpers (MiaAI-Lab#208),
GPU clock cap from Settings (MiaAI-Lab#218), settings i18n foundation (MiaAI-Lab#226),
configurable GPU temperature limits (MiaAI-Lab#273), Locals/Splash engines,
TensorFold cache-counter fixes (MiaAI-Lab#252/MiaAI-Lab#260/MiaAI-Lab#272) and the zsh-safe remote probes (MiaAI-Lab#255/MiaAI-Lab#257).

Conflict resolutions:
- server/collectors/LlmProbe.js + its TensorFold test: took main's implementation,
  which supersedes this fork's /health `live` + /metrics work with the cache-counter
  precedence, running/waiting aliases, histogram validation and prefill holds. This
  drops the fork's parallel /metrics fetch (micro-optimisation only).
- SystemCollector: main's zsh-safe find probes merged into the fork's build/parse
  refactor, keeping the fork-only RAPL package-power reads; _getRemoteNetwork now uses
  the injected executor (the merge had left the fork body calling sshExec, which made
  main's zsh-glob corpus test run real SSH).
- OverviewPage: FleetKpis keeps the fork's placement but takes all sparks, so hidden
  cluster workers count in the KPI tiles (main's fix).
- SparkPage: main's column layout (History in the hardware column, storage/network in
  the right column) over the fork's full-width History panel.
- SettingsDialog: fork VulnHunter/REA opt-in toggles kept, metrics-history toggle
  switched to main's i18n keys.
- index.js: fork vulnHunt/rea spark cleanup kept alongside MQTT removeUnit/applySettings.
- CHANGELOG/README/package.json: both sides' entries kept; test globs unioned so the
  fork-only models/autopower/vulnhunt suites still run.
MiaAI-Lab pushed a commit that referenced this pull request Oct 31, 2026
Extend the Settings catalogs to cover MQTT fields, validation, and GPU clock feedback. Keep pending edits and result facts intact across language switches.

Constraint: Settings-only follow-up to #226; retain #194 as a reference.

Confidence: high

Scope-risk: narrow
(cherry picked from commit 174ef5c)
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