// fix admin Language (javascript check lang for iso)

This commit is contained in:
mMarinetti
2011-12-30 16:06:04 +00:00
parent 2438199e27
commit fe5c848e99
+23 -16
View File
@@ -24,27 +24,34 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
function checkLangPack(){ function checkLangPack(token){
$('p#resultCheckLangPack').hide();
if ($('#iso_code').val().length == 2) if ($('#iso_code').val().length == 2)
{ {
$.ajax( doAdminAjax(
{ {
url: "ajax_lang_packs.php", controller:'AdminLanguages',
cache: false, action:'checkLangPack',
data: {iso_lang:$('#iso_code').val(), ps_version:$('#ps_version').val()}, token:token,
dataType : 'json', ajax:1,
success: function(ret) iso_lang:$('#iso_code').val(),
ps_version:$('#ps_version').val()
},
function(ret)
{ {
if(typeof ret == 'object') ret = $.parseJSON(ret);
$('p#resultCheckLangPack').html(langPackOk+' <b>'+ret.name+'</b>) :'+'<br />'+langPackVersion+''+ret.version+' <a href="http://www.prestashop.com/download/lang_packs/gzip/'+ret.version+'/'+$('#iso_code').val()+'.gzip" target="_blank" class="link">'+download+'</a><br />'+langPackInfo).show("slow"); if( ret.status == 'ok')
else if (ret == "offline") {
$('p#resultCheckLangPack').show('slow'); content = $.parseJSON(ret.content);
message = langPackOk + ' <b>'+content['name'] + '</b>) :'
+'<br />' + langPackVersion + ' ' + content['version']
+ ' <a href="http://www.prestashop.com/download/lang_packs/gzip/' + content['version'] + '/'
+ $('#iso_code').val()+'.gzip" target="_blank" class="link">'+download+'</a><br />' + langPackInfo;
showSuccessMessage(message);
} }
}); else
showErrorMessage(ret.error);
}
);
} }
} }
$(document).ready(function() {
$('p#resultCheckLangPack').hide();
});