Skip to content

Add Spanish translation support - #120

Merged
jonocodes merged 1 commit into
mainfrom
feature/spanish-translations
Oct 16, 2026
Merged

jonocodes merged 1 commit into
mainfrom
feature/spanish-translations

Conversation

@jonocodes

@jonocodes jonocodes commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

What

Adds Spanish as a second UI language, selectable in Preferences → Language and auto-detected from the browser (es* → Spanish) when no choice has been made yet.

  • i18next + react-i18next, resources bundled as JSON so the PWA still works fully offline
  • Locale files per area in src/locales/{en,es}/ (~460 keys each), merged into one namespace by src/i18n.ts
  • Every screen converted to t() — dialogs, snackbars, tooltips, empty states, select labels — with {{placeholders}} and _one/_other plurals
  • lib/ stays framework-free: it owns the English source (lib/src/messages.ts) plus a tiny t() that the app points at i18next at startup; Spanish lives in src/locales/es/lib.json. Read times, ingestion progress messages and card dates are localized
  • Summaries get a "write the summary in Spanish" instruction when the UI is Spanish; the text-to-speech voice default follows the language too
  • Browser extension localised the standard way: _locales/{en,es}/messages.json + chrome.i18n (default_locale: en), data-i18n attributes in the HTML — it follows the browser's language
  • Docs: new i18n section in docs/DEVELOPMENT.md (how to add keys/languages, what stays English), README feature bullet, CHANGELOG entry

Test plan

  • npx tsc --noEmit clean, npm run lint 0 errors, npm run test → 430 tests / 27 suites. New src/i18n.test.ts enforces en↔es key parity, {{placeholder}} parity, lib-key parity, that every literal t() key resolves in both languages, and language-switch behavior
  • npm run build (PWA bundle) succeeds
  • npm run test:e2e → 97 passed, including new tests/e2e/spanish.spec.ts (loads straight into Spanish from the cookie, switches in Preferences, persists across reload). playwright.config.ts now pins locale: "en-US" so the existing English assertions stay deterministic
  • npx web-ext lint → 0 errors (1 pre-existing warning)
  • Manual: screenshots taken with browser locale es-ES (auto-detect works, <html lang> flips to es) and en-US

Deliberately still English

console/debug output, thrown error messages surfaced in snackbars, telemetry event names, the prefilled GitHub issue template, CSV export headers, brand/product names, the PWA manifest and static <title>, and LLM prompt instructions. Documented in docs/DEVELOPMENT.md.

Screenshots

Preferences in English (baseline) with the new Language row

screenshot 1

The same screen in Spanish — auto-detected from an es-ES browser locale; the Language dropdown is the new switch

screenshot 2

Article list in Spanish (empty state)

screenshot 3

jonocodes added a commit that referenced this pull request Oct 16, 2026
@netlify

netlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for savrlist ready!

Name Link
🔨 Latest commit bc3f909
🔍 Latest deploy log https://app.netlify.com/projects/savrlist/deploys/6ad197ba0cf76528793a6be4
😎 Deploy Preview https://deploy-preview-120--savrlist.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

The UI now speaks English and Spanish through i18next + react-i18next:
every screen, dialog, snackbar, tooltip and empty state, plus the article
card/read-time strings and the ingestion progress messages produced by lib/.

- Language comes from the new savr-language cookie, else navigator.language
  (es* -> es), and is switchable in Preferences -> Language
- Locale files live in src/locales/<lang>/<area>.json; lib keeps its English
  source in lib/src/messages.ts and gets a translator injected at startup
- Summaries are asked to answer in Spanish when the UI is Spanish, and the
  TTS voice default follows the language
- The browser extension is localised via _locales/{en,es} + chrome.i18n
- src/i18n.test.ts enforces en/es key + placeholder parity and checks that
  every literal t() key resolves in both languages; tests/e2e/spanish.spec.ts
  covers loading, switching and persistence (e2e locale pinned to en-US)

Co-Authored-By: Claude <noreply@anthropic.com>
@jonocodes
jonocodes force-pushed the feature/spanish-translations branch from e46a17c to bc3f909 Compare October 16, 2026 03:19
@jonocodes
jonocodes merged commit 67bbe77 into main Oct 16, 2026
6 checks passed
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