1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 14:50:29 +00:00

modified js str with 'trans' for french; improved some code

This commit is contained in:
llj
2013-04-24 17:09:46 +08:00
parent 2c23d4646d
commit 4ad9d23a1e
14 changed files with 1453 additions and 126 deletions

View File

@@ -37,19 +37,19 @@ function changeAvatar(chg_btn, input, form) {
}
}
} else {
feedback(filename + '{% trans " is not supported. Please choose an image file." %}', 'error');
feedback(filename + "{% trans " is not supported. Please choose an image file." %}", 'error');
return false;
}
if (!allow) {
var err_msg = filename + '{% trans " is not supported. File extensions can only be " %}' + allowed_ext.join(', ');
var err_msg = filename + "{% trans " is not supported. File extensions can only be " %}" + allowed_ext.join(', ');
feedback(err_msg, 'error');
return false;
}
// check if file size is less than 1MB
if (file && file.size > 1024*1024) {
feedback(filename + '{% trans " is too large. Allowed maximum size is 1MB." %}', 'error');
feedback(filename + "{% trans " is too large. Allowed maximum size is 1MB." %}", 'error');
return false;
}

View File

@@ -54,12 +54,12 @@ $('#discuss-submit').click(function() {
form_id = form.attr('id');
if (form.find('.checkbox-checked').length == 0) {
apply_form_error(form_id, '{% trans "Please select at least 1 group." %}');
apply_form_error(form_id, "{% trans "Please select at least 1 group." %}");
return false;
}
if (!$.trim($('#discuss-to-group-form .input').val())) {
apply_form_error(form_id, '{% trans "Please input a discussion." %}');
apply_form_error(form_id, "{% trans "Please input a discussion." %}");
return false;
}
form.find('.error').addClass('hide');
@@ -98,7 +98,7 @@ $('#discuss-submit').click(function() {
if (jqXHR.responseText) {
err_str = $.parseJSON(jqXHR.responseText).err;
} else {
err_str = '{% trans "Failed. Please check the network." %}';
err_str = "{% trans "Failed. Please check the network." %}";
}
apply_form_error(form_id, err_str);
}

View File

@@ -38,7 +38,7 @@ window.onload = function () {
{% if filetype == 'SVG' %}
if (!$.browser.mozilla && !$.browser.safari && !($.browser.msie && parseInt($.browser.version) > 8)) {
$('#file-view').html('<div id="file-view-tip"><p>{% trans "To view it online, you can use firefox, chrome or IE 9." %}</p></div>');
$('#file-view').html('<div id="file-view-tip"><p>' + "{% trans "To view it online, you can use firefox, chrome or IE 9." %}" + '</p></div>');
} else {
$('#file-view').html('<iframe src="{{ raw_path }}" frameborder="0" id="svg-view"></iframe>');
}
@@ -104,9 +104,9 @@ window.onload = function () {
error: function(xhr, textStatus, errorThrown) {
var str;
if (xhr.responseText) {
str = '{% trans "Document convertion failed." %}';
str = "{% trans "Document convertion failed." %}";
} else {
str = '{% trans "Failed. Please check the network." %}';
str = "{% trans "Failed. Please check the network." %}";
}
$('#file-view').html('<div id="file-view-tip"><p class="error">' + str + '</p></div>');
}