From 2c2e5913d0c78e1265d76a8246bab6763cb8ac09 Mon Sep 17 00:00:00 2001 From: Gunnstein Lye <289744+glye@users.noreply.github.com> Date: Mon, 17 Apr 2023 09:11:21 +0200 Subject: [PATCH] Moved div tags from translation to template --- .../translations/content_type.en.xliff | 4 ++-- .../themes/admin/ui/form_fields.html.twig | 24 ++++++++++--------- .../Mapper/UserAccountFormMapper.php | 6 ++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/bundle/Resources/translations/content_type.en.xliff b/src/bundle/Resources/translations/content_type.en.xliff index 83477747e4..08f73f388c 100644 --- a/src/bundle/Resources/translations/content_type.en.xliff +++ b/src/bundle/Resources/translations/content_type.en.xliff @@ -822,8 +822,8 @@ key: field_definition.ezuser.require_not_compromised_password - %begin%This uses the API at %link% to securely check breach data. The password is not transmitted to the API.%end% - %begin%This uses the API at %link% to securely check breach data. The password is not transmitted to the API.%end% + This uses the API at %link% to securely check breach data. The password is not transmitted to the API. + This uses the API at %link% to securely check breach data. The password is not transmitted to the API. key: field_definition.ezuser.require_not_compromised_password_help diff --git a/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig b/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig index 492a6b96c0..f0e55d0896 100644 --- a/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig @@ -387,19 +387,21 @@ - {%- if translation_domain is same as(false) -%} - {%- if help_html is same as(false) -%} - {{- help -}} +
+ {%- if translation_domain is same as(false) -%} + {%- if help_html is same as(false) -%} + {{- help -}} + {%- else -%} + {{- help|raw -}} + {%- endif -%} {%- else -%} - {{- help|raw -}} + {%- if help_html is same as(false) -%} + {{- help|trans(help_translation_parameters, translation_domain) -}} + {%- else -%} + {{- help|trans(help_translation_parameters, translation_domain)|raw -}} + {%- endif -%} {%- endif -%} - {%- else -%} - {%- if help_html is same as(false) -%} - {{- help|trans(help_translation_parameters, translation_domain) -}} - {%- else -%} - {{- help|trans(help_translation_parameters, translation_domain)|raw -}} - {%- endif -%} - {%- endif -%} +
{%- endif -%} {%- endblock form_help %} diff --git a/src/lib/FieldType/Mapper/UserAccountFormMapper.php b/src/lib/FieldType/Mapper/UserAccountFormMapper.php index ac99a2fb53..88054c6d0a 100644 --- a/src/lib/FieldType/Mapper/UserAccountFormMapper.php +++ b/src/lib/FieldType/Mapper/UserAccountFormMapper.php @@ -52,13 +52,11 @@ public function mapFieldDefinitionForm(FormInterface $fieldDefinitionForm, Field 'property_path' => $validatorPropertyPathPrefix . '[requireNotCompromisedPassword]', 'label' => /** @Desc("Password must not be contained in a public breach.") */ 'field_definition.ezuser.require_not_compromised_password', - 'help' => /** @Desc("%begin%This uses the API at %link% to securely check breach data. - * The password is not transmitted to the API.%end%") */ + 'help' => /** @Desc("This uses the API at %link% to securely check breach data. + * The password is not transmitted to the API.") */ 'field_definition.ezuser.require_not_compromised_password_help', 'help_translation_parameters' => [ - '%begin%' => '
', '%link%' => 'https://haveibeenpwned.com/', - '%end%' => '
', ], 'help_html' => true, ]);