You are here

public function DrupalTranslator::setLocale in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Validation/DrupalTranslator.php \Drupal\Core\Validation\DrupalTranslator::setLocale()

Sets the current locale.

Parameters

string $locale The locale:

Throws

\InvalidArgumentException If the locale contains invalid characters

Overrides TranslatorInterface::setLocale

File

core/lib/Drupal/Core/Validation/DrupalTranslator.php, line 63
Contains \Drupal\Core\Validation\DrupalTranslator.

Class

DrupalTranslator
Translates strings using Drupal's translation system.

Namespace

Drupal\Core\Validation

Code

public function setLocale($locale) {
  $this->locale = $locale;
}