So I've got an English-language theme that I localized to Spanish. It works perfectly fine in Spanish.
But if I change my user profile language to English - so that I can see English on the dashboard - the AJAX-generated content on the site becomes untranslated English.
If I log out, the AJAX-generated content becomes Spanish again.
My guess here is that admin-ajax is loading the USER profile language instead of the theme language, if the user profile language is set.
So my question is: how can I correct this, so that admin-ajax always uses the theme language?
Edit: here's the AJAX call. I'm not sending any text to be translated.
$('#load_more').on('click', function() {
var offset = $('#main-ajax-container').data('offset');
var prefix = $('#main-ajax-container').data('prefix');
var blogid = $('#main-ajax-container').data('blogid');
var fid = $('#main-ajax-container').data('fid');
$.ajax({
type: "get",
url: "wp-admin/admin-ajax.php",
data: {
action: "home_load_more",
siteUrl: "<?php echo get_site_url();?>",
offset: offset,
prefix: prefix,
blogid: blogid,
fid: fid
},
success: function(resp) {
$('#main-ajax-container').append(resp);
offset = parseInt(offset) + 3;
$('#main-ajax-container').data('offset', offset);
var max = $('#main-ajax-container').data('max');
if (offset >= parseInt(max)) {
$('#load_more').addClass('done');
}
}
});
});