Skip to content

Commit

Permalink
Update file upload i18n keys
Browse files Browse the repository at this point in the history
  • Loading branch information
codealchemy committed Sep 12, 2021
1 parent f996029 commit 54ad6ab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/rails_admin/main/_form_file_upload.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
- if field.optional? && field.errors.blank? && file && field.delete_method
%a.btn.btn-info.btn-remove-image{href: '#', :'data-toggle' => 'button', role: 'button'}
%i.icon-white.icon-trash
= I18n.t('admin.actions.delete.menu').capitalize + " #{field.label.downcase}"
= I18n.t('admin.actions.delete.link', object_label: field.label)

= form.check_box(field.delete_method, style: 'display:none;')
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- if field.delete_method || field.keep_method
%a.btn.btn-info.btn-remove-image{href: '#', :'data-toggle' => 'button', role: 'button'}
%i.icon-white.icon-trash
= I18n.t('admin.actions.delete.menu').capitalize + " #{field.label.downcase} ##{i + 1}"
= I18n.t('admin.form.delete_file', field_label: field.label, number: i + 1)
- if field.keep_method
= form.check_box(field.keep_method, {multiple:true, checked: true, style: 'display:none;'}, attachment.keep_value, nil)
- elsif field.delete_method
Expand Down
1 change: 1 addition & 0 deletions config/locales/rails_admin.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ en:
save: "Save"
save_and_add_another: "Save and add another"
save_and_edit: "Save and edit"
delete_file: "Delete '%{field_label}' #%{number}"
all_of_the_following_related_items_will_be_deleted: "? The following related items may be deleted or orphaned:"
are_you_sure_you_want_to_delete_the_object: "Are you sure you want to delete this %{model_name}"
confirmation: "Yes, I'm sure"
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/fields/multiple_carrierwave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

it 'supports deleting a file', js: true do
visit edit_path(model_name: 'field_test', id: field_test.id)
click_link 'Delete carrierwave assets #1'
click_link "Delete 'Carrierwave assets' #1"
click_button 'Save'
field_test.reload
expect(field_test.carrierwave_assets.map { |image| File.basename(image.url) }).to eq ['test.png']
Expand Down

0 comments on commit 54ad6ab

Please sign in to comment.