DrupalTranslator::getLocale

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

1
2
3
public function getLocale() {
  return $this->locale ? $this->locale : \Drupal::languageManager()->getCurrentLanguage()->getId();
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.