How to localize the label of a file_field in Rails

2019-08-30 22:15发布

I want to localize a form in my app so that all the labels are in Finnish. This is easy with all other form components, but how do I do this with a file field? It always seems to give me a label "choose file" in the button and "no file chosen" immediately after the button.

1条回答
你好瞎i
2楼-- · 2019-08-30 23:01

This dumb file field depends only on your system locale. You cannot change way it looks or behaves, which annoys many of us, not to mention the fact that it can look completely different across different platforms.

To fight the problem you have options:

  1. use a flash solution like SWFUpload, etc.
  2. use a Javascript + CSS solution (there are many of them, e.g. this one)
查看更多
登录 后发表回答