source/Core/Language.php
public function translateString($sStringToTranslate, $iLang = null, $blAdminMode = null)
    {
        $this->setIsTranslated();
        // checking if in cache exist
        $aLang = $this->_getLangTranslationArray($iLang, $blAdminMode);
        if (isset($aLang[$sStringToTranslate])) {
            return $aLang[$sStringToTranslate];
        }

        // checking if in map exist
        $aMap = $this->_getLanguageMap($iLang, $blAdminMode);
        if (isset($aMap[$sStringToTranslate], $aLang[$aMap[$sStringToTranslate]])) {
            return $aLang[$aMap[$sStringToTranslate]];
        }

        // checking if in theme options exist
        if (count($this->_aAdditionalLangFiles)) {
            $aLang = $this->_getLangTranslationArray($iLang, $blAdminMode, $this->_aAdditionalLangFiles);
            if (isset($aLang[$sStringToTranslate])) {
                return $aLang[$sStringToTranslate];
            }
        }

        $this->setIsTranslated(false);

        if (!$this->isTranslated()) {
            Registry::getLogger()->warning(
                "translation for $sStringToTranslate not found",
                compact('iLang', 'blAdminMode')
            );
        }

        return $sStringToTranslate;
    }
public function translateString($sStringToTranslate, $iLang = null, $blAdminMode = null)
    {
        $this->setIsTranslated();
        // checking if in cache exist
        $aLang = $this->_getLangTranslationArray($iLang, $blAdminMode);
        if (isset($aLang[$sStringToTranslate])) {
            return $aLang[$sStringToTranslate];
        }

        // checking if in map exist
        $aMap = $this->_getLanguageMap($iLang, $blAdminMode);
        if (isset($aMap[$sStringToTranslate], $aLang[$aMap[$sStringToTranslate]])) {
            return $aLang[$aMap[$sStringToTranslate]];
        }

        // checking if in theme options exist
        if (count($this->_aAdditionalLangFiles)) {
            $aLang = $this->_getLangTranslationArray($iLang, $blAdminMode, $this->_aAdditionalLangFiles);
            if (isset($aLang[$sStringToTranslate])) {
                return $aLang[$sStringToTranslate];
            }
        }

        $this->setIsTranslated(false);

        if (!$this->isTranslated()) {
            Registry::getLogger()->warning(
                "translation for $sStringToTranslate not found",
                compact('iLang', 'blAdminMode')
            );
        }

        return $sStringToTranslate;
    }
public function translateString ( $ sStringToTranslate , $ iLang = null , $ blAdminMode = null ) { $ this -> setIsTranslated ( ) ; // checking if in cache exist $ aLang = $ this -> _getLangTranslationArray ( $ iLang , $ blAdminMode ) ; if ( isset ( $ aLang [ $ sStringToTranslate ] ) ) { return $ aLang [ $ sStringToTranslate ] ; } // checking if in map exist $ aMap = $ this -> _getLanguageMap ( $ iLang , $ blAdminMode ) ; if ( isset ( $ aMap [ $ sStringToTranslate ] , $ aLang [ $ aMap [ $ sStringToTranslate ] ] ) ) { return $ aLang [ $ aMap [ $ sStringToTranslate ] ] ; } // checking if in theme options exist if ( count ( $ this -> _aAdditionalLangFiles ) ) { $ aLang = $ this -> _getLangTranslationArray ( $ iLang , $ blAdminMode , $ this -> _aAdditionalLangFiles ) ; if ( isset ( $ aLang [ $ sStringToTranslate ] ) ) { return $ aLang [ $ sStringToTranslate ] ; } } $ this -> setIsTranslated ( false ) ; if ( ! $ this -> isTranslated ( ) ) { Registry :: getLogger ( ) -> warning ( "translation for $sStringToTranslate not found" , compact ( 'iLang' , 'blAdminMode' ) ) ; } return $ sStringToTranslate ; }
Searches for translation string in file and on success returns translation,
otherwise returns initial string.

@param string $sStringToTranslate Initial string
@param int    $iLang              optional language number
@param bool   $blAdminMode        on special case you can force mode, to load language constant from admin/shops language file

@return string
Searches for translation string in file and on success returns translation otherwise returns initial string .