-
I have an application running on https://stadium.equalssport.com/ It has two languages, which run on the paths: https://stadium.equalssport.com/en and https://stadium.equalssport.com/pt However, it does not auto detect the language from the browser. I can't figure out why. I strongly believe it might be because I'm using nextjs 11, because we deploy it using serverless, so it only supports version 10 and 11. for the page export const getServerSideProps: GetServerSideProps = withSSRUserAuth(
async ctx => {
const { locale } = ctx;
return {
props: {
...(await serverSideTranslations(
locale ?? "pt",
["welcome", "toast"],
i18nextConfig
)),
},
};
}
); And My
Versions of packages we are using:
Is there a way to make it handle language detection? I beleive it's possible to do something related to the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
localeDetection is an option in the i18n object: https://nextjs.org/docs/advanced-features/i18n-routing#prefixing-the-default-locale |
Beta Was this translation helpful? Give feedback.
localeDetection is an option in the i18n object: https://nextjs.org/docs/advanced-features/i18n-routing#prefixing-the-default-locale
The whole language detection and routing topic is directly solved by next.js, there is no logic about that in next-i18next