Trying to use primefaces calendar with localization. I thought about adding the javascript properties array into the corresponding locale message properties file.
http://code.google.com/p/primefaces/wiki/PrimeFacesLocales
primefacesLocale=PrimeFaces.locales['de'] = \u007B closeText: 'Schlie\u00DFen', prevText: 'Zur\u00FCck', nextText: 'Weiter', {0} weekHeader: 'Woche', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: '', timeOnlyTitle: 'Nur Zeit', timeText: 'Zeit', hourText: 'Stunde', minuteText: 'Minute', secondText: 'Sekunde', currentText: 'Aktuelles Datum', ampm: false, month: 'Monat', week: 'Woche', day: 'Tag', allDayText: 'Ganzer Tag'\u007D;
Using it like:
<script type="text/javascript">
<h:outputFormat value="#{msg.primefacesLocale}" escape="false">
<f:param value="test"/>
</h:outputFormat>
</script>
Month- and weekday names should be retrieved via el functions, test
value is just for testing
Results in:
java.lang.IllegalArgumentException: can't parse argument number: closeText: 'Schließen'
at java.text.MessageFormat.makeFormat(MessageFormat.java:1420)
at java.text.MessageFormat.applyPattern(MessageFormat.java:479)
at java.text.MessageFormat.<init>(MessageFormat.java:381)
at com.sun.faces.renderkit.html_basic.OutputMessageRenderer.encodeEnd(OutputMessageRenderer.java:113)
Whats wrong here?
Edit:
Using: <h:outputText value="#{msg.primefacesLocale}" escape="false">
works fine.