更新时间:2023-12-04 18:03:16
JSF resourcebundles在默认情况下不会解析EL.但是,默认情况下它支持 MessageFormat
API 与 <h:outputFormat>
和 <f:param>
JSF resourcebundles does by default not resolve EL. It however by default supports MessageFormat
API in combination with <h:outputFormat>
and <f:param>
.
some.text = {0} more
使用
<h:outputFormat value="#{i18n['some.text']}">
<f:param value="#{someBean.stepsLeft}" />
</h:outputFormat>
您甚至可以明确地将其设置为number
类型,例如根据视图区域设置,1000
将显示为1,000
或1.000
.
You can even explicitly make it a number
type so that e.g. 1000
will be displayed as 1,000
or 1.000
depending on the view locale.
some.text = {0,number} more
有关更多格式设置选项,请参见 MessageFormat
API文档.
For more formatting options see thus the MessageFormat
API documentation.