Skip to content

App language: English, Polish and Spanish, picked in Settings - #48

Merged
Torgh merged 1 commit into
mainfrom
i18n
Nov 1, 2026
Merged

Torgh merged 1 commit into
mainfrom
i18n

Conversation

@Torgh

@Torgh Torgh commented Nov 1, 2026

Copy link
Copy Markdown
Owner

What

TripDeck can now be used in English, Polish or Spanish. Settings has a new 🌐 Language section; the choice is saved per browser, and until one is picked the app follows the browser's language (falling back to English). The phone app follows the phone's language.

How

  • lib/i18n/ – one dictionary per language. en.ts is the reference; pl.ts and es.ts are typed as Messages, so a missing key fails tsc. Plurals use Intl.PluralRules (Polish one / few / many).
  • lib/useLang.ts – useLang() / useT() / setLang(), built like the theme store (useSyncExternalStore, localStorage, other tabs follow).
  • lib/i18n/rich.tsx – keeps links and bold text inside translated sentences (<b>…</b>, <a>…</a>).
  • Lib helpers that write sentences (dive and clock warnings, opening-hours issues, to-dos, trip status, rentals, budget line, country names, dates and durations) take an optional lang, defaulting to English, so the MCP server's output to Claude is unchanged.
  • In-app AI routes (suggest, tips, optimize, import) accept lang and ask Claude to write in it.
  • Removed label maps that only the UI used (THEME_LABEL, RENTAL_VEHICLE_LABEL, ENTRY_KIND_LABEL).

Not translated (on purpose)

MCP tool output, the demo trip's content, server/Google error messages. Money formatting still uses the English format (€1,307).

Tests

  • New lib/i18n/i18n.test.ts: Polish and Spanish use exactly the placeholders and tags English has; plural forms; language detection; durations/dates per language; dive warnings in Polish while English stays the default; rich.
  • bun run check passes (typecheck, lint, 333 tests with coverage thresholds, web and mobile builds).
  • Checked in a browser on an isolated dev server: home, Settings and the demo board in Polish and Spanish.

🤖 Generated with Claude Code

Every text of the web and phone app comes from a dictionary in lib/i18n
(English is the reference; Polish and Spanish must have every key or the
type check fails). Settings has a Language picker, saved per browser;
until one is picked the browser's (or phone's) language is used.

Warnings, dates, durations and country names follow the language, and the
in-app AI buttons ask Claude to answer in it. The MCP server keeps
English, so lib functions take the language as an optional parameter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Torgh
Torgh merged commit 57518a5 into main Nov 1, 2026
7 checks passed
@Torgh
Torgh deleted the i18n branch November 1, 2026 19:17
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