Overview

Seeing what it takes to get `inputs` in config exposed via TMGMT

@wimleers seem to be doing something similar in #3582478: Symmetrically translatable config-defined component trees, STEP 2: change config schema type for `inputs` to allow translating via core's Config Translation UI

Proposed resolution

just experiment.

User interface changes

See screenshots on !885

Issue fork canvas-3582558

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

tedbow created an issue. See original summary.

wim leers’s picture

Good news!

  1. I borrowed what you had in here (!833) for config schema over at #3582464: [PP-2] Symmetrically translatable config-defined component trees, STEP 3: adjust sequence keys to avoid translations breaking when component instances are moved's !831. !831 is now green.
  2. #3582478: Symmetrically translatable config-defined component trees, STEP 2: change config schema type for `inputs` to allow translating via core's Config Translation UI in turn is step 2, and thanks to !831, a clear problem emerged that confirms that need: #3582478-2.
  3. And just now … I've got an initial MR up that fixes the problem: #3582478-5: Symmetrically translatable config-defined component trees, STEP 2: change config schema type for `inputs` to allow translating via core's Config Translation UI.

That should allow this MR to become simpler, like we discussed 🤞

wim leers’s picture

Title: WIP: Experiment to expose inputs to TMGMT » WIP: Experiment to expose component instance inputs to TMGMT
Related issues: +#3582464: [PP-2] Symmetrically translatable config-defined component trees, STEP 3: adjust sequence keys to avoid translations breaking when component instances are moved

wim leers’s picture

Issue tags: +Needs screenshots

!885 looks promising! Can we get some screenshots? 🙏

tedbow’s picture

Issue summary: View changes
Issue tags: -Needs screenshots

Add screens directly to !885 to make it clear which MR is related to screenshots(also easier to add on gitlab)

wim leers’s picture

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs issue summary update

I've incorporated many of the foundational bits in @tedbow's MR here in !898 for #3582478: Symmetrically translatable config-defined component trees, STEP 2: change config schema type for `inputs` to allow translating via core's Config Translation UI — grep the commits for "tedbow" :)


@tedbow: Based on my research due to the way TMGMT works combined with how Canvas stores its data, you AFAICT could only ever have succeeded in surfacing plain strings, because those end up storing <input name>: <string value (e.g. heading: 'Oh hello there).

So AFAICT this MR could not have made work multi-property field types such as the link field type which is used to populate type: string, format: uri. Is that right?

wim leers’s picture

Title: WIP: Experiment to expose component instance inputs to TMGMT » [PP-1] WIP: Experiment to expose component instance inputs to TMGMT
tedbow’s picture

@wim-leers re #9. It seems like you have investigated this further down the rabbit than I have. When I got formatted text to work with config_translation by using \Drupal\config_translation\FormElement\Textarea this actually failed on \Drupal\tmgmt\Data::wordCount because it assume it was a string in $text = strip_tags($text);

I figured we could swap that service if that was only blocker but I did't look further. I can look into this. Maybe just bypass that local to see if getting by that will just open more problems.

wim leers’s picture

I ran into the wordCount thing too, it's in the stack trace in the MR comment I linked from #9. The only way to avoid it is to build a custom ConfigProcessorInterface (which you started doing in !833).
It'd have to extract just the string field properties of multi-property field types (so for the text field type, extract only value as a translatable) and pass along other field properties as context (so format: canvas_html_block) — or something along those lines.

wim leers changed the visibility of the branch 3582558-tmgmt to active.

wim leers’s picture

Title: [PP-1] WIP: Experiment to expose component instance inputs to TMGMT » [PP-1] WIP: Experiment to expose component instance inputs to TMGMT — precursor to Canvas-native translation UX
Priority: Normal » Critical
Related issues: +#3585452: Create a preview mode for non-default languages

Adjusting issue title to reflect why this is so important.

In a meeting with @lauriii yesterday, he emphasized the intent to make translations focus just on strings, because that would allow:

  • automated translation (whether to a translation provider powered by humans, a machine, an LLM …)\
  • the future integrated-into-Canvas'-UI translation UX to likely be simpler, too

Related: @tedbow opened #3585452: Create a preview mode for non-default languages in which he shows what the initial goal is: translate outside Canvas' UI, (pre)view translations inside Canvas' UI.

wim leers’s picture

Title: [PP-1] WIP: Experiment to expose component instance inputs to TMGMT — precursor to Canvas-native translation UX » [PP-2] WIP: Experiment to expose config-defined component instance inputs to TMGMT — precursor to Canvas-native translation UX
Assigned: tedbow » Unassigned
Status: Postponed (maintainer needs more info) » Postponed

Due to core's Content Translation UX relying on field widgets, and Canvas' "component tree" field type not having a widget, #3583684: [PP-1] Symmetric translations for content entities should allow only translatable properties in inputs to be overridden is kinda forced to use TMGMT to translate content-defined component trees.

IOW: ~50% of this issue is being implemented there. Postponing this on that one.