Chosen strings are not translatable. Are we should to add them as translatable markup?

$options = array(
    'disable_search' => (bool) $chosen_conf->get('disable_search'),
    'disable_search_threshold' => (int) $chosen_conf->get('disable_search_threshold'),
    'search_contains' => (bool) $chosen_conf->get('search_contains'),
    'placeholder_text_multiple' => new TranslatableMarkup($chosen_conf->get('placeholder_text_multiple')),
    'placeholder_text_single' => new TranslatableMarkup($chosen_conf->get('placeholder_text_single')),
    'no_results_text' => new TranslatableMarkup($chosen_conf->get('no_results_text')),
    'inherit_select_classes' => TRUE,
  );
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ElegguaDP created an issue. See original summary.

ElegguaDP’s picture

nagy.balint’s picture

I can add a translation at admin/config/user-interface/chosen/translate

Does it not work?

a.sotirov’s picture

Hi all,
I would like to suggest a patch for the 8.x-2.9 version on the module. I hope it will be helpful for someone

ant1’s picture

Reroll for 8.x-2.10

dmitri.daranuta’s picture

nagy.balint’s picture

Status: Active » Postponed (maintainer needs more info)

I am still unsure about why we need this patch.

In theory since I can translate the config on the Drupal translation interface, and get returns the translated version, then these TranslatableMarkup would not be needed.

artematem’s picture

Confirming that config_translation can do this job and no patch is needed.

artematem’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)