• Hello there.

    I am using MSLS on a website with two languages. ‘de’ and ‘en’.
    My customer uses the admin bar, which i never use, and he reported the following:

    when on the german site (‘/’ vs. ‘/en’), all the links in the admin bar point to the ‘en’ backend. And the ‘en’ site is always selected in the dropdown on the left, no matter what is actually selected in the actual backend. Language of the german Backend is ‘de’ and the language of the user in question is explicitly set to be ‘german’.

    Is this, could this be a thing happening because of/coming from MSLS ??
    If so, does anybody know a solution to this ??
    If not, does anybody know where to look further in regards of this ??

    Thank you very much for reading, all help is very welcome.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    Are there any filters/actions in use that are provided by MSLS. In the functions.php for example?

    Thread Starter notknow

    (@notknow)

    Thank you for your reply.

    Not directly, i suppose, in the way you think of, i have this

    //# translate msls slugs 
    
    function my_msls_options_get_permalink($url) {
    
    	$current_blog_id = get_current_blog_id();
    
    	if ($current_blog_id === 2) {
    		$url = str_replace('/archiv/ausstellung/', '/archive/exhibition/', $url);
    		$url = str_replace('/archiv/veranstaltung/', '/archive/event/', $url);
    	}
    
    	else {
    		$url = str_replace('/archive/exhibition/', '/archiv/ausstellung/', $url);
    		$url = str_replace('/archive/event/', '/archiv/veranstaltung/', $url);
    	}
    
    	return $url;
    }
    
    add_filter('msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2);

    What else could i look for ??

    • This reply was modified 4 years, 3 months ago by notknow.
    • This reply was modified 4 years, 3 months ago by notknow.
    Plugin Author Dennis Ploetner

    (@realloc)

    Interesting problem. I would say that there is a chance that there is another plugin involved. Can you exclude this?

    BTW msls_options_get_permalink has also a second parameter. ??

    /**
     * @param string $postlink
     * @param string $language
     * @return string
     */
    function my_msls_options_get_permalink( $url, $language ) {
        if ( 'de_DE' == $language ) {
            $url = str_replace( '/products/', '/produkte/', $url );
        }
        return $url;
    }
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );
    Thread Starter notknow

    (@notknow)

    Yup, here ??

    That second parameter is indeed helpful, thank you.

    Your question, “Can you exclude this?” is an interesting one, too. This will take a bit, will get back to you.

    Thanks for your support!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Admin bar (toolbar) always links to ‘en’’ is closed to new replies.