From 0d21bfaff56c3f6a0491a950ef9f32eab6c90e05 Mon Sep 17 00:00:00 2001 From: Cornelius Date: Wed, 11 Mar 2026 11:15:18 +0100 Subject: [PATCH] docs: Update README for translated pathnames --- examples/react/start-i18n-paraglide/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/react/start-i18n-paraglide/README.md b/examples/react/start-i18n-paraglide/README.md index 7f481e133c7..7c6433440da 100644 --- a/examples/react/start-i18n-paraglide/README.md +++ b/examples/react/start-i18n-paraglide/README.md @@ -130,6 +130,7 @@ export const Route = createRootRoute({ If you don't want to miss any translated path, you can create a `createTranslatedPathnames` function and pass it to the vite plugin. ```ts +// i18n/lib.ts import { Locale } from '@/paraglide/runtime' import { FileRoutesByTo } from '../routeTree.gen' @@ -190,6 +191,20 @@ export const translatedPathnames = createTranslatedPathnames({ And import into the Paraglide Vite plugin. +```ts +// vite.config.ts +import { translatedPathnames } from './i18n/lib' + +export default defineConfig({ + plugins: [ + paraglideVitePlugin({ + // ... other options + urlPatterns: translatedPathnames, + }), + ], +}) +``` + ## Prerender routes You can use the `localizeHref` function to map the routes to localized versions and import into the pages option in the TanStack Start plugin. For this to work you will need to compile paraglide before the build with the CLI.