Support » Plugin: Multiple Domain » Setting diffrent domains with TranslatePress

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter aschiemann

    (@aschiemann)

    Screenshots of my settings and the displayed URL:
    https://lp1.fragtobi.de/support-bilder/

    Thread Starter aschiemann

    (@aschiemann)

    I found out the problem why it didnt work. It had problems with another plugin. As far as ive researched, there is no way fixing it with this plugin. The other plugin is used for translation and always forced another link, than the given ones.

    I will now either use another translation or domain mapping plugin.
    Anyhow, i will mark this post as resolved

    With best regards
    Aaron Schiemann

    mahii-conception

    (@mahii-conception)

    Hi

    I have the same issue and I’m looking to a solution to map multiple domains with translatepress. Did you find a way ?

    Thanks !

    Thread Starter aschiemann

    (@aschiemann)

    Hello,

    unfortunatly no. The Problem is that the PLugin forces /de /en etc, and also sometinhg named Cors is the problem. Neither TranslatePress nor Polylang, Weglot, etc offers any solution (i’ve contacted everyone). Also the Mapping PLugins cant offer any solutions until now.
    WPML says that there is a way with their, but they dont offer an Test-version and you have to buy it right from the start. (But you have 30 day money-back-guarantee)

    I’ve decided that i just make multiple Pages without translation plugin and Translate them manually so i can Domain Map it properly.

    I hope this helped you :/
    With kind regards

    Aaron

    mahii-conception

    (@mahii-conception)

    Hi

    THank you for your answer, it’s very important to me so I don’t lose my time searching a solution that doesn’t exist.

    With king regards
    Diane

    Plugin Contributor Gustavo Straube

    (@gustavostraube)

    Hello,

    It’s hard to achieve full compatibility with all these translation plugins. Multiple Domain docs even state that the plugin is not compatible with any of them. I mean, it may work, but I’ve not tested all the combinations.

    I hope you guys find a way to work around those limitations. If you have any code-based solution, feel free to submit a PR: https://github.com/straube/multiple-domain/pulls. Or let me know how you fixed it and I can update the plugin when I have a chance.

    Cheers!

    HI !

    I found a way to do this.
    First use translatepress with lang in folder (https://domaine/LANG/slug)

    Second I do URL rewriting in HTACCESS like that :

    # Redirection LANG
    RedirectMatch "^/XX/(.*)" "http://domaine.XX/$1"

    And at least, I use the plugin tp-add-on-language-by-get-parameter to write my own plugin that will change currant langage using the domain extension. Here the code I wrote

    
    // If this file is called directly, abort.
    
    if ( ! defined( 'WPINC' ) ) {
    
    	die;
    
    }
    
    define( 'TRP_GP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    
    define( 'TRP_GP_PLUGIN_VERSION', '1.0.1' );
    
    // If TP is not active, do nothing
    function trp_gp_is_tp_active() {
        if ( class_exists( 'TRP_Translate_Press' ) ) {
            return true;
        }
        else {
            return false;
        }
    }
    
    /**
     * Returns filtered parameter name
     *
     */
    
    function trp_gp_get_parameter_name(){
    	return apply_filters( 'trp_gp_lang_parameter', 'lang' );
    }
    
    /**
     * Returns language from the given url
     *
     * Returns the url-slug, not the language code
     *
     * @param $lang
     * @param $url
     *
     * @return string
     */
    
    function trp_gp_get_lang_from_get( $lang, $url ){
    	$ext = end(explode(".", $_SERVER['HTTP_HOST']));
    
    	if ( isset ( $ext  ) && $ext != '' ){
            $lang = $ext;
            var_dump($lang);
    	} else {
    		$lang = null;
    	}
    	return $lang;
    }
    add_filter( 'trp_get_lang_from_url_string', 'trp_gp_get_lang_from_get', 10, 2 );
    

    @aschiemann You might have some customization and optimization to make it work with yours domains extension but I think the more important is here. It works for me ๐Ÿ™‚

    @gustavostraube I hope it will give you somes ideas, sorry I’m a beginner with Github so I don’t kown how I can make a PR on your project. But I love your translation plugin, I use it with every one of my customer who whant multilingual website, so I hope you can add this feature for the future ๐Ÿ™‚

    Have a nice day !

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.