Article written by Boring-Group

I am a Sound Engineer turned entrepreneur. CEO of Boring Group Ltd. I am what could be called a cinemaphile crossed with a audiophile.

9 responses to “How to load plugin translation .mo files with qtranslate”

  1. Alex

    Hi,
    thanks for that article… i was hoping it could help me… but it don’t. I think i don’t see my mistake in this place. Working with woo commerce and on of their templates. All languages files available and can be found under …plugins/woocommerce/lanuages/woothems-xx-xx.mo. I was modifying your code to:
    if ( function_exists(‘qtrans_getLanguage’) ) { $locale = qtrans_getLanguage(); load_textdomain(‘woothemes’, realpath(dirname(__FILE__) . ‘/../..’) . ‘/plugins/woocommerce/woothemes-’ . $locale . ‘.mo’); }
    But its not working. I’m so frustrated that i have to ask you for help.
    Thanks and Regards from the Med.
    Alex

  2. xDk

    Dont works for me ;/
    testet several times on woocomerce, dont work

  3. Developer

    Nice Clients :D

  4. 404

    For the people having troubles, check the paths, mo files are usually named something as ‘plugin-en_GB.mo’ but &locale will give you back only an ‘en’ flag.
    This solution is excellent, but you need to be sure you are pointing to the right thing.

    This is how I got it working with Jigoshop for a spanish-english site:

    if ( function_exists(‘qtrans_getLanguage’) ) {
    $locale = qtrans_getLanguage();
    if ($locale == ‘es’){
    load_textdomain(‘jigoshop’, realpath(dirname(__FILE__) . ‘/../..’) . ‘/plugins/jigoshop/languages/jigoshop-es_ES.mo’);
    }else{
    load_textdomain(‘jigoshop’, realpath(dirname(__FILE__) . ‘/../..’) . ‘/plugins/jigoshop/languages/jigoshop-en_GB.mo’);
    }
    }

    Many thanks

  5. Cicero Ril

    Res Ipsa Loquitur -the facts speak for themselves!

  6. Guillaume

    Thanks a lot for this… I’ve been scratching my head during a few hours before realizing qTranslate was the culprit. Then I found this page and now everything works fine :)

Leave a Reply

CommentLuv Enabled