📄 primereact/locale

File: locale.md | Updated: 11/15/2025

Source: https://primereact.org/locale/

Introducing PrimeReact v11 Alpha 🥁Learn More

Internationalization and Localization

The Locale API allows setting i18n and l7n options globally for the components.

Import#


Configuration is managed by the Locale API imported from primereact/api.

import { locale, addLocale, updateLocaleOption, updateLocaleOptions, localeOption, localeOptions } from 'primereact/api';
         

Copy

Set Locale#


An available locale can be set with locale method at anytime.

locale('en');
         

Copy

Add Locale#


New locale settings can be added using addLocale method.

addLocale('es', {
    firstDayOfWeek: 1,
    dayNames: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
    dayNamesShort: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'],
    dayNamesMin: ['D', 'L', 'M', 'X', 'J', 'V', 'S'],
    monthNames: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
    monthNamesShort: ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
    today: 'Hoy',
    clear: 'Limpiar',
    //...
});
         

Copy

Repository#


Ready to use settings for locales are available at the community supported PrimeLocale repository. We'd appreciate if you could contribute to this repository with pull requests and share it with the rest of the community.

  • Import

  • Set Locale

  • Add Locale

  • Repository

PrimeReact 10.9.7 by PrimeTek