generateDataForLocale example

$filesystem->remove($tempDir);
        $filesystem->mkdir($tempDir);

        $locales = $this->scanLocales($localeScanner$config->getSourceDir());

        $this->compileTemporaryBundles($this->compiler, $config->getSourceDir()$tempDir);

        $this->preGenerate();

        foreach ($locales as $locale) {
            $localeData = $this->generateDataForLocale($reader$tempDir$locale);

            if (null !== $localeData) {
                foreach ($writers as $targetDir => $writer) {
                    $writer->write($targetDir.'/'.$this->dirName, $locale$localeData);
                }
            }
        }

        $rootData = $this->generateDataForRoot($reader$tempDir);

        if (null !== $rootData) {
            
return [];
        }

        if (isset($this->fallbackCache[$fallback])) {
            return $this->fallbackCache[$fallback];
        }

        $prevGeneratingFallback = $this->generatingFallback;
        $this->generatingFallback = true;

        try {
            $data = 'root' === $fallback ? $this->generateDataForRoot($reader$tempDir) : $this->generateDataForLocale($reader$tempDir$fallback);
        } finally {
            $this->generatingFallback = $prevGeneratingFallback;
        }

        return $this->fallbackCache[$fallback] = $data ?: [];
    }
}
Home | Imprint | This part of the site doesn't use cookies.