Locale as a route and redirection #2481
-
I follow this discussion regarding the redirection with Sveltekit, which I'm also trying to implement. I forked the example for Sveltekit which I'm adapting for my project. However I'm required to use the locale as a route. There seems to be different ways to do so, according to the discussion ##1807, I could use However, I'm still not sure how I can tell Sveltekit that the default language (set as EN) should be The issue as you may guess is that this |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 7 replies
-
With You can tell it to always include the language in the url by passing the // src/lib/i18n.js
import ... from ...
export const i18n = createI18n(runtime, { prefixDefaultLanguage: "always" }) |
Beta Was this translation helpful? Give feedback.
-
Sorry to comment on an old discussion, but I came across this while searching for a way to do this on the NextJS version. |
Beta Was this translation helpful? Give feedback.
With
@inlang/paraglide-js-adapter-sveltekit
you shouldn't need a language parameter at all. You can just place your routes at the root of yourroutes
folder & the routing should just work.You can tell it to always include the language in the url by passing the
prefixDefaultLanguage: "always"
option tocreateI18n
like so: