Hello,
I ended up solving this. There's nothing more annoying than coming across a post with the same issue as yours but no conclusion other than "never mind, I fixed it!" so I'll just put the solution here:
In order to pass across the user's "real" http user agent in gtranslate.php we add in:
$request_headers['X-User-agent'] = $_SERVER['HTTP_USER_AGENT'];
anywhere near the other request_headers lines.
Then we detect if HTTP_X_USER_AGENT is set. If it is we use the X user agent, rather than the incorrect "normal" user agent with code like:
function uagent_info() { $this->useragent = isset($_SERVER['HTTP_USER_AGENT'])?strtolower($_SERVER['HTTP_USER_AGENT']):''; $this->httpaccept = isset($_SERVER['HTTP_ACCEPT'])?strtolower($_SERVER['HTTP_ACCEPT']):''; if(isset($_SERVER['HTTP_X_USER_AGENT'])){ $this->useragent = isset($_SERVER['HTTP_X_USER_AGENT'])?strtolower($_SERVER['HTTP_X_USER_AGENT']):''; } //Let's initialize some values to save cycles later. $this->InitDeviceScan(); }
}
This issue only seemed to affect Google Bot, rather than "actual" customers. I have no idea why but if you're using gtranslate with a mobile and desktop template I'd check that the bot is seeing the mobile template when it should and not the desktop version.
Email me at
[email protected] if you have similar issues.