diff --git a/site/libs/common.php b/site/libs/common.php index c3bc936d..0bc5f671 100644 --- a/site/libs/common.php +++ b/site/libs/common.php @@ -82,6 +82,12 @@ function get_locale() { if( !$locale || !in_array($locale,$available_locales) ) $locale = get_user_locale(); + + $useragent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ""; + if( $locale == 'ru' && preg_match( "/googlebot[\\s\/]?(\\d+(\\.\\d+)?)/", $useragent) ) { + $locale = "en"; + } + return $locale; }