How To Use LOCALE_ID In Angular i18n Router Module

add this to the app.module

providers: [{provide: LOCALE_ID, useValue: 'fr-FR'}]

then call it using the following method where ever you want

import {LOCALE_ID} from '@angular/core';

  constructor(@Inject(LOCALE_ID) locale: string){
    console.log('locale', locale);
  }

also you can use this method

platformBrowserDynamic([{provide: LOCALE_ID, useValue: 'en-EN'}]).bootstrapModule(AppModule, {providers: [{provide: LOCALE_ID, useValue: 'en-EN'}]});