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

public function getLocale() {
  return $this->locale ? $this->locale : \Drupal::languageManager()->getCurrentLanguage()->getId();
}
doc_Drupal
2016-10-29 09:03:08
Comments
Leave a Comment

Please login to continue.