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

feat(common): add locale id parameter to `registerLocaleData` #20623

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@ocombe
Contributor

ocombe commented Nov 24, 2017

PR Type

What kind of change does this PR introduce?

[x] Feature

What is the current behavior?

Registering locale data uses the locale id that it contains, and we then use the value of the token LOCALE_ID to find those data when needed.

Issue Number: Fixes #20340, Fixes angular/material2#8268

What is the new behavior?

By default it has the same behavior, but you can also use the second parameter from the registerLocaleData function to set the locale id that we should use.
This allow people to set LOCALE_ID to the value that they want (e.g.: to use a custom locale id, such as old versions not supported by Angular) and still be able to make i18n pipes work with the locale data that they registered.

Does this PR introduce a breaking change?

[x] No

Note: @vicb I couldn't overload the existing signature because this only works with classes, since we only export one of the functions, the api generation was ignoring the other signatures.

@mary-poppins

This comment has been minimized.

Show comment
Hide comment
@mary-poppins

mary-poppins commented Nov 24, 2017

@vicb

few nits other LGTM. Add the merge label once the minor stuff are addressed and the CI is green. Thanks

@mary-poppins

This comment has been minimized.

Show comment
Hide comment
@mary-poppins

mary-poppins commented Nov 27, 2017

@mary-poppins

This comment has been minimized.

Show comment
Hide comment
@mary-poppins

mary-poppins commented Nov 27, 2017

@mary-poppins

This comment has been minimized.

Show comment
Hide comment
@mary-poppins

mary-poppins commented Nov 27, 2017

@vicb

vicb approved these changes Nov 27, 2017

@mhevery mhevery closed this in 24bf3e2 Nov 28, 2017

wKoza added a commit to wKoza/angular that referenced this pull request Dec 2, 2017

@ocombe ocombe deleted the ocombe:feat/register-locale-data-id branch Jan 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment