- Issue created by @Grimreaper
- 🇫🇷France Grimreaper France 🇫🇷
Is it something that will be or that is already solved with SDC (in UI patterns 2.x)?
- Assigned to pdureau
Pattern (at least the ones declared with YAML)'s label and description, and potentially other properties, are not translatable.
In interface translation, I do not see my patterns description available for translation. I see the pattern label but translating it has no effect.
In app/modules/contrib/ui_patterns/src/UiPatternsManager.php::processDefinition(), add:
// Makes label translatable.
if ($definition instanceof PatternDefinition) {
// phpcs:ignore Drupal.Semantics.FunctionT.NotLiteralString
$label = new TranslatableMarkup($definition->getLabel(), [], ['context' => 'ui_patterns']);
$definition->setLabel($label);
}
But this may be not the right place if the problem is only for YAML declared pattern, and all other properties would need to be updated too.
I wonder why there is no YamlDiscovery in the /modules/ui_patterns_library/src/Plugin/UiPatterns/Pattern/LibraryPattern.php plugin. Otherwise I think translatability could be added like in https://git.drupalcode.org/project/ui_styles/-/blob/8.x-1.x/src/StylePlu...
Agree on a solution
Implement it
Active
1.0
User interface
Is it something that will be or that is already solved with SDC (in UI patterns 2.x)?