public DrupalTranslator::getLocale()
Returns the current locale.
Return value
string The locale
Overrides TranslatorInterface::getLocale
File
- core/lib/Drupal/Core/Validation/DrupalTranslator.php, line 65
Class
- DrupalTranslator
- Translates strings using Drupal's translation system.
Namespace
Drupal\Core\Validation
Code
public function getLocale() {
return $this->locale ? $this->locale : \Drupal::languageManager()->getCurrentLanguage()->getId();
}
Please login to continue.