Fix in translations
This commit is contained in:
parent
516b47a779
commit
4fc6e59885
2 changed files with 33 additions and 8 deletions
|
|
@ -46,16 +46,26 @@ ${csrf_token("csrf_token")|n}
|
||||||
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
|
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
|
||||||
$('#send_text').show();
|
|
||||||
$('#saving').hide();
|
$('#saving').hide();
|
||||||
$('.flash').show();
|
|
||||||
//$('#container_translation').prepend("<div class=\"flash\" >${lang('admin', 'translation_saved_sucessfully', 'Translation saved sucessfully')}</div><script>setTimeout(function () { $(\".flash\").fadeOut(1000, function () { $('.flash').remove(); }); }, 3000);<\/script>");
|
|
||||||
|
|
||||||
setTimeout(function () {
|
if(!data.error) {
|
||||||
|
|
||||||
|
$('#send_text').show();
|
||||||
|
$('.flash').show();
|
||||||
|
|
||||||
$(".flash").fadeOut(1000)
|
setTimeout(function () {
|
||||||
|
|
||||||
|
$(".flash").fadeOut(1000)
|
||||||
|
|
||||||
|
}, 3000);
|
||||||
|
|
||||||
}, 3000);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
alert('Error: cannot update the translations');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function (data) {
|
error: function (data) {
|
||||||
|
|
|
||||||
|
|
@ -119,17 +119,32 @@ def admin(**args):
|
||||||
file_lang+="I18n.l['"+lang+"']['"+selected_module+"']['"+key+"']='"+I18n.l[lang][selected_module][key].replace("'", "\\'")+"'\n\n"
|
file_lang+="I18n.l['"+lang+"']['"+selected_module+"']['"+key+"']='"+I18n.l[lang][selected_module][key].replace("'", "\\'")+"'\n\n"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
error=0
|
||||||
|
|
||||||
if z>0:
|
if z>0:
|
||||||
|
|
||||||
final_file='modules/'+selected_module+'/i18n/'+selected_module+'.py'
|
final_file='modules/'+selected_module+'/i18n/'+selected_module+'.py'
|
||||||
|
|
||||||
|
old_file=''
|
||||||
|
|
||||||
|
with open(final_file, 'r') as f:
|
||||||
|
old_file=f.read()
|
||||||
|
|
||||||
|
|
||||||
f=open(final_file, 'w')
|
f=open(final_file, 'w')
|
||||||
|
|
||||||
f.write(file_lang)
|
try:
|
||||||
|
|
||||||
|
f.write(file_lang)
|
||||||
|
|
||||||
|
except:
|
||||||
|
|
||||||
|
f.write(old_file)
|
||||||
|
error=1
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
return {'error': 0}
|
return {'error': error}
|
||||||
|
|
||||||
|
|
||||||
return t.load_template('utils/translations.phtml', modules=module_final, selected_module=selected_module, form_module=form_module, arr_i18n_form=arr_i18n_form)
|
return t.load_template('utils/translations.phtml', modules=module_final, selected_module=selected_module, form_module=form_module, arr_i18n_form=arr_i18n_form)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue