Skip to content

i18n: extract the shared components - #112

Open
Janlhin wants to merge 2 commits into
Liquid-co:dev-publicfrom
Janlhin:pr-2-shared-components
Open

Janlhin wants to merge 2 commits into
Liquid-co:dev-publicfrom
Janlhin:pr-2-shared-components

Conversation

@Janlhin

@Janlhin Janlhin commented Oct 20, 2026

Copy link
Copy Markdown

What

Extracts the user-facing strings of the remaining shared / chrome components into the catalog (en / zh-Hans / zh-Hant), one key per sentence, grouped per component:

  • First commit — the all-purpose components whose text was plain strings: the About modal, the Discord banner, the drop overlay, the release-notes empty state, the What's-new modal, the collections dialog (its delete confirmation now counts through a plural) and the notification hub (bell title, unread counts, and the hand-built "1 notification / 2 notifications" plural).
  • Second commit — the framework-layer chrome: CloudOfferBanner, NewGamesBanner, PairingBanner, Sidebar, CommandPalette, ProtectionBadge, ShortcutsSheet and PauseButton, including the whole-sentence cloud-offer / pairing / sidebar-plural restructures.

Notes

  • Both Chinese scripts land in the same commits; the three catalogs are key-aligned (scripted check: 0 missing / 0 extra across 344 keys).
  • Plurals go through Intl.PluralRules; English uses {one, other} objects, Chinese uses the single {n} form.
  • Inline-bold sentences use segments() like Home; no hintA/hintB splits.
  • Two upstream features that landed on dev-public after PR i18n: offer Chinese by script (zh-Hans/zh-Hant) and extract the window shell #77 were still hardcoded: the NotificationHub "Clear all" button and the CommandPalette "Rename" entry. Both are extracted here too, adding notifications.clearAll, notifications.clearAllTitle and palette.renameGame.
  • npm test 287/287 · vite build clean · catalog alignment verified (344/344/344).
  • No lib/ behavior changes.

Verification

  • Rendered check in the built app (all views, both scripts).
  • Bisect self-consistency: each commit in the range checks out to an aligned three-language catalog.

Translation and review: @Janlhin (simplified & traditional)

Janlhin added 2 commits October 20, 2026 17:33
collections and notifications pieces

The remaining all-purpose components whose text is plain strings: the
About modal, the Discord banner, the drop overlay, the release-notes
empty state, the What's-new modal, the collections dialog (its delete
confirmation now counts through a plural) and the notification hub,
bell title and unread counts included.

- 41 new keys in each catalog (229 total).
- ReleaseNotes imports the store as `i18n`: its toneFor() declares a
  local `t`, and a `$t` in the template would collide with it — the
  same trap the toast dismiss button hit.
- The notifications bell's hand-built "1 notification / 2
  notifications" plural moves into the catalog.

npm test: 310/310 · vite build clean · catalogs aligned (0 missing, 0 extra).
…uts sheet and pause button

The framework-layer batch: every remaining chrome-and-banner component
whose text was plain strings, including the ones whose English sentences
were assembled piece by piece.

- 73 new keys in each catalog (302 total).
- Sentence restructures: the cloud-offer card's "X has a newer save for
  Y" and its accepted-toast, the pairing card's "X wants to pair" with
  its "over the internet / from {address}" sub-line now whole-sentence
  keys with placeholders instead of English-order fragments; the sidebar's
  hand-built "1 sync / 2 syncs in progress" plural moves into the catalog;
  the new-games list keeps its enumeration but takes the "and"/","
  joiners and "{n} more" from the catalog.
- ProtectionBadge now keys its labels and details by protection state,
  so lib/protection.js stays untouched and its wording tests keep
  passing; same for the palette's six kind chips.
- Reused existing keys where the string matched exactly: common.dismiss,
  statusBar.pause, home.addGame.title, home.welcome.scanForSaves,
  home.syncAllToast and the home.title/home.devices/home.cloudBackup/
  about.changelog page names for the sidebar nav.
- Palette entry labels with lib values ("Go to {page}", pause lengths,
  snapshot note labels) take the English value as a {placeholder} — the
  lib/i18n split is a later batch, as with pauseLength() inside the
  pause button's title. The shortcuts sheet's descriptions come from
  lib/shortcuts.js and stay English for the same reason.

npx vitest run: 310/310 · vite build clean · catalogs aligned (0 missing, 0 extra).
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the sivadaboi's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant