我知道由于浏览器语言,这两个词会自动翻译。但我的HTML并没有这样做。
HTML:
<p>
<label for="id_company_logo">
Company Logo:
</label>
<input type="file" name="company_logo" id="id_company_logo" />
</p>
它是根据django
的以下“形式”代码生成的:
company_logo = forms.ImageField(label=_('Company Logo'),required=False, error_messages = {'invalid':_("Image files only")}, widget=forms.FileInput)
我做错了吗?我现在搜索了一段时间,但我绝对没有运气。
提前致谢。
Stackoverflow上多次讨论了这个问题。 这是文章: How to change the button text of input type=“file” ? Labeling file upload button Change default text in input type=“file”?
但是this是一篇很棒的文章。
Here你可以找到解决问题的方法。