public function Translator::dumpCatalogue in Plug 7
This method is public because it needs to be callable from a closure in PHP 5.3. It should be made protected (or even private, if possible) in 3.0.
@internal
File
- lib/
Symfony/ translation/ Translator.php, line 369
Class
- Translator
- Translator.
Namespace
Symfony\Component\TranslationCode
public function dumpCatalogue($locale, ConfigCacheInterface $cache) {
$this
->initializeCatalogue($locale);
$fallbackContent = $this
->getFallbackContent($this->catalogues[$locale]);
$content = sprintf(<<<EOF
<?php
use Symfony\\Component\\Translation\\MessageCatalogue;
\$catalogue = new MessageCatalogue('%s', %s);
%s
return \$catalogue;
EOF
, $locale, var_export($this->catalogues[$locale]
->all(), true), $fallbackContent);
$cache
->write($content, $this->catalogues[$locale]
->getResources());
}