Problem/Motivation
There are many issues in Core about translation contexts. While investigating one of them
#3037906: Add translation contexts to workflow schema
I noticed that the translated string in question, the word "Second", is used in Layout Discovery and Layout Builder in layout YML files.
core/modules/layout_discovery/layout_discovery.layouts.yml
core/modules/layout_builder/layout_builder.layouts.yml (several instances)
In investigating how to add string context to the labels in layouts.yml files, I found out that the labels are actually not even being extracted for translated at all.
So if you go to localize.drupal.org and search for something like "Two column bricks", you will see it in some projects, like Panels, but it is not in Drupal Core.
Proposed resolution
This issue actually needs to be moved to the POTX project, but since it affects Drupal Core, I have created it here to bring it to the attention of the Layout maintainers. The file in the POTX project that needs to be patched is
https://git.drupalcode.org/project/potx/blob/7.x-3.x/yaml_translation_pa...
When you add a new type of YAML file to Core with translated text in it, entries need to be added to that file.
In this case, it looks like the label and category strings need to be added to that translation patterns file.
In addition, at least the label needs a string context added, to fix the problem identified in that other issue.
Remaining tasks
1. Verify that in plugin discovery, the label and category strings are marked as translatable when layout plugins are instantiated, with the proper context, so that if the strings are in a PO file, they will get translated on the screen. If not, then the Layout module needs a patch to make this happen.
2. Move this issue over to the POTX project https://www.drupal.org/project/issues/potx [or make a child issue].
3. Make a patch that adds the label (with context) and category strings as translatable for *.layouts.yml files in https://git.drupalcode.org/project/potx/blob/7.x-3.x/yaml_translation_pa...
User interface changes
Layout labels and categories will be translatable on localize.drupal.org.
API changes
None.
Data model changes
Sort of -- two strings in layouts.yml files will end up translatable.
Comments
Comment #11
smustgrave commentedThis came up as the daily BSI target
This actually sounds like a duplicate of #3046985: The word "Second" needs translation context which was just recently fixed, could you confirm?