protected function findTranslationByLocale($locale, $withNewTranslations = true)
    {
        $translation = $this->getTranslations()->get($locale);

        if ($translation) {
            return $translation;
        }

        if ($withNewTranslations) {
            return $this->getNewTranslations()->get($locale);
        }
    }
protected function findTranslationByLocale($locale, $withNewTranslations = true)
    {
        $translation = $this->getTranslations()->get($locale);

        if ($translation) {
            return $translation;
        }

        if ($withNewTranslations) {
            return $this->getNewTranslations()->get($locale);
        }
    }
protected function findTranslationByLocale ( $ locale , $ withNewTranslations = true ) { $ translation = $ this -> getTranslations ( ) -> get ( $ locale ) ; if ( $ translation ) { return $ translation ; } if ( $ withNewTranslations ) { return $ this -> getNewTranslations ( ) -> get ( $ locale ) ; } }
Finds specific translation in collection by its locale.

@param string $locale              The locale (en, ru, fr)
@param bool   $withNewTranslations searched in new translations too

@return Translation|null
Finds specific translation in collection by its locale .