Symfony\Component\Translation\Translator::setFallbackLocale PHP Method

setFallbackLocale() public method

Sets the fallback locale.
public setFallbackLocale ( string $locale )
$locale string The fallback locale
    public function setFallbackLocale($locale)
    {
        // needed as the fallback locale is used to fill-in non-yet translated messages
        $this->catalogues = array();

        $this->fallbackLocale = $locale;
    }

Usage Example

Ejemplo n.º 1
0
 public function register(Application $app, array $options = array())
 {
     $translator = new Translator('en', new MessageSelector());
     $translator->setFallbackLocale('en');
     $translator->addLoader('array', new ArrayLoader());
     $translator->addLoader('xliff', new XliffFileLoader());
     return $translator;
 }
All Usage Examples Of Symfony\Component\Translation\Translator::setFallbackLocale