// 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
+24 -17
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",
cache: false,
data: {iso_lang:$('#iso_code').val(), ps_version:$('#ps_version').val()},
dataType : 'json',
success: function(ret)
{ {
if(typeof ret == 'object') controller:'AdminLanguages',
$('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"); action:'checkLangPack',
else if (ret == "offline") token:token,
$('p#resultCheckLangPack').show('slow'); ajax:1,
iso_lang:$('#iso_code').val(),
ps_version:$('#ps_version').val()
},
function(ret)
{
ret = $.parseJSON(ret);
if( ret.status == 'ok')
{
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();
});