localization - EL variable in JSF ResourceBundle -


i read somewhere (don't find anymore) can use el expresions in resource bundle , use without changes in *.xhtml files.

some.text=#{somebean.stepsleft} more 

to switch position of variable in different languages. wont work. can use interpolator class handle parsing or add some.text.before some.text.after , let 1 of them empty. prefer use without interpolator.interpolate() if possible.

jsf resourcebundles default not resolve el. default supports messageformat api in combination <h:outputformat> , <f:param>.

some.text = {0} more 

with

<h:outputformat value="#{i18n['some.text']}">     <f:param value="#{somebean.stepsleft}" /> </h:outputformat> 

you can explicitly make number type e.g. 1000 displayed 1,000 or 1.000 depending on view locale.

some.text = {0,number} more 

for more formatting options see messageformat api documentation.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -