Problem/Motivation
Add missing configuration translation interface.
There are several pieces of information from the Entity/Field system, which may include translatable strings, but which prior to this patch are not translatable using the Config Translation UI:
a) Field settings. For instance, on a Number field, there are translatable settings for the Prefix and Suffix in the settings config. But if you go to the Translate page for the field, all you can translate is the Label and Help for the field, not the prefix/suffix.
===> This is because the schema is wrong. See #2546356: Numeric field prefix/suffix settings should be translatable. Fields are translatable along with their settings, supposedly anyway.
b) Entity view displays - field formatter settings. For instance, on #2545730: Misuse of formatPlural() in Numeric field prefix/suffix we are adding the ability to numbers to have formatPlural() type formatting, but there is no way to translate the "1 item/@count items" strings. These are stored on the entity view display config items.
c) Entity form displays - widget settings. For instance, many text fields have widget options to enter Placeholder text, and obviously this would need to be translated. These are stored on the entity form display config items.
d) Base field overrides, which seem to include labels.
==> will do this on a separate issue
The technical reason is, at least for the entity view/form display formatter/widget settings, that there is not an edit form for these things -- the config schema indicates they should be translatable, but there's no way to edit them so config translation module doesn't put up a UI for translating them either. They are settings that appear as part of the Manage Form or Manage Display pages in Field UI, but the individual fields do not have their own settings forms.
Comment #5 also looked at other config items to see if they were translatable and #8 discussed them; more issues will be open.
How to test
- Use core version applicable to the patch and apply the patch
- Configure
Article
node type with aboolean
field, displayed inDefault
view mode using custom texts - Enable
Configuration Translation
module (/admin/modules
) - Add at least one language (
/admin/config/regional/language
) - Go to configuration translation page (
/admin/config/regional/config-translation
) - Click on
List
button forContent view display
- Click on
Translate
button forDefault
view mode forArticle
content type - See what is on the configuration translation form for the
Article
Default
view mode - @todo - Add more steps for translating specific configuration
Proposed resolution
- Create a ConfigTranslation entity list builder extending ConfigTranslationFieldListBuilder to manage the translation of entity view and form modes and override the necessary methods to load, filter, and display entity view/form modes for translation.
- Extend the Config Entity Mapper in the Field UI module to handle translation mappings and titles for entity view and form modes and implement methods to set route parameters, generate overview route names, and generate titles specific to entity view/form modes.
- Alter translation forms. Iterate through the relevant form elements and associate translation-related details, such as titles and descriptions, for formatter and widget settings.
Remaining tasks
Review patch
Determine any follow ups
Commit
User interface changes
You'll are able to fully translate your site. Can't now.
API changes
No
Data model changes
No