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.

Pipes ignore user culture and use only default en-US

See original GitHub issue

I’m submitting a … (check one with “x”)

[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior Pipes clearly state in the documentation that they use INTL to display numbers, dates, etc in the user culture. INTL is indeed used, but there is a hardcoded ‘defaultLocale = “en-US”’ in the various pipe sources and it is used like that, so the user cultuer is ignored.

Expected/desired behavior Instead of using a hardcoded culture value let INTL infer the culture to use from the user settings, as it should be and as the documentation already explains.

Reproduction of the problem If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).

What is the expected behavior? As described above

What is the motivation / use case for changing the behavior? It is not working as it should

Please tell us about your environment:

  • Angular version: 2.0.0-rc.5
  • Browser: [all]
  • Language: [all]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
matteo-moscacommented, Sep 19, 2016

In Angular Final 2.0.0 the problem still persists. In core.umd.js at line 7930:

{ provide: LOCALE_ID, useValue: 'en-US' },

The only way to localize my app is to edit the source and change the culture, but still no dynamic culture based on the user settings.

This is the “Final” release of Angular2 not an RC anymore, this was supposed to be fixed.

1reaction
vicbcommented, Sep 5, 2016

Did anybody thought about not defaulting the world to en-US?

useless debate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set locale in DatePipe in Angular 2? - Stack Overflow
I've found the date pipe docs which explains the order of the y's m' and d's in the format string are ignored as...
Read more >
grep ignoring pipe when aliased to 'grep -R'
The alias is what is causing it. From man grep , the -R option causes grep to "read all files under each directory,...
Read more >
Auto Selecting Cultures for Localization in ASP.NET - Rick Strahl
One of the things that just about any localized ASP.NET app needs to do is set the user's locale, often based on the...
Read more >
Get-Culture (Microsoft.PowerShell.Utility)
The user-interface (UI) culture determines which text strings are used for user interface elements, such as menus and messages.
Read more >
Typing 'git log --oneline' in oh-my-zsh pipes to 'less' - Super User
You can define a pager, which git uses by default for its output via. the $GIT_PAGER or $PAGER environment variable; the git config...
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