Replies: 1 comment
-
Detect it on the server side and pass it as prop from getServerSideProps on each page. BTW it's more nextjs realted question than lingui |
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
-
I need to translate a webapp that will not have the language in the url (example: domain.com/contact will be the url of the contact page for all the languages).
This is a nextjs application, and the lingui example uses a lot router.locale to make everything works, but if I disable the nextjs i18n routing, the router.locale is no more accessible.
I tried to replace the router.locale with a function that auto-detect language, but if it is simple to make it work on server side using headers of the request, or on client side using the navigator.language, it's quite complicated to make it work in the
useLinguiInit
hook that is used in both the environments.Do you have any suggestion or examples?
Beta Was this translation helpful? Give feedback.
All reactions