Rails, how to translate captions to inputs of the form file_field (i18n)

I am creating a translation for my application, but I cannot figure out how to translate the default captions for the form fields.

In particular, the file_form tag. By default, the button labeled "Select file" and a note to the side "No file selected" are used.

Where do these translations exist in yml?

+3
source share
2 answers

Unfortunately, <input type = "file"> and how it seems to the user depends on the browser, and this cannot be made too large.

, -, , , ( , )

+3

.

= transloadit :image_resize
-6.times do |index|
  .fileupload.fileupload-new.pull-left{style: "padding-right: 5px;", "data-provides" => "fileupload" }
    .fileupload-new.thumbnail{:style => "width: 130px; height: 130px;"} 
      -if @provider.provider_images.present?
        - if @provider.provider_images["provider_image#{index+1}"].present?
          %img{:id=>"providerimage1", :src => @provider.provider_images["provider_image#{index+1}"][0]}/
    .fileupload-preview.fileupload-exists.thumbnail{:style => "width: 130px; height: 130px;"}
    %div
      %span.btn.btn-file
        %span.fileupload-new{:id => "selectbutton"}
          -if index == 0
            =t('select_profile_image')  
          -else
            =t('select_image')              
        %span.fileupload-exists
          -if index == 0
            =t('select_profile_image')  
          -else
            =t('select_image')      
        =file_field_tag "provider_image#{index+1}" 
0

Source: https://habr.com/ru/post/1774445/


All Articles