Book Image

Learning PrimeFaces Extensions Development

By : Sudheer Jonna
Book Image

Learning PrimeFaces Extensions Development

By: Sudheer Jonna

Overview of this book

Table of Contents (14 chapters)
Learning PrimeFaces Extensions Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Internationalization support


Both the TimePicker and TimeLine components support Internationalization (I18N) to display localized text or labels. PrimeFaces Extensions only provides English locales. If you want to support multiple locales for multilanguage applications, then you need to add the locales with corresponding text in a JavaScript file and add it to your application. Based on the locale you selected, the corresponding text will be displayed for the component.

For example, add the following TimePicker and TimeLine locale JavaScript files in your application's resources folder to support French local text:

  1. Create the timepickerLocales.js file under the resources folder of your application with the following content:

    $(function() {
      PrimeFacesExt.locales.TimePicker['fr'] = {
        hourText: 'Heures',
        minuteText: 'Minutes',
        amPmText: ['AM', 'PM'],
        closeButtonText: 'Fermer',
        nowButtonText: 'Maintenant',
        deselectButtonText: 'Désélectionner'
      };
    }
  2. Create the timelineLocales...