Locale Text
The labels and messages shown across the calendar’s UI, from toolbar buttons to “+more” links.
A locale supplies these values. Setting one as a calendar option overrides the locale’s value:
const calendar = new Calendar(calendarEl, {
locale: 'es',
todayText: 'Ir a hoy', // instead of the Spanish locale's 'Hoy'
allDayText: 'Todo el día'
}); The defaults below are English. Other locales define their own, and a locale that leaves out weekTextShort uses its weekTextLong instead.
Toolbar Buttons#
| Option | English default | Used for |
|---|---|---|
todayText | "Today" | the today button |
prevText | "Prev" | the prev button, when it displays text (see buttonDisplay) |
nextText | "Next" | the next button, when it displays text |
prevYearText | "Prev year" | the prevYear button, when it displays text |
nextYearText | "Next year" | the nextYear button, when it displays text |
yearText | "Year" | buttons of year-long views, and navigation hints |
monthText | "Month" | buttons of month-long views, and the hints of navigation buttons |
weekTextLong | "Week" | buttons of week-long views, navigation hints, and week numbers |
dayText | "Day" | buttons of day-long views, and navigation hints |
listText | "List" | buttons of list views. If false, a list view’s button uses the text of its duration’s unit, such as “Week” |
To change the text of one button only, use the text property of its buttons entry.
Calendar Text#
| Option | English default | Used for |
|---|---|---|
allDayText | "All-day" | the label of the all-day section in TimeGrid views, and the time text of all-day events in list views |
timedText | "Timed" | a screen-reader label for the timed section of TimeGrid views |
moreLinkText | "more" | the text after the count in “+more” links, such as “more” in “+2 more”. As a function, it receives the count and returns the full text. See moreLinkContent |
noEventsText | "No events to display" | the message of an empty list view. See noEventsContent |
weekTextShort | "W" | short week number labels |
Hints#
The accessible labels (prevHint, nextHint, todayHint, viewHint, viewChangeHint, navLinkHint, moreLinkHint, closeHint, eventsHint) are locale text too. They’re described on the Hints page.