Problem/Motivation
Set up a Drupal site with a data model that uses either or both the link and uri field types. Imagine
- the site is multilingual: Dutch and French (typical in Belgium)
- the field is required and has a default value
- the field should point to the right "more info" page, and should point to
https://example.be/nl/informatiefor Dutch content by default, and tohttps://example.be/fr/infosfor French content by default
This is currently not possible because of
field.value.link:
type: mapping
label: 'Default value'
mapping:
…
uri:
type: string
label: 'URL'
and
field.value.uri:
type: mapping
label: 'Default value'
mapping:
value:
type: string
label: 'Value'
👆 type: string is not translatable.
It's also the wrong type. It should be type: uri (which core provides). But that too would not be translatable.
Discovered in Canvas' #3582558: Symmetrically translatable config-defined component trees, STEP 4: allow translating component instance inputs via TMGMT for ContentTemplates & PageRegions, specifically at https://git.drupalcode.org/project/canvas/-/merge_requests/1099/diffs#no...
Steps to reproduce
Proposed resolution
Introduce
translatable_uri:
type: uri
label: 'Translatable URI'
translatable: true
and then update field.value.link and field.value.uri to use it.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3595275
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
larowlanFeels like a good novice issue
Comment #3
enomo103 commentedComment #5
enomo103 commentedComment #6
enomo103 commentedComment #7
enomo103 commented