git4school / git4school-visu

Git4School, a dashboard for supporting teacher interventions in Software Engineering courses
https://git4school.firebaseapp.com/
Apache License 2.0
2 stars 3 forks source link

Date pickers are not localized #34

Closed F0urchette closed 3 years ago

F0urchette commented 3 years ago

Description

During initialization, the application loads the language defined in the browser. But this loading does not modify the browser locale, which is english by default. Because of this, the date pickers are in english

screely-1603713468200

Steps to reproduce

Actual result

Weekdays and month names are in english

Expected result

Weekdays and month names are in french

Hints

Add this provider in app.module.ts :

{
      provide: LOCALE_ID,
      useFactory: (translateService: TranslateService) => translateService.currentLang,
      deps: [TranslateService]
}

Notes

This will load the locale according to the browser's language, but only at the application's startup. Changing the language on the application will therefore have no effect on the date pickers