public function get(?string $index, string $text, ?array $params = null)
    {
        if (App::$Request->getLanguage() !== App::$Properties->get('baseLanguage')) {
            if ($index && !Arr::in($index, $this->indexes)) {
                $this->cached = Arr::merge($this->cached, $this->load($index));
                $this->indexes[] = $index;
            }

            if ($this->cached && Any::isStr($text) && isset($this->cached[$text])) {
                $text = $this->cached[$text];
            }
        }

        if (Any::isArray($params) && count($params) > 0) {
            foreach ($params as $var => $value) {
                $text = Str::replace('%' . $var . '%', $value, $text);
            }
        }
        return $text;
    }
public function get(?string $index, string $text, ?array $params = null)
    {
        if (App::$Request->getLanguage() !== App::$Properties->get('baseLanguage')) {
            if ($index && !Arr::in($index, $this->indexes)) {
                $this->cached = Arr::merge($this->cached, $this->load($index));
                $this->indexes[] = $index;
            }

            if ($this->cached && Any::isStr($text) && isset($this->cached[$text])) {
                $text = $this->cached[$text];
            }
        }

        if (Any::isArray($params) && count($params) > 0) {
            foreach ($params as $var => $value) {
                $text = Str::replace('%' . $var . '%', $value, $text);
            }
        }
        return $text;
    }
public function get ( ? string $ index , string $ text , ? array $ params = null ) { if ( App :: $ Request -> getLanguage ( ) !== App :: $ Properties -> get ( 'baseLanguage' ) ) { if ( $ index && ! Arr :: in ( $ index , $ this -> indexes ) ) { $ this -> cached = Arr :: merge ( $ this -> cached , $ this -> load ( $ index ) ) ; $ this -> indexes [ ] = $ index ; } if ( $ this -> cached && Any :: isStr ( $ text ) && isset ( $ this -> cached [ $ text ] ) ) { $ text = $ this -> cached [ $ text ] ; } } if ( Any :: isArray ( $ params ) && count ( $ params ) > 0 ) { foreach ( $ params as $ var => $ value ) { $ text = Str :: replace ( '%' . $ var . '%' , $ value , $ text ) ; } } return $ text ; }
Get internalization of current text from i18n
@param string $index
@param string $text
@param array|null $params
@return string
Get internalization of current text from i18n