I’m using the newest WordPress 3.3.1 and newest qTranslate 2.5.27. I have made some an AJAX script which returns a value and message in the current language.
Here I get my first problem, I solve it by sending in AJAX lang
from qtrans_getLanguage()
and using messages with qtrans_use($lang, '<!--:pl-->PL message<!--:--><!--:de-->DE message<!--:-->');
I have an wp_option in DB: 'example' = '<!--:pl-->polish text<!--:--><!--:de-->deutschland text<!--:-->'
and when using get_option('example')
I am always getting Polish text
.
I was trying to setlocale
in PHP but without any positive result.
get_option()
is working correctly in any php WordPress file or template, but not in my AJAX…
EDIT:
In template:
$.post('<?php echo get_bloginfo( 'template_url' ); ?>/sendmail.php', {
message: input_message,
lang: input_lang
}
In sendmail.php:
'destination_email' is set to '<!--:pl-->x@x.pl<!--:--><!--:de-->x@x.de<!--:-->'
$mail = _e(get_option('destination_email'));
Always getting Polish email… even
'setlocale(LC_ALL, 'de_DE')'
Now I’m using hardcode email
$mail = qtrans_use($lang, '<!--:pl-->x@x.pl<!--:--><!--:de-->x@x.de<!--:-->');
…