T
TanStack12h ago
equal-aqua

Multilingual URLs

Hey everyone.. Where I work we have a requirement for bilingual URLs (for example /en/about and /fr/a-propos). How easy/difficult would something like this be to implement in TanStack Router? Obviously, the ideal implementation would be a single .tsx file per route, where /en/about and /fr/a-propos both point to (for example) about.tsx. We've successfully implemented this in RRv7, along with a supporting <Link> component that will render the correct URL path depending on the current locale.. but I'd like to explore TanStack Router for new projects.
2 Replies
quickest-silver
quickest-silver11h ago
you might be able to pull this with optional path params and route masking
Route Masking | TanStack Router React Docs
Route masking is a way to mask the actual URL of a route that gets persisted to the browser's history and URL bar. This is useful for scenarios where you want to show a different URL than the one that...
Path Params | TanStack Router React Docs
Path params are used to match a single segment (the text until the next /) and provide its value back to you as a named variable. They are defined by using the $ character prefix in the path, followed...
equal-aqua
equal-aquaOP6h ago
Thx @savas

Did you find this page helpful?