public function translate($params, $smarty)
    {
        $translation = '';

        if (empty($params["l"])) {
            throw new RuntimeException('Translation Error. Key is empty.');
        } elseif (empty($params["locale"])) {
            throw new RuntimeException('Translation Error. Locale is empty.');
        } else {
            $inString = (0 !== \intval($params["in_string"]));
            $useDefault = (0 !== \intval($params["use_default"]));

            $translation = $this->translator->trans(
                $params["l"],
                [],
                'install',
                $params["locale"],
                $useDefault
            );

            if (empty($translation)) {
                $translation = ($inString) ? '' : "NULL";
            } else {
                $translation = $this->con->quote($translation);
                // remove quote
                if ($inString) {
                    $translation = substr($translation, 1, -1);
                }
            }
        }

        return $translation;
    }
public function translate($params, $smarty)
    {
        $translation = '';

        if (empty($params["l"])) {
            throw new RuntimeException('Translation Error. Key is empty.');
        } elseif (empty($params["locale"])) {
            throw new RuntimeException('Translation Error. Locale is empty.');
        } else {
            $inString = (0 !== \intval($params["in_string"]));
            $useDefault = (0 !== \intval($params["use_default"]));

            $translation = $this->translator->trans(
                $params["l"],
                [],
                'install',
                $params["locale"],
                $useDefault
            );

            if (empty($translation)) {
                $translation = ($inString) ? '' : "NULL";
            } else {
                $translation = $this->con->quote($translation);
                // remove quote
                if ($inString) {
                    $translation = substr($translation, 1, -1);
                }
            }
        }

        return $translation;
    }
public function translate ( $ params , $ smarty ) { $ translation = '' ; if ( empty ( $ params [ "l" ] ) ) { throw new RuntimeException ( 'Translation Error. Key is empty.' ) ; } elseif ( empty ( $ params [ "locale" ] ) ) { throw new RuntimeException ( 'Translation Error. Locale is empty.' ) ; } else { $ inString = ( 0 !== \ intval ( $ params [ "in_string" ] ) ) ; $ useDefault = ( 0 !== \ intval ( $ params [ "use_default" ] ) ) ; $ translation = $ this -> translator -> trans ( $ params [ "l" ] , [ ] , 'install' , $ params [ "locale" ] , $ useDefault ) ; if ( empty ( $ translation ) ) { $ translation = ( $ inString ) ? '' : "NULL" ; } else { $ translation = $ this -> con -> quote ( $ translation ) ; // remove quote if ( $ inString ) { $ translation = substr ( $ translation , 1 , - 1 ) ; } } } return $ translation ; }
Smarty function that replace the classic `intl` function.

The attributes of the function are:
- `l`: the key
- `locale`: the locale. eg.: fr_FR
- `in_string`: set to 1 not add simple quote around the string. (default = 0)
- `use_default`: set to 1 to use the `l` string as a fallback. (default = 0)

@param $params
@param $smarty
@return string
Smarty function that replace the classic intl function .