espresto/reclaim-social-media

mod.class.php : "remove x posts" no translation

Closed this issue · 6 comments

Can you check line 41?
Translation aren't shown (for fr_FR) for the Remove x posts (ajax) button; I uploaded my latest fr_FR.po file, all the rest seems ok .

line 386 same problem .translate() in place of echo sprintf(__()); This seems not to work with po files.

the Remove x posts remains in en. Do you have it translated in de?

we found no way to translate the ajax strings, those that are not created with php but javascript.

for the buttons: ok, didn't push the latest version. We can close this.
For the JS translation : this will make the adminajax.js less readable, but what about a translations.php

$translation['countitems'] = sprintf(__("count items",'reclaim'));
$translation['itemcountisnotavalid']= sprintf(__('item count is not a valid number','reclaim'));
....
echo json_encode($translation);
}

and for the admin_ajax.js

var translationstrings = {};
function getTranslation(){
$.getJSON('translation.php', function(data){
...
translationstrings = data;
....
    else {
this.ajax_start(translationstrings.countitems);

this.ajax(getTranslationstrings.itemcountisnotavalid, {}, $.proxy(function(result) {
this.ajax_end(result);
}, this));
}
});
}

The ajax call should maybe be synchronous.
But I think you get the idea, to put all the ajax text to display in a php file and get it as json.

ajax localisation added with the help of wp_localize_script() 4a52a0f