Hi, do anybody know a js script to transalte a p:schedule into German? I testet this code but it didnt work:

<script type="text/javascript">
    PrimeFaces.locales['de_CH'] = {
        closeText : 'Schließen',
        prevText : 'Zurück',
        nextText : 'Weiter',
        currentText : 'Start',
        monthNames : [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
                'Juli', 'August', 'September', 'Oktober', 'November',
                'Dezember' ],
        monthNamesShort : [ 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun',
                'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ],
        dayNames : [ 'Sonntag', 'Montag', 'Dienstag', 'Mittwoch',
                'Donnerstag', 'Freitag', 'Samstag' ],
        dayNamesShort : [ 'Son', 'Mon', 'Die', 'Mit', 'Don', 'Fre', 'Sam' ],
        dayNamesMin : [ 'S', 'M', 'D', 'M ', 'D', 'F ', 'S' ],
        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'
    };
</script>

i copied this text into my Template. regards Florian

asked 29.09.2015 at 13:46

Florian%20Hitz's gravatar image

Florian Hitz
316610
accept rate: 0%

edited 05.10.2015 at 11:03

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
7.4k11347


If you configure the locale as String only two character language symbols work.

But you can use a data attribute of type java.util.Locale instead:

locale="#{data.locale}"

and initialize the data attribute as follows:

out.locale=new java.util.Locale("de", "CH");

in the process.

link

answered 29.09.2015 at 16:45

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.6k172551
accept rate: 75%

Hi Florian,

did you add the tag locale="de_CH" in the p:calendar element?

best regards Roland

link

answered 29.09.2015 at 13:58

roland's gravatar image

roland
3465715
accept rate: 41%

yes i did, it look like this: <p:schedule locale="de_CH" style="width:48%; float:left;"/>

(29.09.2015 at 14:09) Florian Hitz Florian%20Hitz's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×45

Asked: 29.09.2015 at 13:46

Seen: 1,100 times

Last updated: 05.10.2015 at 11:03