Remove the catalog(s) from the cache

@param  array | string $locale
@param  array | string $domain
@return bool
779579
public function removeCatalogs($locale = null, $domain = null) {
		$cache = $this->getCacheFrontend();
		
		if (is_array($locale)) {
			return $cache->removeMany($locale);
		}
		
		return $cache->remove($locale);
	}
1197107
public function delete($key, $localOnly = false)
    {
        $cacheKey = $this->cacheKey($key);
        if($this->keepLocalCache)
            unset($this->localCache[$cacheKey]);
        if(!$localOnly)
            return $this->cacheStore->delete($cacheKey);

        return true;
    }
633839
public function getCatalogs($locale = null, $domain = null) {
		if ($locale === null && $domain === null) {
			return $this->catalogs;
		}
		
		if (is_string($locale)) {
			return $this->getSingleCatalog($locale, $domain);
		}
		
		if (is_array($locale)) {
			return $this->getManyCatalogs($locale, $domain);
		}
		
		throw new InvalidParameter('Locale must be a string or an array');
	}
1164518
private function buildContent($locale, $domain)
    {
        $translations = [];
        $resources = [];

        if ($locale !== $this->fallbackLocale) {
            $fallbackCatalogue = $this->translator->getCatalogue($this->fallbackLocale);
            $resources = array_merge($resources, $fallbackCatalogue->getResources());
            $translations = array_merge($translations, $this->extractor->extract($fallbackCatalogue, $domain));
        }

        $catalogue = $this->translator->getCatalogue($locale);
        $resources = array_merge($resources, $catalogue->getResources());
        $translations = array_merge($translations, $this->extractor->extract($catalogue, $domain));

        $content = $this->builder->build($translations, $locale);

        return new ResourceContent($content, $resources);
    }
1161870
public function findForLocalesAndDomains(array $locales, array $domains)
    {
        return FileQuery::create()
            ->_if(count($locales) > 0)
                ->filterByLocale($locales, Criteria::IN)
            ->_endif()

            ->_if(count($domains) > 0)
                ->filterByDomain($domains, Criteria::IN)
            ->_endif()

            ->find($this->getConnection())
        ;
    }
550949
protected function filterLocale(Locale $locale)
    {
        $language = substr($locale->locale, 0, 2);

        $this->addLocale($locale->locale);
        $this->addLocale($language);
    }
676540
protected function ignoreMissingMessage($locale, $domain, $messageId, $config)
    {
        if (!isset($config['ignore_missing_messages'])) {
            return false;
        }
        if (!isset($config['ignore_missing_messages'][$domain])) {
            return false;
        }

        foreach ([$locale, 'all'] as $lang) {
            if (isset($config['ignore_missing_messages'][$domain][$lang]) && in_array($messageId, $config['ignore_missing_messages'][$domain][$lang])) {
                return true;
            }
        }

        return false;
    }
344726
public function delete($key, $group = null, $locale = null) {
        $locale = $this->locale($locale);

        $translation = $this->getRepository()
            ->getByKey($key, $locale, $group);

        if( isset($translation->id) )
            $this->getRepository()
                ->removeById($translation->id);

        #@todo need to refresh cache .

        return true;
    }
153
public static function getLocales($domain = null)
    {
        // Optionally filter by domain
        $domainObj = Domain::getByDomain($domain);
        if ($domainObj) {
            return $domainObj->getLocales();
        }

        return Locale::getCached();
    }
402149
public function resetForLocale(LocaleEntity $locale)
    {
        $this->createQueryBuilder('t')
            ->delete()
            ->where('t.locale = :locale')->setParameter('locale', $locale)
            ->getQuery()->execute();
    }
1256986
public function hasFixtureInstalled($domain, $keyword, $locale)
    {
        $criteria = array('domain' => $domain, 'keyword' => $keyword, 'locale' => $locale);

        return $this->repo->findOneBy($criteria) instanceof Entity;
    }
578017
public function removeTranslation($locale = null) {
        $translation = $this->translate($locale);

        if(! is_null($translation))
            $translation->delete();

        return $this;
    }
460503
public function getAllByLocaleAndDomain($locale, $domain)
    {
        $results = $this->createQueryBuilder()
            ->hydrate(false)
            ->field('domain')->equals($domain)
            ->field('translations.locale')->equals($locale)
            ->sort('key', 'asc')
            ->getQuery()
            ->execute();

        $values = array();
        foreach ($results as $item) {
            $i = 0;
            $index = null;
            while ($i < $item['translations'] && null === $index) {
                if ($item['translations'][$i]['locale'] == $locale) {
                    $index = $i;
                }
                $i++;
            }
            $item['translations'] = array($item['translations'][$i - 1]);
            $values[] = $item;
        }

        return $values;
    }
813816
private function writeCatalogue(MessageCatalogueInterface $catalogue, $locale, $domain)
    {
        $resources = $catalogue->getResources();
        $options = $this->options;
        $written = false;
        foreach ($resources as $resource) {
            $path = (string) $resource;
            if (preg_match('|/'.$domain.'\.'.$locale.'\.([a-z]+)$|', $path, $matches)) {
                $options['path'] = str_replace($matches[0], '', $path);
                $this->writer->write($catalogue, $matches[1], $options);
                $written = true;
            }
        }

        if ($written) {
            // We have written the translation to a file.
            return;
        }

        $options['path'] = reset($this->dir);
        $format = isset($options['default_output_format']) ? $options['default_output_format'] : 'xlf';
        $this->writer->write($catalogue, $format, $options);
    }
168571
public function forgetTranslation(string $key, string $locale)
    {
        $translations = $this->getTranslations($key);

        unset($translations[ $locale ]);

        $this->setAttribute($key, $translations);

        return $this;
    }
1102993
public function build($locale, $domain = 'gui')
    {
        $cache = new ConfigCache($this->cacheDir.'/translations-'.$locale.'.js', $this->debug);

        if (!$cache->isFresh()) {
            $content = $this->buildContent($locale, $domain);

            $cache->write($content->getContent(), $content->getResources());

            if (!$this->debug) {
                $this->compressor->compressFile((string) $cache);
            }
        }

        return new Asset((string) $cache);
    }
424957
protected function clearCache( array $ids, $domain = null )
	{
		$domain = ( $domain !== null ? $domain : strtolower( $this->name ) );
		$tags = array( $domain );

		foreach( $ids as $id ) {
			$tags[] = $domain . '-' . $id;
		}

		$this->context->getCache()->deleteByTags( $tags );
	}