dev/translation#67 - Allow translation of fields which lack an explicit HTML type #20606
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The
Translation
entity can be used to translate certain fields. Currently, the field settings (data_type
,html_type
) must satisfy some requirements before being translated. This change slightly relaxes those requirements.Before
String fields can be flagged as translatable - but only if their HTML widget is textual.
After
String fields can be flagged as translatable - if their HTML widget is either textual or undefined.
Comments
civicrm_msg_template
(msg_subject
,msg_text
,msg_html
) to marked as translatable.data_type
andhtml_type
constraints were introduced during a much earlier draft. At that time, the list of fields wasopen-ended. Now, the list is much narrower (default=none) and requires an extra opt-in (
hook_translateFields
). Consequenty, there's less concern about someone trying to translate an inappropriate field.html_type
data forMessageTemplate
. (But I don't know if this will have other side-effects.)