Support » Plugin: qTranslate X » ‘translate_url’ filter

  • Hi there.

    At current state the ‘translate_url’ filter returns url with language at the end, even if this language is default and the option ‘hide_default_language’ is enabled.
    May be this will do the job:

    public function translate_url($url, $lang=null) {
        global $q_config;
        if(!$lang) $lang = $q_config['language'];
        $showLanguage = !$q_config['hide_default_language'] || $lang != $q_config['default_language'];
        return qtranxf_get_url_for_language($url, $lang, $showLanguage);
    }

    instead of current:

    public function translate_url($url, $lang=null) {
        global $q_config;
        if($lang){
            $showLanguage = true;
        }else{
            $lang = $q_config['language'];
            $showLanguage = !$q_config['hide_default_language'] || $lang != $q_config['default_language'];
        }
        return qtranxf_get_url_for_language($url, $lang, $showLanguage);
    }
  • The topic ‘‘translate_url’ filter’ is closed to new replies.