-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMS events don't update i18n content values #4729
Comments
Hi @wslyvh, you're correct this is not supported yet. |
Got it. Thanks for the confirmation. We were considering to use CMS events, to avoid bloating the build process too much. But I think that would work, yes. Is there an easy way to update the actual MD files, so that the translated content would still show up in the CMS? |
If the content/translation is autogenerated I recommend doing it in the build process and not the CMS. You could still commit the changes back to the repo during the build but I wouldn't got that way since it can create other issues (push access to builds, triggering another build during a build, etc.) If you really want to update the content from the CMS you could change the MD file directly using the GitHub API (or whatever backend you're using). |
That's what I was thinking. Thanks for that. Maybe one more question on CMS events + i18n, are there any plans and/or timelines to support that? |
We don't have a timeline for it, but a contribution will be great |
Got it. Thanks again. I'll have a look at contributing, but I think in this case it'll likely be quicker for our current use-case to find an alternative solution. |
Fixed in #7227 |
I'm trying to use CMS event listeners with i18n enabled.
I realize both are beta features and might not be in a state that is sufficient for my use-case.
What I'd like to achieve is to automatically translate content from the default lang into the other language(s). I was thinking of:
I'm able to catch and read all content data for both languages, following the docs at
https://www.netlifycms.org/docs/beta-features/#registering-to-cms-events
The updates, however, are only saved for the original (en) content.
Here's an example of the event handler
Results of saving my page from the CMS.
As you can see, the description is updated on the en/page.md and nothing was added on the es/page.md
For completion also the relevant parts of my config.yml, although I think this matters much.
Applicable Versions:
"gatsby-plugin-netlify-cms": "^4.4.0"
https://unpkg.com/netlify-cms@2.10.76/dist/netlify-cms.js
Git provider: GIthub
OS: Mac, Catalina
Browser version Brave
yarn version v1.22.10
Is it possible to use these features together?
Am I using them correctly?
Or would there be any alternatives for automatically translating original CMS content using an external API?
The text was updated successfully, but these errors were encountered: