Replies: 1 comment
-
There is currently no way to change that with file system based routing. I've turned this discussion into an issue here to keep track of it #3502 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I’m trying to implement i18n in Fresh 2.
The goal is to support URLs both with locale prefix and without it, e.g.:
/aaa
/de/aaa
/ru/blog/some-post
I want both variants to resolve to the same route file (e.g.
routes/aaa.tsx
orroutes/blog/[slug].tsx
) without duplicating files under each locale folder.I tried using middleware:
ctx.next()
still resolves against the original URL (/de/aaa
) → Fresh looks forroutes/de/aaa.tsx
(which doesn’t exist) → 404.Request
toctx.next()
, so I cannot “rewrite” the path like in Next.js.Questions:
/de/aaa
can transparently resolve toroutes/aaa.tsx
)?Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions