feat: add i18n option with a dedicated route per language, including german translation #12
+704
−156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the structure for i18n and german version of the website under
/depath. 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
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).src/components/TTSPage.tsx,src/components/ShareDialog.tsx,src/components/ui/*).src/lib/library/base.ts,src/lib/library/index.ts) and shipped full German copy insrc/lib/library/lang/de.ts; updated store logic to localize presets without overwriting user-edited text.HTML lang in sync (
src/components/ClientDynamicTTS.tsx).Adding More Languages:
To add another locale,
Language/SUPPORTED_LANGUAGESinsrc/lib/i18n.tsand supply message stringssrc/lib/library/lang/<code>.tsand register it in TRANSLATIONS insrc/lib/library/index.ts;