public function getTranslation($locale, $create = false, $fallback = false)
    {
        foreach ($this->translations as $translation) {
            if ($translation->getLocale() == $locale) {
                return $translation;
            }
        }

        if ($create) {
            $translation = new FormTranslation();
            $translation->setLocale($locale);

            return $translation;
        }

        if ($fallback) {
            return $this->getTranslation($this->getDefaultLocale());
        }

        return;
    }
public function getTranslation($locale, $create = false, $fallback = false)
    {
        foreach ($this->translations as $translation) {
            if ($translation->getLocale() == $locale) {
                return $translation;
            }
        }

        if ($create) {
            $translation = new FormTranslation();
            $translation->setLocale($locale);

            return $translation;
        }

        if ($fallback) {
            return $this->getTranslation($this->getDefaultLocale());
        }

        return;
    }
public function getTranslation ( $ locale , $ create = false , $ fallback = false ) { foreach ( $ this -> translations as $ translation ) { if ( $ translation -> getLocale ( ) == $ locale ) { return $ translation ; } } if ( $ create ) { $ translation = new FormTranslation ( ) ; $ translation -> setLocale ( $ locale ) ; return $ translation ; } if ( $ fallback ) { return $ this -> getTranslation ( $ this -> getDefaultLocale ( ) ) ; } return ; }
Get translation.

@param string $locale
@param bool $create
@param bool $fallback

@return FormTranslation|null
Get translation .