Problem/Motivation
On #2546212: Entity view/form mode formatter/widget settings have no translation UI and/or #2449597: Number formatters: Make it possible to configure format_plural on the formatter level I noticed that if you go to translate an Integer field, you do not get the option to translate the Prefix and Suffix fields. They definitely need to be translatable.
The problem is that they are config type "string" and it should be "label". This is in core/config/schema/core.data_types.schema.yml :
field.field_settings.integer:
type: mapping
label: 'Integer'
mapping:
...
prefix:
type: string
label: 'Prefix'
suffix:
type: string
label: 'Suffix'
See also #2545730: Misuse of formatPlural() in Numeric field prefix/suffix
Proposed resolution
Change prefix/suffix to be type "label" instead. This should apply to all fields that have prefix/suffix.
Remaining tasks
Make a patch.
User interface changes
Prefix/suffix settings for numeric fields will be translatable.
API changes
None.
Data model changes
Not really. This is a compatible change -- the only difference between string and label is that label is marked as Translatable. So I don't think we need to migrate anything.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | prefix-suffix-type-2546356-2.patch | 1.02 KB | pravin ajaaz |
Comments
Comment #2
jhodgdonComment #3
pravin ajaaz commentedChanged the type for prefix/suffix as "label". They are available in "Integer, Float and decimal"
Comment #4
pravin ajaaz commentedComment #5
alx_benjamin commentedWas uploading the same patch. You beat me to it :)
Changing status to Needs Review
-------------------------------------------------
Sponsored by http://reallifedesign.co.uk/
Comment #6
merilainen commentedLooks good to me. I tested this on a vanilla Drupal8. Without the patch I can see the prefix and suffix strings which I have entered only in the UI translation list, but this is way better because now I can translate the prefix and suffix per field instance.
Comment #7
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed c65d6df and pushed to 8.0.x. Thanks!
Comment #9
jhodgdonComment #10
pravin ajaaz commented