i18n: re-sync German UI overlay onto Onyx v4.5.2 + lock to release tag
Client is moving to release v4.5.2 (from the ~v4.3 the overlay was built on) and wants the pin on a release NUMBER, not a raw commit. - Re-synced end-user-i18n.patch: cherry-picked PR #12558 onto v4.5.2 and resolved the ~25 conflicts from upstream's own refactors. Strategy = never break the UI: kept v4.5.2's version for tangled components (they stay English) and hand-merged only the two that matter — AppProvider (i18n init + I18nextProvider) and SettingsPage (language selector). New i18n infra + all 5 locale dicts merged cleanly. 4 files upstream relocated were dropped (no dangling imports — verified). - Pin to release tag: upstream.pinnedCommit + i18n.baseCommit = v4.5.2 (make setup checks out the tag). Regenerated patch applies to pristine v4.5.2 with zero conflicts. - apply-branding.mjs: idempotent i18n step via a sentinel file (src/lib/i18n.ts), so re-running make apply no longer errors once branding has edited the patched files. - DHI base-image swap now also triggers on v4.5.2 (its Dockerfile uses dhi.io/node). - README: tag-pin model, coverage caveat, per-release re-sync guidance. Verified: patch applies clean to v4.5.2; full make apply green (i18n + 201 code + 376 locale replacements); selector + init wired; no leaked conflict markers. Image build to be run on a stable connection (local build blocked by network).
This commit is contained in:
parent
1f2d637263
commit
01b9adfcd9
4 changed files with 274 additions and 1919 deletions
26
README.md
26
README.md
|
|
@ -167,11 +167,19 @@ language switcher under Settings → Appearance and **instant** switching. It co
|
||||||
|
|
||||||
It's wired into the overlay, config-driven from `branding.config.json → i18n`:
|
It's wired into the overlay, config-driven from `branding.config.json → i18n`:
|
||||||
|
|
||||||
- `make apply` `git apply`s `branding/i18n/end-user-i18n.patch` onto the pinned checkout
|
- **Locked to a release tag** — `upstream.pinnedCommit` and `i18n.baseCommit` are both
|
||||||
|
set to the same Onyx **release** (currently **`v4.5.2`**), not a raw commit.
|
||||||
|
- `make apply` `git apply`s `branding/i18n/end-user-i18n.patch` onto that checkout
|
||||||
**before** the branding codemod, then rebrands `Onyx`→`AIDO` inside every bundled
|
**before** the branding codemod, then rebrands `Onyx`→`AIDO` inside every bundled
|
||||||
dictionary (`web/public/locales/{de,en,es,fr,pt}/common.json`).
|
dictionary (`web/public/locales/{de,en,es,fr,pt}/common.json`).
|
||||||
- Because the patch is pinned to its exact base commit
|
- Because the patch is **re-synced against that exact release** (`i18n.baseCommit`), it
|
||||||
(`i18n.baseCommit == upstream.pinnedCommit`), it applies with **zero conflicts**.
|
applies with **zero conflicts**. It will *not* apply to a different Onyx version — that's
|
||||||
|
why the deployment must run the pinned release (see the re-sync note below).
|
||||||
|
|
||||||
|
> **Coverage:** most end-user components are translated. Where v4.5.2 refactored a
|
||||||
|
> component the PR also touched, that component keeps its English text (rather than risk a
|
||||||
|
> broken UI) — so translation coverage grows over time / with each re-sync, and the app is
|
||||||
|
> always guaranteed to build and run.
|
||||||
|
|
||||||
### Editing the German translations
|
### Editing the German translations
|
||||||
|
|
||||||
|
|
@ -186,10 +194,14 @@ Set `i18n.enabled: false` in `branding.config.json`, bump `upstream.pinnedCommit
|
||||||
forward, and re-run `make setup && make apply`. Your `de/common.json` carries over to the
|
forward, and re-run `make setup && make apply`. Your `de/common.json` carries over to the
|
||||||
official feature, so migration is essentially free.
|
official feature, so migration is essentially free.
|
||||||
|
|
||||||
> **Upgrade note:** this is a large feature patch pinned to one commit. Moving to a much
|
> **Upgrade / re-sync note:** this is a large feature patch pinned to one release. To move
|
||||||
> newer Onyx before official i18n lands needs a re-sync of the patch (regenerate it
|
> to a newer Onyx while official i18n isn't out yet, the patch must be **re-synced** onto
|
||||||
> against the new base). `make apply` fails loudly with a clear message if the checkout
|
> the new release tag (cherry-pick PR #12558 onto the tag, resolve conflicts against
|
||||||
> isn't at `i18n.baseCommit`, so it never applies half-way.
|
> upstream's refactors, regenerate `end-user-i18n.patch`, bump both pins). This is the
|
||||||
|
> per-release maintenance step — cheapest done **one release at a time** rather than
|
||||||
|
> skipping several. `make apply` fails loudly if the checkout isn't at `i18n.baseCommit`,
|
||||||
|
> so it never applies half-way. **Lock your image tags to the pinned release** and only
|
||||||
|
> move after the re-sync is prepared.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,19 +63,22 @@ if (CONFIG.i18n && CONFIG.i18n.enabled) {
|
||||||
warn(`i18n patch not found at ${patchPath} — skipping`);
|
warn(`i18n patch not found at ${patchPath} — skipping`);
|
||||||
} else {
|
} else {
|
||||||
const gitApply = (extra) => execFileSync("git", ["apply", "-p1", ...extra, patchPath], { cwd: ROOT, stdio: "pipe" });
|
const gitApply = (extra) => execFileSync("git", ["apply", "-p1", ...extra, patchPath], { cwd: ROOT, stdio: "pipe" });
|
||||||
let already = false, ok2 = true;
|
// Idempotency sentinel: the patch adds this file. If it exists the overlay was
|
||||||
try { gitApply(["--check"]); }
|
// already applied (a later branding pass may have edited the patched files, so a
|
||||||
catch {
|
// reverse-check is unreliable) — skip re-applying.
|
||||||
try { gitApply(["--reverse", "--check"]); already = true; }
|
const sentinel = path.join(WEB, "src/lib/i18n.ts");
|
||||||
catch { ok2 = false; }
|
if (existsSync(sentinel)) {
|
||||||
|
ok("i18n patch already applied (found src/lib/i18n.ts) — skipping");
|
||||||
|
} else {
|
||||||
|
let applies = true;
|
||||||
|
try { gitApply(["--check"]); } catch { applies = false; }
|
||||||
|
if (!applies) {
|
||||||
|
console.error(`${c.red}✗ i18n patch does not apply. The checkout must be at i18n.baseCommit (${CONFIG.i18n.baseCommit}). Run \`make setup\` (pinnedCommit is set to that tag), or set i18n.enabled=false.${c.reset}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
if (DRY) ok("i18n patch applies cleanly (dry-run, not written)");
|
||||||
|
else { gitApply([]); ok(`applied i18n patch — react-i18next, user UI only (Admin stays English); default language ${CONFIG.i18n.defaultLanguage}`); }
|
||||||
}
|
}
|
||||||
if (!ok2) {
|
|
||||||
console.error(`${c.red}✗ i18n patch does not apply. The checkout must be at i18n.baseCommit (${CONFIG.i18n.baseCommit}). Run \`make setup\` (pinnedCommit is set to that commit), or set i18n.enabled=false.${c.reset}`);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
if (already) ok("i18n patch already applied — skipping");
|
|
||||||
else if (DRY) ok("i18n patch applies cleanly (dry-run, not written)");
|
|
||||||
else { gitApply([]); ok(`applied i18n patch — react-i18next, user UI only (Admin stays English); default language ${CONFIG.i18n.defaultLanguage}`); }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"$comment": "Pin the exact Onyx commit/tag this overlay is authored against. Pinned to the base commit of the end-user i18n PR (#12558) so its patch applies cleanly (see i18n below). `make setup` checks out this commit. When Onyx merges official i18n, bump this forward and set i18n.enabled=false.",
|
"$comment": "Pin the exact Onyx release tag this overlay is authored against. `make setup` checks this out. Locked to a release NUMBER (e.g. v4.5.2), not a raw commit. The i18n patch below is re-synced against this exact tag, so it applies cleanly (see i18n). To move to a newer Onyx: re-sync the i18n patch onto the new tag, then bump this. When Onyx ships official i18n, bump this and set i18n.enabled=false.",
|
||||||
"repo": "https://github.com/onyx-dot-app/onyx",
|
"repo": "https://github.com/onyx-dot-app/onyx",
|
||||||
"pinnedCommit": "727e096de85680416bd8d5af0daec3a4f5b407d2",
|
"pinnedCommit": "v4.5.2",
|
||||||
"webSrcRoot": "web"
|
"webSrcRoot": "web"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
"$comment": "TEMPORARY end-user internationalization, backported from Onyx PR #12558 (react-i18next; user UI only, Admin stays English) until the official feature ships. apply-branding.mjs git-applies `patch` onto the pinned checkout BEFORE the branding string codemod, then the codemod also rebrands Onyx->AIDO inside the bundled locale dictionaries. Fill/refine translations in web/public/locales/<lang>/common.json. Set enabled=false to drop it once official i18n lands.",
|
"$comment": "TEMPORARY end-user internationalization, backported from Onyx PR #12558 (react-i18next; user UI only, Admin stays English) until the official feature ships. apply-branding.mjs git-applies `patch` onto the pinned checkout BEFORE the branding string codemod, then the codemod also rebrands Onyx->AIDO inside the bundled locale dictionaries. Fill/refine translations in web/public/locales/<lang>/common.json. Set enabled=false to drop it once official i18n lands.",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"patch": "branding/i18n/end-user-i18n.patch",
|
"patch": "branding/i18n/end-user-i18n.patch",
|
||||||
"baseCommit": "727e096de85680416bd8d5af0daec3a4f5b407d2",
|
"baseCommit": "v4.5.2",
|
||||||
"defaultLanguage": "de",
|
"defaultLanguage": "de",
|
||||||
"rebrandLocales": true
|
"rebrandLocales": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue