@alexgff
I finally got some time to check out what is wrong with the redirect feature and… surprise! It doesn’t work exactly like I guessed. This probably is the case for any variation of one language.
I didn’t test the actual cookie setting yet because I honestly have no experience with this kind of thing, but I threw this piece of code while on the /br page of my website:
<?php
$lang1 = WPGlobus::Config()->language; // how you guys usually check for language
$redirect1 = substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ); //line used on redirect
echo "<h1> Your browser language is " . $lang1 . " while redirect thinks it is " . $redirect1 ."</h1>"
?>
And the result was…
“Your browser language is br while redirect thinks it is pt”
The two variables you’re using are conflicting.
The issue is probably not with the actual object trying to redirect but how it is comparing, like I stated before, WP-globus set in Brazilian Portuguese considers it as “br”, logically so because it wants to differ itself from “pt”.
However browsers present themselves as “pt-br” ALWAYS, and so do web pages on html’s lang property. the substr is taking the “pt”, looks up if my the website has a “pt” lang, which it doesn’t, and doesn’t redirect.
Again, I could be wrong, because I didn’t find what is using public static function redirect( $language ) {
But this is most likely what it seems to be.
Now for my case I’ll likely throw an if statement on the redirect object and pray I remember that if the software updates. But this is a problem that is probably making many users not even know their website is not redirecting, and undermining your own work.
I know I’m no one to ask you guys to fix a service you’re doing for free, and I’m not. However, please perhaps next time not just dismiss a report and mark as solved?