Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I18n default currency from locale #34724

Open

Conversation

@petebacondarwin
Copy link
Member

petebacondarwin commented Jan 10, 2020

This PR is for v10 only. It adds a breaking change that is not wanted in v9.

@petebacondarwin petebacondarwin added this to the v10-candidates milestone Jan 10, 2020
@petebacondarwin petebacondarwin requested review from angular/dev-infra-framework as code owners Jan 10, 2020
@googlebot

This comment has been minimized.

Copy link

googlebot commented Jan 10, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no label Jan 10, 2020
@petebacondarwin petebacondarwin force-pushed the petebacondarwin:i18n-default-currency-from-locale branch 5 times, most recently from 74b192a to be32a19 Jan 10, 2020
The default currency code used for things like `CurrencyPipe` is now
taken from the current locale. Previously this was set to `USD` unless the
developer did not explicitly provide the `DEFAULT_CURRENCY_CODE` injectable.

BREAKING CHANGE:

If `DEFAULT_CURRENCY_CODE` was not provided, the default currency for
`CurrencyPipe` was always `USD`. Now it will be the currency code for
the currently configured locale, set by providing `LOCALE_ID` or by
setting the value globally (`$localize.locale` in IVY or `goog.LOCALE`
in G3).

To recover the original behaviour provide `DEFAULT_CURRENCY_CODE` in your
application `NgModule`:

```ts
{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'},
```
@petebacondarwin petebacondarwin force-pushed the petebacondarwin:i18n-default-currency-from-locale branch from be32a19 to 7aeedea Jan 16, 2020
@googlebot

This comment has been minimized.

Copy link

googlebot commented Jan 16, 2020

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.