Redirects back to english although you've chosen Swedish
-
Hello,
We are using MLP and we’re very happy with the architecture the plugin solves. We are a bit confused with the HTTP Redirect feature though. We have implemented a custom language switcher which works well. Except from if people sets English as preferred language in their OS but clicks on Swedish as preferred language on the site.
When someone browse to a Swedish page that has a linguistic relationship to English in the plugin, MLP negotiates the visitor back to English.
The language manager looks like this: http://take.ms/TmMEv
Is there something we could tweak? We get recurring complaints that our WordPress-site loses the memory of the language they prefer.
function mlp_navigation( $between = ' | ', $before = '<p class="mlp-lang-nav">', $after = '</p>' ) { $links = (array) mlp_get_interlinked_permalinks(); if ( empty ( $links ) ) return ''; $items = array (); foreach ( $links as $link ) { if ( isset ( $link['text'] ) ) { $text = $link['text']; } else { // take just the main code $first = strtok( $link['lang'], '_' ); $text = strtoupper( $first ); } $items[] = sprintf( '<a href="%1$s" hreflang="%2$s" rel="alternate">%3$s</a>', esc_url( $link['permalink'] ), esc_attr( $link['lang'] ), $text ); } return join( $between, $items ); }
- The topic ‘Redirects back to english although you've chosen Swedish’ is closed to new replies.