Change record status: 
Introduced in branch: 
7.x-3.x
Description: 

The original Yaml translations patterns format wasn't extensible, and has already accumulated multiple hacks to support all possible patterns, and has been blocking further work/features.

So, a new format is introduced, which is more extensible, but a bit more verbose. Here are the main changes:

  • All patterns have been moved into a top-level translation_patterns key.
  • For each pattern, the file match regex has been moved to a matches key.
  • The list of translatable keys for each pattern are moved into a translatable_keys key.

Before:

*.info.yml:
  - name
  - description
  - package
  - regions
*.routing.yml:
  - _title:
      context: _title_context

After:

translation_patterns:
  - matches: '*.info.yml'
    translatable_keys:
      - name
      - description
      - package
      - regions
  - matches: '*.routing.yml'
    translatable_keys:
      - key: _title
        context: _title_context
Impacts: 
Module developers