简体   繁体   English

ah:inputFile组件可以在JSF 2.2中进行国际化吗

[英]Can a h:inputFile component be internationalized in JSF 2.2

I am using JSF 2.2.12 mojarra implementation on Glassfish 4.1.1. 我在Glassfish 4.1.1上使用JSF 2.2.12 mojarra实现。 I have an upload form including ah:inputFile component. 我有一个包含ah:inputFile组件的上传表单。 Everything works just fine except that I can not find the way to change the "choose file..." message to an other one. 一切正常,只是我找不到将“选择文件...”消息更改为另一种消息的方法。 I can not believe that the HTML5 specs and/or JSF 2.2 does not provide any solution yet, so obviously it is my mistake. 我不敢相信HTML5规范和/或JSF 2.2尚未提供任何解决方案,因此显然这是我的错误。 I tried primefaces 5.3 which gives the opportunity to use different language than english on the button of the upload component but I could not style it. 我尝试了primefaces 5.3,它有机会在上传组件的按钮上使用与英语不同的语言,但是我无法设置其样式。

Is there any JSF 2.2 "compatible" way to handle this? 是否有JSF 2.2的“兼容”方式来处理此问题?

Try primefaces component fileUpload that comes with three buttons on advanced mode : choose , upload , cancel . 尝试在高级模式下带有三个按钮的primefaces组件fileUpload选择上传取消 You can edit the text on the buttons by changing the options label , uploadLabel , cancelLabel . 您可以通过更改选项标签 uploadLabelcancelLabel来编辑按钮上的文本。

Concerning the styles, i suggest changing the style in the css class of the buttons, to change colors, or icons. 关于样式,我建议在按钮的CSS类中更改样式,以更改颜色或图标。

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

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