[Proposal] Advanced i18n Starter Template with Localized URLs - i18next #6533
okanay
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I've been building with TanStack Start and noticed there aren't many examples covering advanced i18n patterns—specifically localized URLs and proper international SEO.
I built a starter template that solves this using TanStack Router's
rewriteoption. Sharing here in case it's useful to others or worth adding to the examples.The Problem
Most i18n setups force you into one of these patterns:
What we actually want:
The Solution: URL Rewriting
The router's
rewriteoption maps localized URLs to a single internal route structure:Internal routes (your actual files):
What users see:
/about/en/aboutabout.tsx/tr/hakkimizda/tr/aboutabout.tsx/fr/produits/blue-shirt/fr/products/blue-shirtproducts.$slug.tsx/tr/urunler/arama/tr/products/searchproducts.search.tsxOne route file serves all languages. No duplication, no custom Link wrappers needed.
Features
/enprefix)$slug,$id)Repository
https://github.com/okanay/tanstack-i18n
If the team thinks this would be a useful addition to the examples directory, I'd be happy to open a PR.
Thanks for reading!
Beta Was this translation helpful? Give feedback.
All reactions