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.

i18n pipes not using the LOCALE_ID by default

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When setting the LOCALE_ID token to a locale different than the default, the value gets changed, but when using a i18n pipe like the CurrencyPipe it’s not reading the new LOCALE_ID value as expected. The new locale data is registered as the documentation says and also the LOCALE_ID token is provided as the documentation says.

Expected behavior

Any of the i18n pipes should use the LOCALE_ID value as the default locale.

Minimal reproduction of the problem with instructions

I have created a minimal StackBlitz reproducing the issue here.

What is the motivation / use case for changing the behavior?

The i18n pipes should use the LOCALE_ID by default as the documentation says.

Environment


Angular version: 5.2.1

Browser:
- [x] Chrome (desktop) version 63.0.3239.132

For Tooling issues:
- Node version: 8.8.0 
- Platform:  macOS High Sierra 10.3.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
trotylcommented, Mar 22, 2018

@luckylooke You only used locale es.

image

1reaction
ocombecommented, Mar 22, 2018

yes, you have to load the locales, as explained here: https://angular.io/guide/i18n#i18n-pipes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why angular date pipe do not support locale language default ...
I am able to dynamically load locale data. My problem is with date formatting. i want to use date pipe to get locale...
Read more >
Set the runtime locale manually - Angular
The Angular CLI automatically includes the locale data and sets the LOCALE_ID value when you use the --localize option with ng build command....
Read more >
Internationalization (i18n) - Angular - w3resource
i18n pipes By default, Angular only contains locale data for en-US. If you set the value of LOCALE_ID to another locale, you must...
Read more >
Localizing your app - Angular Hispano
If @angular/localize is not installed, the Angular CLI may generate an error when you ... Use a more specific locale ID, such as...
Read more >
Internationalization (i18n) - Angular
Angular pipes can help you with internationalization: the DatePipe ... By default, the imported locale data is registered with the locale id that...
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