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

Find a more reliable way to determine if a form element concerns a multilingual value.

$
0
0

Problem/motivation

We currently add a translation clue i.e. "(all languages)" to form elements if #multilingual is empty and the element type is not in the static list $ignored_types.

    static $ignored_types;

    // @todo Find a more reliable way to determine if a form element concerns a
    //   multilingual value.
    if (!isset($ignored_types)) {
      $ignored_types = array_flip(['actions', 'value', 'hidden', 'vertical_tabs', 'token', 'details', 'link']);
    }

Even though the $ignored_types list could be supplemented in previous issues like #2674068 the current implementation is insufficient. Non-core modules can define form elements that should not have a translation clue too.

Example

A prominent example is the field_group module where the translation clue appears not only double escaped but also unreasonably when an accordion item is rendered in the translation form:

content_translation_field_group

Proposed resolution

Instead of using the static list of ignored element types the form elements could define if they concern a multilingual value.


Viewing all articles
Browse latest Browse all 295264

Trending Articles



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