isShopwareLocaleCatalogue example

/** * {@inheritdoc} */
    public function getCatalogue(?string $locale = null): MessageCatalogueInterface
    {
        $catalog = $this->translator->getCatalogue($locale);

        $fallbackLocale = $this->getFallbackLocale();

        $localization = mb_substr($fallbackLocale, 0, 2);
        if ($this->isShopwareLocaleCatalogue($catalog) && !$this->isFallbackLocaleCatalogue($catalog$localization)) {
            $catalog->addFallbackCatalogue($this->translator->getCatalogue($localization));
        } else {
            // fallback locale and current locale has the same localization -> reset fallback             // or locale is symfony style locale so we shouldn't add shopware fallbacks as it may lead to circular references             $fallbackLocale = null;
        }

        // disable fallback logic to display symfony warnings         if ($this->environment !== 'prod') {
            $fallbackLocale = null;
        }

        
Home | Imprint | This part of the site doesn't use cookies.