Fetch just the entries for a specific locale.

@param string $locale
@return SectionTwigExtension
969355
public function locale(string $locale): SectionTwigExtension
    {
        $this->options[ReadOptions::LOCALE] = $locale;

        return $this;
    }
157044
public function findOneByHomepage($locale = 'fr')
    {
        //the query builder
        $qb = $this->getInstance();
        $qb
            ->where($this->mainAlias.'.homepage = true')
            ->andWhere($this->mainAlias.'.status = :status')
            ->setMaxResults(1)
            ->setParameter('status', PageStatus::PUBLISHED);
        // Use Translation Walker
        $query = $qb->getQuery();
        $view = $query->getOneOrNullResult();
        $view->translate($locale);

        return $view;
    }
633805
public function translate($locale) {
		$localeEntity = clone $this;
		$localeEntity->setLocale($locale);
		if(isset($this->data['translations'][$locale]))
			$localeEntity->_set($this->data['translations'][$locale]);
		unset($localeEntity->data['translations'][$locale]);
		$localeEntity->data['translations'][$this->getLocale()] = $this->data['properties'];

		return $localeEntity;
	}
826476
protected function getLocale($locale)
    {
        $result = null;
        if ($locale instanceof LocaleEntity) {
            $result = $locale;
        } elseif (is_string($locale) && $locale !== '') {
            $result = $this->app->make(LocaleRepository::class)->findApproved($locale);
        }

        return $result;
    }
1227704
public static function getLanguage($locale)
    {
        return isset(self::$locales[$locale])
            ? self::$locales[$locale]
            : $locale;
    }
533329
public function getTranslationByLocale($locale)
    {
        foreach ($this->getTranslations() as $valueTranslation) {
            if ($valueTranslation->getLocale() === $locale) {
                return $valueTranslation;
            }
        }

        return null;
    }
797950
public function getLocalization($locale)
    {
        $dataCollection = $this->getLocalizations();
        $data = $dataCollection->get($locale);

        return $data;
    }
355741
protected function getPrefix($locale)
    {
        foreach ($this->localeResolver->getDomainConfig() as $_domain => $_locale) {
            if ($_locale === $locale) {
                $urlPrefix = sprintf('%s://%s', $this->request ? $this->request->getScheme() : 'http', $_domain);
                if ($this->request && $this->request->getPort()) {
                    $urlPrefix .= ':'.$this->request->getPort();
                }

                return $urlPrefix;
            }
        }
    }
247055
public function getByLocale(LocaleEntity $locale)
    {
        $app = Application::getFacadeApplication();
        $result = $this->find($locale);
        if ($result === null) {
            $em = $this->getEntityManager();
            try {
                $numTranslatable = (int) $app->make(TranslatableRepository::class)
                    ->createQueryBuilder('t')
                        ->select('count(t.id)')
                        ->getQuery()->getSingleScalarResult();
            } catch (NoResultException $x) {
                $numTranslatable = 0;
            }
            if ($numTranslatable === 0) {
                $numApprovedTranslations = 0;
            } else {
                try {
                    $numApprovedTranslations = (int) $app->make(TranslationRepository::class)
                    ->createQueryBuilder('t')
                        ->select('count(t.id)')
                        ->where('t.locale = :locale')->setParameter('locale', $locale)
                        ->andWhere('t.current = 1')
                        ->getQuery()->getSingleScalarResult();
                } catch (NoResultException $x) {
                    $numApprovedTranslations = 0;
                }
            }
            $result = LocaleStatsEntity::create($locale, $numTranslatable, $numApprovedTranslations);
            $em->persist($result);
            $em->flush($result);
        }

        return $result;
    }
418228
private function getOrderQuery($locale)
    {
        $qb = $this->createQueryBuilder('o')
            ->leftJoin('o.deliveryAddress', 'deliveryAddress')
            ->leftJoin('o.invoiceAddress', 'invoiceAddress')
            ->leftJoin('o.status', 'status')
            ->leftJoin('status.translations', 'statusTranslations', 'WITH', 'statusTranslations.locale = :locale')
            ->leftJoin('o.items', 'items')
            ->setParameter('locale', $locale);

        return $qb;
    }
649507
public function countryCodeByLocale($locale)
    {
        if (str_contains($locale, ' ')) {
            $locale = str_replace(' ', '-', $locale);
        }

        if (strlen($locale) == 2) {
            if ($locale == 'en') {
                $locale = 'en-US';
            } else {
                $locale = $locale.'-'.strtoupper($locale);
            }
        }

        return Locale::getRegion($locale);
    }
777456
protected function parseLocale($locale)
	{
		if ( ! is_null($locale))
		{
			return array_filter(array($locale, $this->fallback));
		}
		else
		{
			return array_filter(array($this->locale, $this->fallback));
		}
	}
142008
public function getItems($locale, $namespace, $group)
    {
        return $this->model
            ->whereLocale($locale)
            ->whereNamespace($namespace)
            ->whereGroup($group)
            ->get()
            ->toArray();
    }
389845
public function getFieldDescriptors($locale)
    {
        if ($locale !== $this->currentLocale) {
            $this->initializeFieldDescriptors($locale);
        }

        return $this->fieldDescriptors;
    }
408914
public static function getDisplayCountries($locale)
    {
        if (!isset(self::$countries[$locale])) {
            self::$countries[$locale] = Intl::getRegionBundle()->getCountryNames($locale);
        }

        return self::$countries[$locale];
    }
407346
public function getStructure($locale)
    {
        return $this->contentMapper->loadShallowStructureByNode($this->node, $locale, $this->webspace);
    }
599532
public static function getDisplayLocales($locale)
    {
        if (!isset(self::$locales[$locale])) {
            self::$locales[$locale] = Intl::getLocaleBundle()->getLocaleNames($locale);
        }

        return self::$locales[$locale];
    }