made file uploader translatable

This commit is contained in:
MrZYX 2010-11-14 15:43:25 +01:00
parent 466120cd58
commit 7200c007e5
2 changed files with 25 additions and 1 deletions

View file

@ -8,7 +8,24 @@
element: document.getElementById('file-upload'),
params: {'photo' : { 'to' : "#{aspect_id}"}, 'set_profile_image' : "#{set_profile_image if defined?(set_profile_image)}"},
allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
action: "#{photos_path}"
action: "#{photos_path}",
template: '<div class="qq-uploader">' +
'<div class="qq-upload-drop-area"><span>#{t('.drop')}</span></div>' +
'<div class="qq-upload-button">#{t('.upload')}</div>' +
'<ul class="qq-upload-list"></ul>' +
'</div>',
fileTemplate: '<li>' +
'<span class="qq-upload-file"></span>' +
'<span class="qq-upload-spinner"></span>' +
'<span class="qq-upload-size"></span>' +
'<a class="qq-upload-cancel" href="#">#{t('cancel')}</a>' +
'<span class="qq-upload-failed-text">#{t('.failed')}</span>' +
'</li>',
messages: {
typeError: "#{t('.invalid_ext')}",
sizeError: "#{t('.size_error')}",
emptyError: "#{t('.empty')}"
}
});
}
window.onload = createUploader;

View file

@ -214,6 +214,13 @@ en:
error: "Failed to edit photo."
destroy:
notice: "Photo deleted."
new_photo:
drop: "Drop photos here to upload"
upload: "Upload a photo"
failed: "Failed"
invalid_ext: "{file} has invalid extension. Only {extensions} are allowed."
size_error: "{file} is too large, maximum file size is {sizeLimit}."
empty: "{file} is empty, please select files again without it."
registrations:
new:
sign_up: "Sign up"