Commit Graph

26 Commits

Author SHA1 Message Date
Olivier Combe 5e0f982961 feat(ivy): use i18n locale data to determine the plural form of ICU expressions (#29249)
Plural ICU expressions depend on the locale (different languages have different plural forms). Until now the locale was hard coded as `en-US`.
For compatibility reasons, if you use ivy with AOT and bootstrap your app with `bootstrapModule` then the `LOCALE_ID` token will be set automatically for ivy, which is then used to get the correct plural form.
If you use JIT, you need to define the `LOCALE_ID` provider on the module that you bootstrap.
For `TestBed` you can use either `configureTestingModule` or `overrideProvider` to define that provider.
If you don't use the compat mode and start your app with `renderComponent` you need to call `ɵsetLocaleId` manually to define the `LOCALE_ID` before bootstrap. We expect this to change once we start adding the new i18n APIs, so don't rely on this function (there's a reason why it's a private export).
PR Close #29249
2019-05-30 15:09:02 -04:00
Alex Rickabaugh 9147092a15 Revert "feat(ivy): use i18n locale data to determine the plural form of ICU expressions (#29249)" (#29918)
This reverts commit 6a8cca7975.

PR Close #29918
2019-04-15 16:55:51 -07:00
Olivier Combe 6a8cca7975 feat(ivy): use i18n locale data to determine the plural form of ICU expressions (#29249)
Plural ICU expressions depend on the locale (different languages have different plural forms). Until now the locale was hard coded as `en-US`.
For compatibility reasons, if you use ivy with AOT and bootstrap your app with `bootstrapModule` then the `LOCALE_ID` token will be set automatically for ivy, which is then used to get the correct plural form.
If you use JIT, you need to define the `LOCALE_ID` provider on the module that you bootstrap.
For `TestBed` you can use either `configureTestingModule` or `overrideProvider` to define that provider.
If you don't use the compat mode and start your app with `renderComponent` you need to call `ɵsetLocaleId` manually to define the `LOCALE_ID` before bootstrap. We expect this to change once we start adding the new i18n APIs, so don't rely on this function (there's a reason why it's a private export).
PR Close #29249
2019-04-15 10:40:26 -07:00
Daniel Ruf b9854e582f refactor: remove unused parameters (#28203)
PR Close #28203
2019-01-23 10:58:37 -08:00
Vikram Subramanian d83f9d432a fix(common): register locale data for all equivalent closure locales (#25867)
This fix is for the issue below when compiling I18N Angular apps using closure.

For certain locales closure converts the input locale id to a different equivalent locale string. For example if the input locale is 'id'(for Indonesia) goog.LOCALE is set to 'in' and the closure locale data is registered only for 'in'. The Angular compiler uses the original input locale string, 'id' to set the LOCALE_ID token and there is a mismatch of locale used to register and locale used when requesting the locale data.

The fix is for the closure-locale.ts code to register the locale data for all equivalent locales names so that it doesn't matter what goog.LOCALE is actually set to.

PR Close #25867
2018-09-10 13:59:56 -07:00
Olivier Combe dcabb05102 fix(common): use correct currency format for locale de-AT (#24658)
Fixes #24609
PR Close #24658
2018-07-09 15:10:06 -07:00
Olivier Combe d1177c75f8 refactor: update CLDR data for closure locale & use a const for undefined (#23372)
PR Close #23372
2018-04-13 16:30:23 -07:00
Olivier Combe ce40e85cbb refactor(common): update CLDR data to v33.0.0 (#23265)
PR Close #23265
2018-04-11 15:34:46 -07:00
Olivier Combe 5706810af2 fix(common): replace i18n locale undefined values by a const (#23265)
Fixes #22988
PR Close #23265
2018-04-11 15:34:46 -07:00
Olivier Combe 44154e71fd fix(common): round currencies based on decimal digits in `CurrencyPipe` (#21783)
By default, we now round currencies based on the number of decimal digits available for that currency instead of using the rouding defined in the number formats.
More info about that can be found in http://www.unicode.org/cldr/charts/latest/supplemental/detailed_territory_currency_information.html#format_info

Fixes #10189

PR Close #21783
2018-02-09 14:42:23 -08:00
Olivier Combe 420cc7afc6 fix(common): add locale currency values (#21783)
we now use locale currency symbols, since they may be different in each locale (we were only using english data previously)

Fixes #20385

PR Close #21783
2018-02-09 14:42:23 -08:00
Olivier Combe b62739a989 fix(common): generate closure-locale data file with exported plural functions (#21873)
Fixes #21870
PR Close #21873
2018-01-30 11:42:31 -08:00
Olivier Combe 97b18b2a5c fix(common): extract plural function from i18n locale data files for TS 2.6 (#21626)
Fixes #21608

PR Close #21626
2018-01-19 13:23:34 -08:00
Olivier Combe 135a2822ea fix(common): don't remove special characters when extracting CLDR data (#21626)
PR Close #21626
2018-01-19 13:23:34 -08:00
Olivier Combe 3ce3b4d2af refactor(common): update i18n locale data to CLDR v32 (#20830)
List of changes between v31.0.1 and v32: http://cldr.unicode.org/index/downloads/cldr-32
PR Close #20830
2017-12-08 10:24:33 -08:00
Olivier Combe 24bf3e2a25 feat(common): add locale id parameter to `registerLocaleData` (#20623)
PR Close #20623
2017-11-27 17:00:06 -06:00
Olivier Combe 0f5c70d563 build: update npm dependencies (#19328)
PR Close #19328
2017-09-22 13:20:52 -07:00
Olivier Combe 57abe8d078 refactor(common): export locale data from closure-locale (#18973)
PR Close #18973
2017-08-31 11:23:12 -07:00
Victor Berchet fdd5010832 fix(common): fix a duplicate case in the locale switch (#18941) 2017-08-29 17:02:20 -07:00
Olivier Combe 946e5bda22 fix(common): update closure-locale generation for tree shaking (#18938) 2017-08-29 15:29:21 -07:00
Olivier Combe 90bd984ff7 refactor(common): simplify closure-locale by removing imports (#18926) 2017-08-29 11:54:43 -07:00
Olivier Combe 48789360b1 feat(common): generate `closure-locale.ts` to tree shake locale data (#18907)
Closure will only keep the data for the locale defined in `goog.LOCALE`

PR Close #18907
2017-08-29 11:26:10 -05:00
Victor Berchet 4c5aac8cd5 refactor(common): move generated locale files (#18907)
PR Close #18907
2017-08-29 11:26:10 -05:00
Victor Berchet 832876d0a1 refactor(common): refactor i18n code to ease tree shaking (#18907)
PR Close #18907
2017-08-29 11:26:09 -05:00
Olivier Combe 4c45347635 refactor(common): remove `AVAILABLE_LOCALES` (#18907)
Fixes #18855

PR Close #18907
2017-08-29 11:26:09 -05:00
Olivier Combe 33d250ffaa build(common): extract i18n locale data from cldr (#18284)
PR Close #18284
2017-08-22 15:43:04 -05:00