-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-static support #4
Comments
Domain routing with next-i18next: i18next/next-i18next#16 (comment) |
Based on the link above, I was able to get this working. But it's not ideal yet. It looks like it's always rendering in English on the server and then detecting the correct lang on the browser and updating the language. Maybe there's a bug in the language detection in the server. |
The header I was relying on for the hostname was express specific. I fixed it to work without express. |
Hey I came across your repo and just wanted to provide some input for you. By adding getInitialProps() to the _app file you will disable automatic static generation. For my understanding, your entire project will run SSR, which is not ideal if you have static sites, in matter of fact you will be paying for something what otherwise would come free. A better aproach would be to detect the language in Disclaimer |
That could work if you're okay with not having any text shown until the language is detected and the translation strings are loaded. I also don't know whether it could be done with |
Due to #3 and the fact that we plan on using next-i18next (which doesn't support static pages anyway), we're going to give up on supporting static pages for now and focus on just getting SSR working with
getInitialProps()
.We'll get rid of the dynamic
[locale]
directory and just detect the lang in middleware, setting the value on thereq
object, and somehow use that value to instantiate i18n.TODO:
[locale]
dynamic dirqueryreq
The text was updated successfully, but these errors were encountered: