/**
  * {@inheritdoc}
  */
 protected function loadCatalogue($locale)
 {
     if ($this->options['debug'] === true) {
         $this->options['cache_dir'] = null;
         // disable caching for debug
     }
     return parent::loadCatalogue($locale);
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 protected function loadCatalogue($locale)
 {
     if ($locale != 'en_US') {
         // Always force en_US so that it's available for fallback
         $this->addResource('mautic', null, 'en_US', 'messages');
     }
     $this->addResource('mautic', null, $locale, 'messages');
     parent::loadCatalogue($locale);
 }
 protected function loadCatalogue($locale)
 {
     // Schauen, ob die Cache-Datei älter als wfd_meta.last_touched ist
     foreach ($this->getCacheFiles($locale) as $cacheFile) {
         if (filemtime($cacheFile) < $this->metaQuery->getLastTouched()) {
             @unlink($cacheFile);
         }
     }
     parent::loadCatalogue($locale);
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 protected function loadCatalogue($locale)
 {
     $this->ensureDatabaseLoaderAdded($locale);
     // check if any dynamic resource is changed and update translation catalogue if needed
     if (!empty($this->dynamicResources) && isset($this->dynamicResources[$locale]) && !empty($this->dynamicResources[$locale])) {
         $catalogueFile = $this->options['cache_dir'] . '/catalogue.' . $locale . '.' . sha1(serialize($this->getFallbackLocales())) . '.php';
         if (is_file($catalogueFile)) {
             $time = filemtime($catalogueFile);
             /** @var DynamicResourceInterface $dynamicResource */
             foreach ($this->dynamicResources[$locale] as $dynamicResource) {
                 if (!$dynamicResource->isFresh($time)) {
                     // remove translation catalogue to allow parent class to rebuild it
                     unlink($catalogueFile);
                     break;
                 }
             }
         }
     }
     parent::loadCatalogue($locale);
 }
예제 #5
0
 /**
  * {@inheritdoc}
  */
 protected function loadCatalogue($locale)
 {
     $this->initializeDynamicResources($locale);
     parent::loadCatalogue($locale);
 }