0

I have a website set up with contentEditable text, that's text content a user can edit, and I need to set up translations so that when the user edits this text, it's updated in the translations.json file. I set up a redux store with actions that store looks exactly how the translations.json file that is passed to resources looks like. The problem is that I don't really know how to make next-i18n use this store as the translation resource.

This is how next-i18n documentation says I should set up the translations in the config:

export async function getServerSideProps({locale}) {
  return {
    props: {
      ...await serverSideTranslations(locale, ['common', 'slide1'], config
      ),
    }
  }
}

The config can contain the resources, but I can't use the redux selector inside getServerSideProps.

ouflak
  • 2,458
  • 10
  • 44
  • 49

1 Answers1

0

Use react-i18n and the i18n.addResource function instead of redux. You can't remove a resource, so the keys can't be dynamic for the existing text. But that's ok for me

ouflak
  • 2,458
  • 10
  • 44
  • 49