/** * Initialize the translation before loading catalogues from the storage */ protected function initialize() { if ($this->initialized) { return; } parent::initialize(); // Add resources files directly, so that we still have translations // event if we don't run translation:import $standardResources = $this->getStandardResources(); foreach ($standardResources as $resource) { parent::addResource($resource['format'], $resource['path'], $resource['locale'], $resource['domain']); } // Register all catalogues we have in the storage $repo = $this->container->get('liip.translation.repository'); $locales = $repo->getLocaleList(); foreach ($repo->getDomainList() as $domain) { foreach ($locales as $locale) { parent::addResource('liip', 'intermediate.storage', $locale, $domain); } } $this->initialized = true; }
/** * {@inheritdoc} */ protected function initialize() { parent::initialize(); // add dynamic resources to the end to make sure that they override static translations $this->registerDynamicResources(); }