Commit Graph

3 Commits

Author SHA1 Message Date
Pete Bacon Darwin ed2f5e0efa feat: i18n - include currency code in locale data (#32584)
PR Close #32584
2020-01-13 09:57:06 -08:00
Pete Bacon Darwin c5894e08bc feat(common): support loading locales from a global (#33523)
To support compile time localization, we need to be
able to provide the locales via a well known global property.

This commit changes `getLocaleData()` so that it will attempt
to read the local from the global `ng.common.locales` if the
locale has not already been registered via `registerLocaleData()`.

PR Close #33523
2019-11-05 17:27:00 +00:00
Pete Bacon Darwin 7e8eec57f0 refactor(common): move the low level locale registering to core (#33523)
To limit the exposure of the private `LOCALE_DATA` from outside
`@angular/core` this commit exposes private functions in the core
to hide the internal structures better.

* The `registerLocaleData()` implementation has moved from
`@angular/common` to `@angular/core`. A stub that delegates to
core has been left in common for backward compatibility.
* A new `ɵunregisterLocaleData()` function has been provided,
which is particularly useful in tests to clear out registered locales
to prevent subsequent tests from being affected.
* A private export of `ɵregisterLocaleData()` has been removed
from `@angular/common`. This was not being used and is accessible
via `@angular/core` anyway.

PR Close #33523
2019-11-05 17:26:59 +00:00