Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 9 Locale data for 'en-US' cannot be found. No locale data will be included for this locale

I am getting this strange warning

Locale data for 'en-US' cannot be found. No locale data will be included for this locale when running ng build --configuration=prod --localize

here is my angular.json

// omitted
"i18n": {
    "sourceLocale": "en-US",
    "locales": {
      "sr-Latn": {
        "translation": "src/locale/messages.sr.xlf",
        "baseHref": "/sr/"
      }
    }
  },
// omitted

The documentation clearly states en-US is imported by default. To make things worse, when i change sourceLocale to any other language (say 'de'), warning message goes away.
Manually registering en-US locale data doesnt help either

like image 921
SeaBiscuit Avatar asked Dec 28 '19 20:12

SeaBiscuit


1 Answers

It is working if you set sourceLocale to en.

  • But i cant figure out why the default value en-US dosnt work.
"i18n": {
    "sourceLocale": "en",
    "locales": {...}
}
like image 156
Tilmann Bach Avatar answered Sep 19 '22 16:09

Tilmann Bach