Jump to content

RockPageBuilder registering changes to fields when translated


FireWire
 Share

Recommended Posts

@bernhard So this is where our modules shake hands 😆

I have text/TinyMCE fields that use Fluency but are having issues saving content when Fluency is used to translate/insert the content into the field. If I manually add content to other languages, it saves correctly, it's only when automatic translation is used that it doesn't save. It's only occurring if the multilanguage field is in an RPB block.

Here's a field that I translated into German and French but when I save the page it doesn't get stored.

1052057987_Screenshotfrom2024-10-2912-05-38.png.0d24962ac18cb04ae74cd4dafdab18d2.png

I added content by hand here:

1664310003_Screenshotfrom2024-10-2912-06-12.png.cbd1d7c13e662885daaa1e3c791a3f7d.png

And this saves correctly. When I took a look at the console I saw this message when I entered content by hand:

1475618555_Screenshotfrom2024-10-2912-06-37.png.1eb2a0cb6d82f3046e400241761ad4a2.png

However when I translate automatically with Fluency, that message doesn't get logged to the console. I'm assuming that indicates it's not picking up on the changes, and so not saving the translated content with the block.

I noticed that what I have to do make translations stick is after translating with Fluency, click to another language tab and manually make a change. Something simple like align left, but on each translated language. In the background that's going to change the markup/contents of the field so that will register with RPB. So the issue may be that RPB can't detect content that is added programmatically into fields within RPB blocks.

When I was building Fluency this issue popped up for me on all TinyMCE fields because entering content programmatically wasn't registering. The fix for me was to manually use dispatchEvent(new Event('input')); on the TinyMCE instance so that it was registered with the field. That ended up working.

image.png.3f30712effb60316f54263d095129a88.png

I don't know if this is all related, but that's what my investigation lead me to.

What do you think?

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...