public function trans(string $value, string $lang = null):?string
    {
        $locale = $this->applocale;
        if (null !== $lang) {
            $this->applyMatchLocale($lang);
        }

        if (in_array($locale->getTranstype(), $this->transType)) {
            switch ($locale->getTranstype()) {
                case 'poedit':
                    return (_($value));
                   break;
                case 'json':
                    $file = JsonListener::open(FEnv::get("app.locale.content.file"));
                    return ($file->$value);
                    break;
            }
        }
        return (null);
    }
public function trans(string $value, string $lang = null):?string
    {
        $locale = $this->applocale;
        if (null !== $lang) {
            $this->applyMatchLocale($lang);
        }

        if (in_array($locale->getTranstype(), $this->transType)) {
            switch ($locale->getTranstype()) {
                case 'poedit':
                    return (_($value));
                   break;
                case 'json':
                    $file = JsonListener::open(FEnv::get("app.locale.content.file"));
                    return ($file->$value);
                    break;
            }
        }
        return (null);
    }
public function trans ( string $ value , string $ lang = null ) : ? string { $ locale = $ this -> applocale ; if ( null !== $ lang ) { $ this -> applyMatchLocale ( $ lang ) ; } if ( in_array ( $ locale -> getTranstype ( ) , $ this -> transType ) ) { switch ( $ locale -> getTranstype ( ) ) { case 'poedit' : return ( _ ( $ value ) ) ; break ; case 'json' : $ file = JsonListener :: open ( FEnv :: get ( "app.locale.content.file" ) ) ; return ( $ file -> $ value ) ; break ; } } return ( null ) ; }
Translate a word
@param string $value Value to translate
@param string $lang lang value
@return null|string The translation
@throws Server500
Translate a word