Skip to content

Conversation

@sha-oai
Copy link

@sha-oai sha-oai commented Dec 5, 2025

This PR adds the structure for i18n and german version of the website under /de path. Further language implementations will be under their specific path. The UI was not changed, except the token replacement for interface texts that need translations.

Summary

  • Added basic i18n plumbing with route-aware language detection (src/app/[lang]/page.tsx, src/lib/i18n.ts, src/hooks/useI18n.ts) and persisted language choice in the Zustand store (src/lib/store.ts).
  • Localized UI strings across header, buttons, dialogs, and TTS controls using the new t() helper (e.g., src/components/TTSPage.tsx, src/components/ShareDialog.tsx, src/components/ui/*).
  • Refactored the voice/vibe library into a translatable base plus locale overlays (src/lib/library/base.ts, src/lib/library/index.ts) and shipped full German copy in src/lib/library/lang/de.ts; updated store logic to localize presets without overwriting user-edited text.
  • Kept client rendering for the TTS page but now pass the initial language from dynamic routes to keep
    HTML lang in sync (src/components/ClientDynamicTTS.tsx).

Adding More Languages:

To add another locale,

  1. extend Language/SUPPORTED_LANGUAGES in src/lib/i18n.ts and supply message strings
  2. add a translation map for presets in src/lib/library/lang/<code>.ts and register it in TRANSLATIONS in src/lib/library/index.ts;
  3. add the route param to generateStaticParams so /fr (etc.) prebuilds;
  4. optionally seed locale-specific copy for any new UI strings and voices. This keeps routing, storage, and preset localization working automatically.

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.

2 participants