HTML输入文件 - 如何翻译“选择文件”和“无文件选择”? [英] HTML input file - how to translate "Choose File" and "No file Chosen"?
问题描述
HTML:
< p为H.
< label for =id_company_logo>
公司标志:
< / label>
< input type =filename =company_logoid =id_company_logo/>
< / p>
它是从以下form代码生成的, django
company_logo = forms.ImageField(label = _('Company Logo'),required = False,error_messages = {'invalid':_(Image files only)},widget = forms.FileInput)
我做错了吗?现在我搜索了一段时间,但我绝对没有运气。
提前感谢
在Stackoverflow。
以下是文章:
如何更改输入类型=文件的按钮文本?
标签文件上传按钮
更改输入type =file中的默认文本?
这里,您可以找到解决问题的解决方案。
I know that these two words get automatically translated, due to the browser language. But my HTML is not doing that.
HTML:
<p>
<label for="id_company_logo">
Company Logo:
</label>
<input type="file" name="company_logo" id="id_company_logo" />
</p>
It is generated from following "form" code of django
:
company_logo = forms.ImageField(label=_('Company Logo'),required=False, error_messages = {'invalid':_("Image files only")}, widget=forms.FileInput)
Am I doing anything wrong? I searched around for some time now, but I had absolutely no luck.
Thanks in advance.
This problem was disscused several times on Stackoverflow.
Here are the articles:
How to change the button text of input type="file" ?
Labeling file upload button
Change default text in input type="file"?
But this is a great article.
Here you can find a solution to your problem.
这篇关于HTML输入文件 - 如何翻译“选择文件”和“无文件选择”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!