protected function DrupalTranslator::getOptions in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Validation/DrupalTranslator.php \Drupal\Core\Validation\DrupalTranslator::getOptions()
- 9 core/lib/Drupal/Core/Validation/DrupalTranslator.php \Drupal\Core\Validation\DrupalTranslator::getOptions()
Returns options suitable for use with TranslatableMarkup.
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 = $locale ?? $this->locale;
return [
'langcode' => $locale,
];
}