From 7200c007e5ecd14db0e5a37731e5f036afc1ac5e Mon Sep 17 00:00:00 2001 From: MrZYX Date: Sun, 14 Nov 2010 15:43:25 +0100 Subject: [PATCH] made file uploader translatable --- app/views/photos/_new_photo.haml | 19 ++++++++++++++++++- config/locales/diaspora/en.yml | 7 +++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index 7a10a2530..71636bd1e 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -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: '
' + + '
#{t('.drop')}
' + + '
#{t('.upload')}
' + + '' + + '
', + fileTemplate: '
  • ' + + '' + + '' + + '' + + '#{t('cancel')}' + + '#{t('.failed')}' + + '
  • ', + messages: { + typeError: "#{t('.invalid_ext')}", + sizeError: "#{t('.size_error')}", + emptyError: "#{t('.empty')}" + } }); } window.onload = createUploader; diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index bc66fab5a..8812eaff7 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -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"