You are here

public function Translator::__construct in Plug 7

Constructor.

@api

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

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

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;
}