Reputation: 2841
I have a form in my ActiveAdmin model and I need to translate the content of the button that is generated to upload a file.
I have the following form:
form do |f|
f.inputs 'Details' do
f.input :orders_file, as: :file
end
actions
end
Which displays this:
I would like to translate or change that 'Choose file' and 'No file chosen' texts.
I've tried with
input_html: { title: 'this', text: 'will', label: 'work', value: 'please' }
but no luck.
Thank you!
Upvotes: 0
Views: 1139
Reputation: 2978
Changing the file upload field labels involves some special techniques invented by Michael McGrady, discussed in detail at https://www.quirksmode.org/dom/inputfile.html
Upvotes: 1
Reputation: 2102
You can not change the file field default labels on buttons and text, they are hard-coded in browsers. Each Browser has its own way to render these things.
Only way to change these labels is, build your own custom file field control.
Upvotes: 1