Active
Project:
Schema Form
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2026 at 06:35 UTC
Updated:
7 Apr 2026 at 06:43 UTC
Jump to comment: Most recent
For now, the module translates the value of the #title, #description, and the #options labels automatically.
But in some cases, it might be necessary to translate other parts of the YAML structure. For this, we can reuse the "tags" feature of the YAML files and use the !translate tag for values that should be translatable.
The same issue is with Drupal Recipes - see #3488972: [Meta] Make recipes translatable, and it seems they chose the way of using YAML tags for this, see this issue #3313863: Translation of recipe input and config actions [monolingual] for the progress.
So, let's try to implement the same approach in the Schema Form module too.
Comments
Comment #2
murzTo read the YAML tags correctly, seems we have to use the Symfony YAML library (
Symfony\Component\Yaml\Yaml) with the flagYaml::PARSE_CUSTOM_TAGS, because the Drupal YAML (Drupal\Component\Serialization\Yaml) doesn't allow passing custom YAML flags to the parser.Comment #3
murzLet's maybe just wait until the tag support is added to the Drupal YAML library by this MR: https://git.drupalcode.org/project/drupal/-/merge_requests/12121/diffs#6...