protected function DrupalTranslator::getOptions

protected DrupalTranslator::getOptions($domain = NULL, $locale = NULL)

Returns options suitable for use with t().

File

core/lib/Drupal/Core/Validation/DrupalTranslator.php, line 100

Class

DrupalTranslator
Translates strings using Drupal's translation system.

Namespace

Drupal\Core\Validation

Code

protected function getOptions($domain = NULL, $locale = NULL) {
  // We do not support domains, so we ignore this parameter.
  // If locale is left NULL, t() will default to the interface language.
  $locale = isset($locale) ? $locale : $this->locale;
  return array('langcode' => $locale);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Validation!DrupalTranslator.php/function/DrupalTranslator::getOptions/8.1.x