$form['display']['show_thumbnail'] = array(
    '#title' => t('Show Thumbnail', array(), array('context' => 'test')),
    '#type' => 'radios',
    '#options' => array(
      '1' => t('Yes', array(), array('context' => 'test')),
      '0' => t('No', array(), array('context' => 'test')),
    ),
  );

Gives a warning: "WARNING: #options values usually have to run through t() for translation"

But the following is fine.

  $form['display']['show_thumbnail'] = array(
    '#title' => t('Show Thumbnail', array(), array('context' => 'test')),
    '#type' => 'radios',
    '#options' => array(
      '1' => t('Yes'),
      '0' => t('No'),
    ),
  );

Comments

attiks created an issue. See original summary.

  • klausi committed 91cec40 on 8.x-3.x
    fix(OptionsT): Fix false positive with nested arrays in t() calls (#...
klausi’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Status: Active » Fixed

Thanks for reporting, committed a fix!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.