开发者

How to localize the label of a file_field in Rails?

开发者 https://www.devze.com 2022-12-21 03:31 出处:网络
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 fil开发者_开发知识库e field? It always seems to give

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 fil开发者_开发知识库e field? It always seems to give me a label "choose file" in the button and "no file chosen" immediately after the button.


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)
0

精彩评论

暂无评论...
验证码 换一张
取 消