Skip to content
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

Surveys: Fix I18n translation support and WYSIWYG support #26135

Merged

Conversation

seamuslee001
Copy link
Contributor

@seamuslee001 seamuslee001 commented May 1, 2023

The "instructions" field is already a wysiyg in singlelingual mode.

Overview

This allows for the user interface to update the translation for the instructions field

Before

Database is translatable but UI does not support it

After

Both DB and UI support translating of the field

Technical Details

Note that on the form https://github.com/civicrm/civicrm-core/blob/master/CRM/Campaign/Form/Survey/Main.php#L126 https://github.com/civicrm/civicrm-core/blob/master/CRM/Campaign/Form/Petition.php#L174 it is already a WYSIWYG which means that RichTextEditor is the correct widget to use not TextArea

ping @demeritcowboy @eileenmcnaughton @mlutfy

…be a RichTextEditor for the translation given it is already a wysiyg in singlelingual mode
@civibot
Copy link

civibot bot commented May 1, 2023

(Standard links)

@civibot civibot bot added the master label May 1, 2023
@demeritcowboy
Copy link
Contributor

So close!

Untitled3

It's strange because the english version seems ok. For some reason the other language shows the html.

@demeritcowboy
Copy link
Contributor

Ah if I go back and edit the spanish now the english is html. So it's not being racist it's that there's some double escaping going on.

@seamuslee001
Copy link
Contributor Author

hmm that does feel strange maybe something in the way the l10n form saves?

@seamuslee001
Copy link
Contributor Author

@demeritcowboy I believe I have found the problem see civicrm/civicrm-packages#361

@mlutfy mlutfy changed the title [REF] Add in I18n front end translation support and update widget to … Surveys: Fix I18n translation support and WYSIWYG support May 2, 2023
@mlutfy
Copy link
Member

mlutfy commented May 2, 2023

Correct me if i'm wrong, but I tweaked the PR title because it helps with release notes.

(I haven't tested yet, but sounds like a good catch)

@demeritcowboy
Copy link
Contributor

The addition to skipfields seems to make it work without needing the packages PR. I don't see any other fields in core called "instructions", so there's no conflict. And it would likely be a wysiwyg if there were one added somewhere.

Out-of-scope:

  • If you change the language while on the interview page everything changes except the instructions, but if you just go back and do the search again and then interview it works.
  • The popup icon doesn't appear when first creating the record - you need to save and then go back and edit.

Also not a blocker for this PR: The ThankYou message on petition is translatable, but is html code in a regular textarea in the popup.

So am going to merge.

@demeritcowboy demeritcowboy merged commit 01999c6 into civicrm:master May 2, 2023
@seamuslee001 seamuslee001 deleted the instructions_i18n_support branch May 2, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants