rex_fragment::i18n PHP Method

i18n() protected method

Translate the given key $key.
protected i18n ( string $key ) : string
$key string The key to translate
return string
    protected function i18n($key)
    {
        if (!is_string($key)) {
            throw new InvalidArgumentException(sprintf('Expecting $key to be a string, %s given!', gettype($key)));
        }
        // use the magic call only when more than one parameter is passed along,
        // to get best performance
        $argNum = func_num_args();
        if ($argNum > 1) {
            // pass along all given parameters
            $args = func_get_args();
            return call_user_func_array(['rex_i18n', 'msg'], $args);
        }
        return rex_i18n::msg($key);
    }