I'm using the p-datepicker component but I would like to translate it into French and Spanish. How can I do this in Angular/Primeng 19?
After researching I found this:
npm i primelocale
(https://github.com/primefaces/primelocale)example of code config translation:
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
import { provideHttpClient, withFetch } from '@angular/common/http';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { providePrimeNG } from 'primeng/config';
import Lara from '@primeng/themes/lara';
import MyLaraLightBluePreset from './style';
import { fr } from "primelocale/fr.json"
export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes),provideAnimationsAsync(),provideHttpClient(withFetch()),
providePrimeNG({
translation: fr,
theme: {
preset: MyLaraLightBluePreset,
options: {
darkModeSelector: '.my-app-dark'
}
}
})
]
};