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

80 lines
1.7 KiB
Python

load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
package(default_visibility = ["//visibility:public"])
ts_library(
name = "render3_lib",
testonly = True,
srcs = glob(
["**/*.ts"],
exclude = [
"**/*_perf.ts",
"domino.d.ts",
"load_domino.ts",
"jit_spec.ts",
],
),
deps = [
"//packages:types",
"//packages/animations",
"//packages/animations/browser",
"//packages/animations/browser/testing",
"//packages/common",
"//packages/common/locales",
"//packages/compiler",
"//packages/core",
"//packages/core/src/di/interface",
"//packages/core/src/interface",
"//packages/core/src/util",
"//packages/core/testing",
"//packages/platform-browser",
"//packages/platform-browser/animations",
"//packages/platform-browser/testing",
"//packages/private/testing",
"@npm//rxjs",
],
)
ts_library(
name = "domino",
testonly = True,
srcs = [
"domino.d.ts",
"load_domino.ts",
],
deps = [
"//packages/compiler",
"//packages/platform-browser",
"//packages/platform-server",
"@npm//zone.js",
],
)
ts_library(
name = "render3_node_lib",
testonly = True,
srcs = [],
deps = [
":domino",
":render3_lib",
],
)
jasmine_node_test(
name = "render3",
bootstrap = [
"angular/packages/core/test/render3/load_domino",
],
deps = [
":render3_node_lib",
"@npm//zone.js",
],
)
ts_web_test_suite(
name = "render3_web",
deps = [
":render3_lib",
],
)