Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292183

Entity view/form mode formatter/widget settings have no translation UI

$
0
0

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

  1. Use core version applicable to the patch and apply the patch
  2. Configure Article node type with a boolean field, displayed in Default view mode using custom texts
  3. Enable Configuration Translation module (/admin/modules)
  4. Add at least one language (/admin/config/regional/language)
  5. Go to configuration translation page (/admin/config/regional/config-translation)
  6. Click on List button for Content view display
  7. Click on Translate button for Default view mode for Articlecontent type
  8. See what is on the configuration translation form for the ArticleDefaultview mode
  9. @todo - Add more steps for translating specific configuration

Proposed resolution

  1. 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.
  2. 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.
  3. 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


Viewing all articles
Browse latest Browse all 292183

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>