next-intl use without middleware
Unanswered
Cuban Crocodile posted this in #help-forum
Cuban CrocodileOP
i have e-commerce nextjs project where im using next-intl, but i dont want to use middleware becouse i need all my components be SSG or static.. i follow documentation but the problem which i have is that sometimes its taking wrong language let's say if i have selected english lang its using second one, in one page maybe 2 component using right lang but 1 component using wrong lang.. if someone has same example, please give me way how i can fix it becouse there isnt nothing about this topic.. (i found one way to write setRequestLocale() in every page and layout but i think this is not best way, there will be some problems again..)
7 Replies
Flemish Giant
You can add a query in the url and change language according to that that would be easy
Cuban CrocodileOP
u mean have language in url path? like domain.com/en ?
i have like that btw also im saving lang in cookies
i just need someone who done next-intl without middleware some normal size project
becouse in docs there is how we can use next intl without middleware but i done same way just not working sometimes its using wrong lang..
Cuban CrocodileOP
anyone?
Flemish Giant
sorry bro for the late reply
in the last project they save all the character into an object and use to change all the word and put the lang in the query and use the useContext and check for the language and if the language change in the url they reneder the lang accordingly
in the last project they save all the character into an object and use to change all the word and put the lang in the query and use the useContext and check for the language and if the language change in the url they reneder the lang accordingly