martinkr/next-export-i18n

Initial Build Translations

celsowhite opened this issue · 1 comments

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?

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!