Problem/Motivation
Steps to reproduce
Create new custom form (e.g. Download form).
Form Elements > Help text cannot be translated.
Goto Settings. None of the boxes where CKEditor 5 can be used to write are accessible directly. You have to write the text after clicking "Source" icon.
Tokens cannot be inserted in such boxes.
Proposed resolution
Make boxes with CKEditor 5 accessible to write and edit. Allow tokens can be inserted.
Remaining tasks
Make boxes with CKEditor 5 accessible to write and edit. Allow tokens can be inserted.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3329097-9.patch | 780 bytes | jrockowitz |
| #7 | Translation_issue2.png | 3.92 KB | redseujac |
| #7 | Translation_issue.png | 14.78 KB | redseujac |
| #5 | Boxes_issue.png | 10.66 KB | redseujac |
Comments
Comment #2
jrockowitz commentedNot being able to use CKEditor 5 via translation is a major issue.
Inserting token not working as expected probably needs to be handled via the token module's issue queue. Please create a new ticket to deal with the token insertion issue.
Comment #3
redseujacNot via translation, but the boxes with CKEditor 5 icons above are not directly accessible. It's not possible to write in it.
One has to click the "Source" icon to be able to write/edit in those boxes.
The translation of Help text for the form Elements is another problem. It is possible to create some Help text for each form element but it is not possible to translate it in Settings. Not sure this has something to dot with CKEditor 5. I think "Translation" part in the "Settings" is unrelated to CKEditor 5.
Comment #4
redseujacI think that the token problem is related to the the problem I mentioned about the boxes with CKEditor 5 icons above them not being accessible directly. It's impossible to write something into those boxes nor to insert tokens.
Comment #5
redseujacComment #6
jrockowitz commentedI am not able to replicate this issue via Drupal 9.5.x and 10.0.x.
My steps are
Comment #7
redseujacI stiil cannot translate the "Help text" element.
Look at the images Translation_issue.png and Translation_issue2.png. There is no box available to enter the translation.
Also the word "Help" is preceded by a hash (#) => #Help. What does this mean?
Notice that #Help is the title of the text that must be translated. At the right column (= Translation column) there is no box avalable to translate thist text.
There is no problem with other elements, only with the Help text. Notice that the Help title can be translated, unfortunately the Help text not.
Comment #8
redseujacThe issue with the form elements Help-text not being translatable maybe is annoying, but the problem with some Settings textboxes [those with CKEditor 5 icons above it] not being accessible for writing, editing and inserting tokens is worse (see #5 Boxes_issue.png).
Among other things these include the following textboxes:
In my opinion those issues are important enough to try fixing them.
I just installed the most recent dev version (from today) and those issues are still there.
Comment #9
jrockowitz commentedGot it now. The issue is the #help property and nothing else. This is a one-line fix which I think is applicable to 6.1.x too.
Comment #10
martijn de witComment #11
redseujacI applied the patch #9 and I confirm that it's working properly now.
I am able to translate all form elements 'Help text'. Thank you!
What about the issue with some Settings textboxes not being accessible (see #8, #5): does it seem possible to fix it?
Comment #12
jrockowitz commentedI can't reproduce "issue with some Settings textboxes not being accessible"
For now, I am going to commit the patch from #9.
Comment #16
redseujacI'm sorry to insist, but are you sure you can enter text and tokens directly in the settings textboxes 'Form open' message, 'Form closed' message and 'Confirmation' message without having to click on the 'Source' icon previously?
Well, I cannot and that's a very annoying issue.
Do notice that I'm working in Drupal 10 and PHP 8.1. Drupal Languages are Dutch and French.
Comment #17
jrockowitz commentedI can't reproduce this in D9 or D10. My test site has English as the default language, and then I am enabling Spanish translations.
Comment #18
redseujacThank you for your answer.
All I can do is completely remove both my custom form(s) and Webform module, start again from scratch and see what happens.
But in the meantime maybe other users have the same issue.
I will keep you informed.
Comment #19
jrockowitz commentedOne guess is there is a JS error is the browser console that is breaking the CKEditor.
Comment #20
redseujacI don't know, because the issue does not occur in the text box General settings > management-description = "Basic email contact webform"
Inspection in Mozille Firefox and Google Chrome doesn't show errors there.
However inspection of the page(s) with the inaccessible textboxes in Firefox and Chrome shows multiple errors, e.g
in Firefox:
and in Chrome:
Can you deduce anything from that?
Comment #21
jrockowitz commentedAny JS error will block the CKEditor from working as expected. We need to determine what is triggering those JS errors.
Can you see if disabling CSS and JS aggregation temporarily fixes the issue?
Comment #22
redseujacThis fixes the issue:
/admin/config/development/performance
Bandwidth optimization:
Aggregate CSS files => disable
Aggregate JavaScript files => disable
I am glad we found it.
And now ? Should I keep those aggregate CSS/JS settings disabled ?
Comment #23
jrockowitz commentedYou have to keep aggregate CSS/JS enabled on production.
Comment #24
redseujacThank you.
Isn't it strange that this issue didn't occur in Drupal 9 with previous versions of the Webform module, in spite of aggregate CSS/JS being enabled in my performance settings ?
There must have been changes triggering the issue ?
Comment #25
jrockowitz commentedComment #26
redseujacjrockowitz wrote in #21:
Look at the comments #22 and later.
The issue is NOT fixed in the most recent 6.2.x-dev version.
Notice this issue has nothing to do with translations, but with incompatibility of CKeditor and CSS/JS aggregation. If aggregation is disabled, you can write text in the textboxes with CKeditor, otherwise you cannot, because there are JS errors blocking CKEditor from working as expected. See errors in #20.
This seems a major issue.
Comment #27
bnjmnmThere's a missing dependency declaration in ckeditor5.libraries.yml that can be addressed pretty easily and miiight confuse the aggregation process as a result.
the
internal.adminlibrary should also include the following dependencies:While I'm not sure if this library is even loaded in the use case mentioned here, aggregation introduces a layer where this could still be relevant. It's worth trying!
Once I test a few additional things I will be opening a core issue for this, but wanted to mention this here ASAP as there's at least a chance it will help
Comment #28
jrockowitz commented@see #3222107: Library order asset weights do not work properly when a large number of javascript files is loaded between two jQuery UI libraries