You are here

public function Translator::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/translation/Translator.php \Symfony\Component\Translation\Translator::__construct()
  2. 8 vendor/symfony/css-selector/XPath/Translator.php \Symfony\Component\CssSelector\XPath\Translator::__construct()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Translator.php \Symfony\Component\Translation\Translator::__construct()

Constructor.

Parameters

string $locale The locale:

MessageSelector|null $selector The message selector for pluralization:

string|null $cacheDir The directory to use for the cache:

bool $debug Use cache in debug mode ?:

Throws

\InvalidArgumentException If a locale contains invalid characters

File

vendor/symfony/translation/Translator.php, line 82

Class

Translator
Translator.

Namespace

Symfony\Component\Translation

Code

public function __construct($locale, MessageSelector $selector = null, $cacheDir = null, $debug = false) {
  $this
    ->setLocale($locale);
  $this->selector = $selector ?: new MessageSelector();
  $this->cacheDir = $cacheDir;
  $this->debug = $debug;
}