public function trans($toTranslate, $params = [], $forceLang = '')
    {
        $toTranslate = strtolower($toTranslate);
        $this->_getParams($toTranslate, $params);
        $toTranslate = trim($toTranslate);
        // If there isn't a dot we'll append one just to avoid the "undefined offset 1" warning
        if (false === strpos('.', $toTranslate)) {
            $toTranslate .= '.';
        }

        list($fileName, $key) = $this->parseFileKey($toTranslate);
        $langArray = $this->langFile($fileName, $forceLang);

        $value = isset($langArray[$key]) ? $langArray[$key] : $key;
        if (is_numeric(strpos($value, ':'))
            && !empty($params)
            && is_array($params)
        ) {
            $value = $this->_setParams($value, $params);
        }

        return $value;
    }
public function trans($toTranslate, $params = [], $forceLang = '')
    {
        $toTranslate = strtolower($toTranslate);
        $this->_getParams($toTranslate, $params);
        $toTranslate = trim($toTranslate);
        // If there isn't a dot we'll append one just to avoid the "undefined offset 1" warning
        if (false === strpos('.', $toTranslate)) {
            $toTranslate .= '.';
        }

        list($fileName, $key) = $this->parseFileKey($toTranslate);
        $langArray = $this->langFile($fileName, $forceLang);

        $value = isset($langArray[$key]) ? $langArray[$key] : $key;
        if (is_numeric(strpos($value, ':'))
            && !empty($params)
            && is_array($params)
        ) {
            $value = $this->_setParams($value, $params);
        }

        return $value;
    }
public function trans ( $ toTranslate , $ params = [ ] , $ forceLang = '' ) { $ toTranslate = strtolower ( $ toTranslate ) ; $ this -> _getParams ( $ toTranslate , $ params ) ; $ toTranslate = trim ( $ toTranslate ) ; // If there isn't a dot we'll append one just to avoid the "undefined offset 1" warning if ( false === strpos ( '.' , $ toTranslate ) ) { $ toTranslate .= '.' ; } list ( $ fileName , $ key ) = $ this -> parseFileKey ( $ toTranslate ) ; $ langArray = $ this -> langFile ( $ fileName , $ forceLang ) ; $ value = isset ( $ langArray [ $ key ] ) ? $ langArray [ $ key ] : $ key ; if ( is_numeric ( strpos ( $ value , ':' ) ) && ! empty ( $ params ) && is_array ( $ params ) ) { $ value = $ this -> _setParams ( $ value , $ params ) ; } return $ value ; }
Return the translation word by key

@param string $toTranslate Key from the file
@param array $params Optional params
@param string $forceLang Force a language
@return string The translation
Return the translation word by key