martinkr / next-export-i18n

Internationalize (18n) next.js with true support for next export
MIT License
247 stars 37 forks source link

Initial Build Translations #26

Closed celsowhite closed 2 years ago

celsowhite commented 2 years ago

Hi, great work on this package. I have a question (not an issue). I initially thought that I would have to call my translation files in the getStaticProps() function so that data would be compiled on build. But it seems that isn't necessary.

Are the initial static html files (created during next build) referencing whatever translations are set in the defaultLang json file?

martinkr commented 2 years ago

Hi celsowhite,

Thank you for reaching out. There is no need for calling getStaticProps(). The translations are taken from the translations files through the useTranslation() hook.

You can take a quick look at the example project at https://github.com/martinkr/next-export-i18n-example

Cheers!