Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8836737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:33:48+00:00 2026-06-14T09:33:48+00:00

Trying to use primefaces calendar with localization. I thought about adding the javascript properties

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:33:49+00:00Added an answer on June 14, 2026 at 9:33 am

    The MessageFormat API has some special characters. The {, } and '. The { and } represents the start and end of format argument index. The ' is an escape character (like as \ is in strings).

    The \u007B which you’ve there in the beginning represents the {. It should actually have been escaped by surrounding it with '. The same for the ending \u007D which represents the }.

    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';
    

    You can by the way also just put those { and } plain vanilla in the string.

    primefacesLocale=PrimeFaces.locales['de'] = '{' 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''}';
    

    Note: as said, the ' is an escape character, if you want to represent it as-is, use two of them.

    primefacesLocale=PrimeFaces.locales['de'] = '{' 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'''}';
    

    This is in turn however invalid JSON. The string keys and values should be doublequoted (although most webbrowsers are forviging in this).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the primefaces dataExporter to export some data and I have
I am trying use javascript regular expressions to do some matching and I found
I am trying use a javascript function while passing php variables in it. For
I am trying use a javascript function while passing php variables in it. For
I am trying use a from a multi-dimensional array that I create in another
I'm trying to use a different theme on my primefaces (2.2.1) web application but
I'm trying to make use of the Star Rating component from PrimeFaces. However, it
I'm trying to use Primefaces 3.2 (perhaps it's related to JSF in general) with
I am trying to use primefaces 3.3 with JSF 2. When I try to
i'm trying use facebook API to upload photo in my fan page. I downloaded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.