Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions examples/react/start-i18n-paraglide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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.
Expand Down
Loading