예제 #1
0
 /**
  * @return string[]
  */
 private function getLocales()
 {
     $locales = $this->localeContext->getLocales();
     if (($fallbackLocale = $this->localeContext->getFallbackLocale()) !== null) {
         $locales[] = $fallbackLocale;
     }
     return $locales;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function create(array $options = [])
 {
     $translatable = parent::create($options);
     $translatable->setLocales($this->localeContext->getLocales());
     $translatable->setFallbackLocale($this->localeContext->getFallbackLocale());
     $translatable->setTranslationClass($this->resource->getTranslation()->getModel());
     return $translatable;
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function create(array $options = [])
 {
     return parent::create(array_merge($options, ['locales' => $this->localeContext->getLocales(), 'fallbackLocale' => $this->localeContext->getFallbackLocale(), 'translationFactory' => $this->translationFactory]));
 }