Templating/TranslatableStringHelper.php
public function localize(array $translatableStrings)
    {
        if (NULL === $translatableStrings) {
            return NULL;
        }
        
        $language = $this->requestStack->getCurrentRequest()->getLocale();
        

        if (isset($translatableStrings[$language])) {
            
            return $translatableStrings[$language];
        } else {
            foreach ($this->fallbackLocales as $locale) {
                if (array_key_exists($locale, $translatableStrings)) {
                    
                    return $translatableStrings[$locale];
                }
            }
            
        }
    
        return '';

    }
public function localize(array $translatableStrings)
    {
        if (NULL === $translatableStrings) {
            return NULL;
        }
        
        $language = $this->requestStack->getCurrentRequest()->getLocale();
        

        if (isset($translatableStrings[$language])) {
            
            return $translatableStrings[$language];
        } else {
            foreach ($this->fallbackLocales as $locale) {
                if (array_key_exists($locale, $translatableStrings)) {
                    
                    return $translatableStrings[$locale];
                }
            }
            
        }
    
        return '';

    }
public function localize ( array $ translatableStrings ) { if ( NULL === $ translatableStrings ) { return NULL ; } $ language = $ this -> requestStack -> getCurrentRequest ( ) -> getLocale ( ) ; if ( isset ( $ translatableStrings [ $ language ] ) ) { return $ translatableStrings [ $ language ] ; } else { foreach ( $ this -> fallbackLocales as $ locale ) { if ( array_key_exists ( $ locale , $ translatableStrings ) ) { return $ translatableStrings [ $ locale ] ; } } } return '' ; }
return the string in current locale if it exists.

If it does not exists; return the name in the first language available.

Return a blank string if any strings are available.
Return NULL if $translatableString is NULL

@param array $translatableStrings
@return string
return the string in current locale if it exists .