简体   繁体   English

如何根据浏览器语言更改翻译浏览或选择文件以输入表单输入类型=文件

[英]how to translate Browse or Choose File for form input type=file based on browser language change

HTML form input type = file is providing " Browse " and " No file Selected " in firefox and " choose File " and " No File Chosen " in chrome to choose a file. HTML表单输入类型=文件是在提供“ 浏览 ”,并在Firefox“ 没有文件选择 ”和“ 选择文件 ”和“ 未选择文件 ”选择文件。

I have a use case to translate " Browse " and " Choose File " as per browser language. 我有一个用例,可以根据浏览器语言翻译“ 浏览 ”和“ 选择文件 ”。

is it possible to do without adding any javascript library? 是否可以在不添加任何JavaScript库的情况下做?

Thanks in advance 提前致谢

Native input elements are depending on the operating system and the browser that the clients are using. 本机输入元素取决于客户端使用的操作系统和浏览器。 You can workaround with a custom file picker (an input file hidden, a layer that triggers the hidden input file, the text that you like). 您可以使用自定义文件选择器(隐藏的输入文件,触发隐藏的输入文件的图层,所需的文本)解决。

You can use this refferences: 您可以使用以下引用:

How to style "input file" with CSS3 / Javascript? 如何使用CSS3 / Javascript设置“输入文件”的样式?

http://markusslima.github.io/jquery-filestyle/ http://markusslima.github.io/jquery-filestyle/

http://moro.es/projects/jquery-nicefileinput-js/ http://moro.es/projects/jquery-nicefileinput-js/

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM