From b27777b625fb348f35e435276842668e16456967 Mon Sep 17 00:00:00 2001 From: NtskwK Date: Tue, 3 Feb 2026 11:19:09 +0800 Subject: feat(i18n): add multi-language support for docs --- packages/docs/app/routes.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'packages/docs/app/routes.ts') diff --git a/packages/docs/app/routes.ts b/packages/docs/app/routes.ts index 9acc429..2997ecf 100644 --- a/packages/docs/app/routes.ts +++ b/packages/docs/app/routes.ts @@ -1,9 +1,16 @@ -import { index, route, type RouteConfig } from '@react-router/dev/routes'; +import { route, type RouteConfig } from '@react-router/dev/routes'; export default [ - index('routes/home.tsx'), - route('docs', 'routes/docs.tsx'), - route('docs/*', 'docs/page.tsx'), - route('api/search', 'docs/search.ts'), - route('*', 'routes/not-found.tsx'), + // Home routes: / and /:lang + route(':lang?', 'routes/home.tsx', { id: 'home' }), + + // Docs routes: /docs/* and /:lang/docs/* + route(':lang?/docs', 'routes/docs.tsx', { id: 'docs' }), + route(':lang?/docs/*', 'docs/page.tsx', { id: 'docs-page' }), + + // API routes + route('api/search', 'docs/search.ts', { id: 'api-search' }), + + // Catch-all 404 + route('*', 'routes/not-found.tsx', { id: 'not-found' }), ] satisfies RouteConfig; -- cgit v1.2.3-70-g09d2