- Issue created by @alexpott
- Merge request !12605Move the plural label constraint to the correct place β (Open) created by alexpott
Consider
label:
type: string
label: 'Optional label'
translatable: true
constraints:
Regex:
# Forbid any kind of control character.
# @see https://stackoverflow.com/a/66587087
pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control characters.'
But
# String containing plural variants, separated by EXT.
plural_label:
type: label
label: 'Plural variants'
And then in views...
format_plural_string:
type: plural_label
label: 'Plural variants'
constraints:
Regex:
# Normally, labels cannot contain invisible control characters. In this particular
# case, an invisible character (ASCII 3, 0x03) is used to encode translation
# information, so carve out an exception for that only.
# @see \Drupal\views\Plugin\views\field\NumericField
pattern: '/([^\PC\x03])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control characters.'
Move the constraint from views to core.
None
N/a
None
None
N/a
Active
11.0 π₯
configuration system