public function DrupalTranslator::getLocale in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Validation/DrupalTranslator.php \Drupal\Core\Validation\DrupalTranslator::getLocale()
- 9 core/lib/Drupal/Core/Validation/DrupalTranslator.php \Drupal\Core\Validation\DrupalTranslator::getLocale()
File
- core/
lib/ Drupal/ Core/ Validation/ DrupalTranslator.php, line 68
Class
- DrupalTranslator
- Translates strings using Drupal's translation system.
Namespace
Drupal\Core\ValidationCode
public function getLocale() {
return $this->locale ? $this->locale : \Drupal::languageManager()
->getCurrentLanguage()
->getId();
}