Localization for different languages and formats is defined by binding the local settings object to the locale property. The default local value is English. To represent a different locale, we should provide the respective language text labels. For example, the German locale should provide the following labels for the German calendar:
this.de = {
firstDayOfWeek: 1,
dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag',
'Freitag', 'Samstag'],
dayNamesShort: ['Son', 'Mon', 'Die', 'Mit', 'Don', 'Fre', 'Sam'],
dayNamesMin: ['S', 'M', 'D', 'M ', 'D', 'F ', 'S'],
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']
};
The calendar with German locale labels will be displayed as follows:
As shown before, the locale-specific labels need to be formatted as JSON in the backing component to display the locale-specific calendar.