Skip to content

Extract i18n to JSON and consolidate page templates - #21

Open
Victor1890 wants to merge 6 commits into
pearOS-archlinux:mainfrom
Victor1890:refactor/post-install-i18n
Open

Extract i18n to JSON and consolidate page templates#21
Victor1890 wants to merge 6 commits into
pearOS-archlinux:mainfrom
Victor1890:refactor/post-install-i18n

Conversation

@Victor1890

Copy link
Copy Markdown

What

Replaces 108 duplicated per-locale HTML pages with 5 shared templates + 18 JSON locale files. Fixes nav bugs, flattens engine.js, drops dead code.

Why

Each locale had its own copy of every page. One string change meant editing 18 files — and they had drifted, shipping real bugs:

  • window.location.hef typo (9 locales — dead Continue button)
  • href=\'...\' backslash escape (8 locales — dead Back button, 5 pages each)
  • Orphan page_theme.html linked from nowhere (18 copies)
  • Orphan welcome.html unreachable (main.js loads hello.html)

What changed

Area Before After
Locale pages 108 HTML in app/lg/<locale>/ 5 templates + 18 JSON
i18n Per-locale HTML duplication app/i18n/<locale>.json + i18n.js
Navigation Inline onclick per button STEPS[] + data-nav orchestrator
commit() 7-deep callback pyramid Flat readFileSync
Validation 3 fns, regex mismatch vs backend Single validateUser(), matches post_setup
Dead code 3 orphan files + 18 orphan theme pages Deleted
index.html 317 lines (6 dead tabs) 39 lines (language select)
finish.html setTimeout(commit, 10000) onload="commit()"

Files

Added (24)

  • app/i18n/*.json — 18 locale string files
  • app/templates/{keymap,timezone,user,agreement,finish}.html
  • app/js/i18n.js

Modified (2)

  • app/index.html — trimmed to language-select only
  • app/js/engine.js — nav orchestrator, flattened commit, unified validation

Deleted (111)

  • app/lg/<locale>/*.html (108 files)
  • app/js/final-movement.js, app/js/focus-fix.js
  • app/welcome.html

Behavior preserved

language select → keymap → timezone → user → agreement → finish → commit() → IPC run-post-setup. Test mode (POST_INSTALL_TEST=1) unchanged. IPC arg order preserved (matches post_setup).

How to test

cd post-install
POST_INSTALL_TEST=1 npm test

Walk: pick language → Continue → keymap → Continue → timezone → Continue → fill user form → Continue → agreement → Continue → finish (test mode closes without running post_setup).

@Victor1890
Victor1890 marked this pull request as ready for review July 18, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant