protected function DrupalTranslator::getOptions in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Validation/DrupalTranslator.php \Drupal\Core\Validation\DrupalTranslator::getOptions()
Returns options suitable for use with TranslatableMarkup.
2 calls to DrupalTranslator::getOptions()
- DrupalTranslator::trans in core/
lib/ Drupal/ Core/ Validation/ DrupalTranslator.php - Translates the given message.
- DrupalTranslator::transChoice in core/
lib/ Drupal/ Core/ Validation/ DrupalTranslator.php
File
- core/
lib/ Drupal/ Core/ Validation/ DrupalTranslator.php, line 104
Class
- DrupalTranslator
- Translates strings using Drupal's translation system.
Namespace
Drupal\Core\ValidationCode
protected function getOptions($domain = NULL, $locale = NULL) {
// We do not support domains, so we ignore this parameter.
// If locale is left NULL, TranslatableMarkup will default to the interface
// language.
$locale = isset($locale) ? $locale : $this->locale;
return [
'langcode' => $locale,
];
}