I’m working with installing the qTranslate multi-language plugin on a WordPress site. The site has a custom plugin from before which complicates things. This question concerns some cases where qTranslate fails to translate Gettext marked strings (_e
, etc). In these cases, I can verify the qTranslate language and WordPress locale correctly, as near as the line before the Gettext calls, like so:
<pre>lang: <?php echo qtrans_getLanguage(); ?></pre>
<p class="message"><?php _e('Cart is empty.', 'myplugin'); ?></p>
The string will be output in the language set to default in qTranslate, regardless of the current language. So here’s a typical output where Swedish is the default language:
lang: en
Varukorgen är tom.
I understand that you can’t see from this summary exactly what is wrong. But can you help me by suggesting what could be possible causes for this behaviour?
Hint: Ajax might be involved, but honestly I’m a bit confused to see if that’s really true.
The
load_plugin_textdomain
call should be inside an init function, so instead ofI did
and it worked.