protected function getTranslation(array $translationData, $default = '')
    {
        // undefined locale
        if (empty($translationData)) {
            return $default;
        }

        // current locale matched
        if ($this->locale && isset($translationData[$this->locale])) {
            return $translationData[$this->locale];
        }

        // default locale matched
        return $this->defaultLocale && isset($translationData[$this->defaultLocale]) ?
            $translationData[$this->defaultLocale] :
            $default
        ;
    }
protected function getTranslation(array $translationData, $default = '')
    {
        // undefined locale
        if (empty($translationData)) {
            return $default;
        }

        // current locale matched
        if ($this->locale && isset($translationData[$this->locale])) {
            return $translationData[$this->locale];
        }

        // default locale matched
        return $this->defaultLocale && isset($translationData[$this->defaultLocale]) ?
            $translationData[$this->defaultLocale] :
            $default
        ;
    }
protected function getTranslation ( array $ translationData , $ default = '' ) { // undefined locale if ( empty ( $ translationData ) ) { return $ default ; } // current locale matched if ( $ this -> locale && isset ( $ translationData [ $ this -> locale ] ) ) { return $ translationData [ $ this -> locale ] ; } // default locale matched return $ this -> defaultLocale && isset ( $ translationData [ $ this -> defaultLocale ] ) ? $ translationData [ $ this -> defaultLocale ] : $ default ; }
return translation matching current locale from given translation data

@param array $translationData
@param string $default

@return string
return translation matching current locale from given translation data