0

I have a problem with hydratation of translations via API. I am using only two namespaces. common.json and paths.json and if i change some of the translation in database for namespace common, it change whole namespace and it cause to revalid all of the pages. So it is not very well optimized.

export const getStaticProps = async ({ locale }: GetServerSidePropsContext) => {
   try {
     return {
       props: {
         ...(await serverSideTranslations(locale as any, i18config?.options?.ns))
       },
       revalidate: REVALIDATE.ONE_DAY
     }
    } catch (e) {
       ...
    }
}

Is there any options to rehydrate translations on client site, after server send html to client? Or can next18next detect the only changed key of translation and rehydrate only page which using actual key?

I really hope there is another solution then split all namespaces by pages.

I want to rehydrate "serverside" translation runtime on client site. It seems to be the best solution for me so far.

Snicko
  • 1
  • 2

0 Answers0