question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Locale data for 'en-US' cannot be found.

See original GitHub issue

πŸ“š Docs or angular.io bug report

Description

Issue first reported in 35776, referring to a stack overflow issue. The developer is getting this error message:

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

πŸ”¬ Minimal Reproduction

See the stack overflow issue.

What’s the affected URL?**

https://angular.io/guide/i18n#internationalization-i18n

Reproduction Steps**

See the stack overflow issue.

Expected vs Actual Behavior**

β€œ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 doesn’t help either.”

πŸ“·Screenshot

πŸ”₯ Exception or Error




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

🌍 Your Environment

Browser info

Anything else relevant?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
xiaoxiangmoecommented, Jul 9, 2020

It seems that this problem has been fixed in ng 10, I am trying to migrate old projects to ng 10.

1reaction
Spawnradcommented, Jun 24, 2020

Hi,

I have migrate from angular 8 to 9 and i have the same issue. My version : 9.1.11

The error message : Locale data for β€˜fr-FR’ cannot be found. Using locale data for β€˜fr’.

In my app.module i have : registerLocaleData(localeFr, 'fr-FR');

In my package.json :

      "i18n": {
        "sourceLocale": "fr-FR"
      },
....

"localize": ["fr-FR"],

When i change to β€œlocalize”: [β€œfr”] i have the error message : Requested locale β€˜fr’ is not defined for the project.

If i use :

      "i18n": {
        "sourceLocale": "fr"
      },
`"localize": ["fr"],`

All work fine

Maybe need to change the documentation at the line :
https://angular.io/guide/i18n

"i18n": {
      "sourceLocale": "en-US"

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 9 Locale data for 'en-US' cannot be found. No locale ...
It is working if you set sourceLocale to en . But i cant figure out why the default value en-US dosnt work. "i18n":...
Read more >
12 Customizing Locale Data - Oracle Help Center
This chapter shows how to customize locale data. ... If you cannot find a Unicode font with satisfactory character coverage, then use multiple...
Read more >
Unicode Locale Data Markup Language (LDML)
Unicode language and locale identifiers inherit the design and the repertoire of subtags from [BCP47] Language Tags. There are some extensions and restrictionsΒ ......
Read more >
Internationalization | NG-ZORRO - Ant Design
import all locales data **/ import { LOCALE_ID } from '@angular/core'; ... from 'ng-zorro-antd/i18n'; import { enUS, ja } from 'date-fns/locale';Β ...
Read more >
Locale | Apple Developer Documentation
Data formatting APIs commonly make use of locales to present data in a ... let enUS = Locale(identifier: "en-US") let localizedScript = enUS....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found