Problem/Motivation

Set up a Drupal site with a data model that uses either or both the link and uri field types. Imagine

  1. the site is multilingual: Dutch and French (typical in Belgium)
  2. the field is required and has a default value
  3. the field should point to the right "more info" page, and should point to https://example.be/nl/informatie for Dutch content by default, and to https://example.be/fr/infos for 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

Command icon 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

wim leers created an issue. See original summary.

larowlan’s picture

Issue tags: +Novice

Feels like a good novice issue

enomo103’s picture

Assigned: Unassigned » enomo103

enomo103’s picture

Assigned: enomo103 » Unassigned
Status: Active » Needs review
enomo103’s picture

Assigned: Unassigned » enomo103
Status: Needs review » Needs work
enomo103’s picture

Assigned: enomo103 » Unassigned
Status: Needs work » Needs review