martinkr/next-export-i18n

All pages are statically rendered using the default language

minkiele opened this issue · 1 comments

Hi, in Next.js v13.3.0 when using output: export the statically generated pages are rendered using the default language, then after the first rendered an effect updates the language with the one provided by the router and all labels are updated with the correct content.

I propose to change the useSelectedLanguage hook to reflect the default value before the effect runs, so that the useState hook would be initialized with the router language if present.

Also, it seems that useLanguageQuery and useLanguageSwitcherIsActive hooks are affected too by this problem.

Best regards
Michele

Hi @minkiele,

Thank you for your contribution. I'll take a look for version 3.1.0.

Cheers