Get the recordset of all the translations of a locale that needs to be reviewed.

@param LocaleEntity $locale

@return PDOStatement
341533
public function getUnreviewedSelectQuery(LocaleEntity $locale)
    {
        $cn = $this->app->make(EntityManager::class)->getConnection();
        $queryLocaleID = $cn->quote($locale->getID());

        return $cn->executeQuery(
            $this->getBaseSelectString($locale, false, false) .
            " inner join
                (
                    select distinct
                        translatable
                    from
                        CommunityTranslationTranslations
                    where
                        locale = $queryLocaleID
                        and
                        (
                            (approved is null)
                            or
                            (current = 1 and approved = 0)
                        )
                ) as tNR on CommunityTranslationTranslatables.id = tNR.translatable
            order by
                CommunityTranslationTranslatables.text
            "
        );
    }
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;
    }
851493
public function getOrCreateTranslationForLocale($locale)
    {
        foreach ($this->getTranslations() as $propelTranslation) {
            if ($propelTranslation->getLocale() == $locale) {
                return $propelTranslation;
            }
        }

        $propelTranslation = new PropelTranslation();
        $propelTranslation->setLocale($locale);
        $this->addTranslation($propelTranslation);

        return $propelTranslation;
    }
85499
public function setLocale($locale)
    {
        $this->locale = LanguageNormalize::toLanguageTag($locale);

        $this->localises[$locale] = null;

        return $this;
    }
1006623
protected function getTranslationOrNew($locale)
    {
        if (($translation = $this->getTranslation($locale)) === null) {
            $translation = $this->createNewTranslation($locale);
        }

        return $translation;
    }
1043569
private function getTranslationByLocale($locale)
    {
        $attributeValueTranslation = null;

        foreach ($this->entity->getTranslations() as $translation) {
            if ($translation->getLocale() == $locale) {
                $attributeValueTranslation = $translation;
                break;
            }
        }

        return $attributeValueTranslation;
    }
1357199
protected function buildTranslations(LocaleEntity $locale, PDOStatement $rs)
    {
        $translations = new Translations();
        $translations->setLanguage($locale->getID());
        $numPlurals = $locale->getPluralCount();
        while (($row = $rs->fetch()) !== false) {
            $translation = new \Gettext\Translation($row['context'], $row['text'], $row['plural']);
            foreach (unserialize($row['locations']) as $location) {
                $translation->addReference($location);
            }
            foreach (unserialize($row['comments']) as $comment) {
                $translation->addExtractedComment($comment);
            }
            if ($row['text0'] !== null) {
                if (!$row['approved']) {
                    $translation->addFlag('fuzzy');
                }
                $translation->setTranslation($row['text0']);
                if ($translation->hasPlural()) {
                    switch ($numPlurals) {
                        case 6:
                            $translation->setPluralTranslation($row['text5'], 4);
                            /* @noinspection PhpMissingBreakStatementInspection */
                        case 5:
                            $translation->setPluralTranslation($row['text4'], 3);
                            /* @noinspection PhpMissingBreakStatementInspection */
                        case 4:
                            $translation->setPluralTranslation($row['text3'], 2);
                            /* @noinspection PhpMissingBreakStatementInspection */
                        case 3:
                            $translation->setPluralTranslation($row['text2'], 1);
                            /* @noinspection PhpMissingBreakStatementInspection */
                        case 2:
                            $translation->setPluralTranslation($row['text1'], 0);
                            /* @noinspection PhpMissingBreakStatementInspection */
                            break;
                    }
                }
            }
            $translations->append($translation);
        }
        $rs->closeCursor();

        return $translations;
    }
940024
protected function getTranslation($key, $locale) {
        if( isset($this->translations[$locale][$key]) )
            return $this->translations[$locale][$key];

        return $key;
    }
1168948
public function findAllByLocale($locale)
    {
        try {
            $qb = $this->getStatusQuery($locale);

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
626204
public function getReference($locale = null)
    {
        $locale = $locale ?: $this->getCurrentLocale();
        if (is_array($this->references) && isset($this->references[$locale])) {
            return $this->references[$locale];
        }
    }
1355686
public function getTranslationFile($locale)
    {
        if (isset($this->locales[$locale]) === false) {
            return null;
        }

        return $this->locales[$locale];
    }
250118
protected function getFormatter($locale) {
		if (! isset($this->formatters[$locale])) {
			$this->formatters[$locale] = new NumberFormatter($locale, NumberFormatter::CURRENCY);
		}
		
		return $this->formatters[$locale];
	}
597828
public function translateOrFirst($locale = null)
    {
        $translation = $this->translate($locale, true);

        if ( ! $translation)
        {
            $translation = $this->translations->first();
        }

        return $translation;
    }
881992
public function getTemplate($locale = null)
    {
        if (!$locale) {
            return $this->fallbackTemplate;
        }

        foreach ($this->i18nTemplates as $templateLocale => $template) {
            if (strtolower($templateLocale) === $locale) {
                return $template;
            }
        }

        return $this->fallbackTemplate;
    }
397690
public function findAllByLocale($locale)
    {
        try {
            $qb = $this->getUnitQuery($locale)
                ->orderBy('unitTranslations.name', 'ASC');

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
403422
protected function getTranslation(string $key, string $locale)
    {
        return $this->translations()
            ->where('key', $key)
            ->where('locale', $locale)
            ->value('translation');
    }
1190523
public static function getLanguageFromLocale($locale)
    {
        if (strpos($locale, '_')) {
            $parts = explode('_', $locale);

            return strtolower($parts[0]);
        }

        return $locale;
    }