SkyLundy / Fluency-Translation

A DeepL translation integration for the ProcessWire CMF/CMS platform
GNU General Public License v3.0
11 stars 1 forks source link

CKEDITOR not updating #1

Closed tobaco closed 3 years ago

tobaco commented 3 years ago

Hi!

First, thanks for this fantastic module!

I had an issue with a non updating CKEditor-Field (inside a repeater). The translation was successful updated in the hidden textarea but not in the editor view. (targetIframe was null.)

I fixed it for me by adding

if(CKEDITOR != undefined){
    CKEDITOR.instances[targetInput.id].setData(translatedText)
}

after

// Target input is updated
Fluency.Tools.updateInputValue(targetInput, translatedText)

in fluency.js

SkyLundy commented 3 years ago

Thank you for sharing this! I had never worked with CKEditor before and didn't use it's API as I should have. I think I missed CKEditors in repeaters during testing.

I noticed that this only works if a repeater is created, saved, and then the content is translated. I need to find a workaround where a CKEditor instance in a newly created repeater item is recognized.

Are you seeing that?

SkyLundy commented 3 years ago

This is fixed with a version bump. Updated to use CKEditor API and tested in repeaters for both new and existing items.

Glad you're enjoying the module and find it useful!

Fluency v0.2.4

tobaco commented 3 years ago

Thanks! Works great!