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.