public function DrupalTranslator::setLocale

public DrupalTranslator::setLocale($locale)

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 58

Class

DrupalTranslator
Translates strings using Drupal's translation system.

Namespace

Drupal\Core\Validation

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Validation!DrupalTranslator.php/function/DrupalTranslator::setLocale/8.1.x