Example #1
0
 /**
  * {@inheritdoc}
  */
 public function getAvailableLocales()
 {
     if (!$this->loaded) {
         $this->locales = $this->repository->getAvailableLocales();
         $this->loaded = true;
     }
     return $this->locales;
 }
 /**
  * Synchronizes database and filesystem translations
  *
  * @param Request $request
  */
 public function syncDictionary(Request $request, KernelInterface $kernel)
 {
     $this->kernel = $kernel;
     $this->currentLocale = $request->getLocale();
     $this->locales = $this->localeRepository->findAll();
     $this->propertyAccessor = PropertyAccess::createPropertyAccessor();
     $this->loadFilesystemTranslations();
     $this->loadDatabaseTranslations();
     $this->mergeAndSaveTranslations();
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function getGlobals()
 {
     return ['locales' => $this->repository->getAvailableLocales()];
 }