Closed danito closed 10 years ago
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?
works for me: https://dl.dropboxusercontent.com/u/9898000/Bildschirmfoto%202014-02-20%20um%2023.34.09.png also changed translate() to __(): https://github.com/espresto/reclaim-social-media/blob/master/mod.class.php#L386
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() https://github.com/espresto/reclaim-social-media/commit/4a52a0f43dec3848be78c67a98c302474bcc33d0
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 .