You are here

public function Translator::dumpCatalogue in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Translator.php \Symfony\Component\Translation\Translator::dumpCatalogue()

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

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

Class

Translator
Translator.

Namespace

Symfony\Component\Translation

Code

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