I have the following problem. I'm translating a website in 2 languages - Bulgarian and English.

Let say that I search a page in Bulgarian. The results that google disply are in Bulgarian language, but when I click on one of the links(google results) it loads the English version of the page, not Bulgarian.

I'm looking for a solution for this problem, but I can't find anything.

  • add this code in functions.php file add_action('init',function(){ echo get_locale(); exit; }); it should print bg_BG. otherwise, you can check by accessing your website like website.com/?lang=bg . try this
    – GKS
    Commented Nov 26, 2016 at 10:35
  • Hi, Thank you for the advice. I will try it and I will post an update. Commented Nov 26, 2016 at 14:15

1 Answer 1


Problem is that events callendar is inited before qtranslate, Tribe__Events__Main::instance() :

       // let's initialize tec silly-early to avoid fatals with upgrades from 3.x to 4.x
        add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ), 0 );

simple hack was to create a plugin named 1fix with code:

 add_action( 'plugins_loaded', '__fix_tribe_init', 0 );

  function __fix_tribe_init(){
     global $locale;

     if(preg_match('/^\/ru\//',$_SERVER['REQUEST_URI'])) {
         $locale = 'ru_RU';

that completely solved my problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.