I am trying to rebuild our companies website with gatsby. Most of the content for our site is coming from Contentful
but the translations itself are in Transifex
.
I am not sure how to integrate all of this. Im using the gatsby-source-contentful
plugin to pull in data from contentful.
What is the proper way to download translations from transifex?
My idea was to use the transifex API in the createPages
hook and then pass the locale data as a context variable. And then inside the component file just use react-intl
.
Is this the proper way of doing this? or What is a better approach?
Many ways to accomplish this but the one thaf comes to mind is to create the Transifex source plugin yourself. https://www.gatsbyjs.org/docs/create-source-plugin/#create-source-plugin
Once nodes are created with that plugin consider using the node mapping feature. https://www.gatsbyjs.org/docs/gatsby-config/#mapping-node-types