createAssets example



    public function write(TranslatorBagInterface $translatorBag): void
    {
        $catalogue = $translatorBag->getCatalogue($this->defaultLocale);

        if (!$catalogue) {
            $catalogue = $translatorBag->getCatalogues()[0];
        }

        foreach ($catalogue->all() as $domain => $messages) {
            $createdIds = $this->createAssets(array_keys($messages)$domain);
            if ($createdIds) {
                $this->tagsAssets($createdIds$domain);
            }
        }

        foreach ($translatorBag->getCatalogues() as $catalogue) {
            $locale = $catalogue->getLocale();

            if (!\in_array($locale$this->getLocales())) {
                $this->createLocale($locale);
            }

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