You are here

public function Translator::setFallbackLocales in Plug 7

Sets the fallback locales.

@api

Parameters

array $locales The fallback locales:

Throws

\InvalidArgumentException If a locale contains invalid characters

1 call to Translator::setFallbackLocales()
Translator::setFallbackLocale in lib/Symfony/translation/Translator.php
Sets the fallback locale(s).

File

lib/Symfony/translation/Translator.php, line 194

Class

Translator
Translator.

Namespace

Symfony\Component\Translation

Code

public function setFallbackLocales(array $locales) {

  // needed as the fallback locales are linked to the already loaded catalogues
  $this->catalogues = array();
  foreach ($locales as $locale) {
    $this
      ->assertValidLocale($locale);
  }
  $this->fallbackLocales = $locales;
}