Replies: 1 comment 1 reply
-
In remix-i18next you only use i18next-browser-languageDetector to know the language from the Line 180 in 439127c I'm not sure what's the benefit of this, you will have to pass the params to getFixedT or getLocale, if you do that you can also do Lines 129 to 133 in 439127c |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Remix v1.9.0 has been released on top of React Router v6.5.0 which adds a new feature called optional routes. Optional routes can be defined as
(segment)
wheresegment
is any normal RR route, that makes the segment optional, its most obvious advantage could be i18n. It's a common practice to put the locale in the URL which makes it easy and obvious for both users and devs to figure out what is the current locale.For example, these file structure:
Will match
/
/blog
/en
/en/blog
/ku
/ku/blog
We can use this URL param as one of the detection orders, one issue though, the language detector is currently is client side only atm, see:
https://github.com/i18next/i18next-browser-languageDetector/blob/57c6b44da8cf4ee372ba28788cda5b1d3a55ca8a/src/browserLookups/path.js
I'd love to see this feature utilized by remix-i18next
Beta Was this translation helpful? Give feedback.
All reactions