From c88439ba2f7e806b310b3df3ddff2ba3b2aff6f0 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 15 May 2020 14:54:42 +0200 Subject: [PATCH] Polyfill Intl.PluralRules (#5893) --- package.json | 1 + src/common/translations/localize.ts | 4 ++++ yarn.lock | 12 ++++++++++++ 3 files changed, 17 insertions(+) diff --git a/package.json b/package.json index daa5071e84..de6b2e6d4d 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "author": "Paulus Schoutsen (http://paulusschoutsen.nl)", "license": "Apache-2.0", "dependencies": { + "@formatjs/intl-pluralrules": "^1.5.8", "@fullcalendar/core": "^5.0.0-beta.2", "@fullcalendar/daygrid": "^5.0.0-beta.2", "@material/chips": "7.0.0-canary.d92d8c93e.0", diff --git a/src/common/translations/localize.ts b/src/common/translations/localize.ts index bd864b0448..696a765872 100644 --- a/src/common/translations/localize.ts +++ b/src/common/translations/localize.ts @@ -12,6 +12,10 @@ export interface FormatsType { time: FormatType; } +if (!Intl.PluralRules) { + import("@formatjs/intl-pluralrules/polyfill-locales"); +} + /** * Adapted from Polymer app-localize-behavior. * diff --git a/yarn.lock b/yarn.lock index 9370c1b50b..2f05c6bbd9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1602,6 +1602,13 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@formatjs/intl-pluralrules@^1.5.8": + version "1.5.8" + resolved "https://registry.yarnpkg.com/@formatjs/intl-pluralrules/-/intl-pluralrules-1.5.8.tgz#ad8dd9ec669b8dac0e284d51772a65d92efa4ef9" + integrity sha512-OtL/rgKSSGljpxk2lRUC92ZqmzZjabwXO5zbBh2Bj8OM+z4U3H1Q5iK+ZY4k7a6EAoY7hWCr3F4k7EL8tcnQow== + dependencies: + "@formatjs/intl-utils" "^2.2.5" + "@formatjs/intl-unified-numberformat@^3.3.5": version "3.3.5" resolved "https://registry.yarnpkg.com/@formatjs/intl-unified-numberformat/-/intl-unified-numberformat-3.3.5.tgz#b150c25eb56c1b09a03bf24fb5d1e394b945a27c" @@ -1614,6 +1621,11 @@ resolved "https://registry.yarnpkg.com/@formatjs/intl-utils/-/intl-utils-2.2.4.tgz#fe62a96799d1f7dbe621fd38a4bd2e5a6a16cb0e" integrity sha512-83fsJywew0o9wQsW3VuEp33HRiFd0qbQDyFFnwZCwk59eLZ33CtKyJ5ofKMrU2KK6hk1zaIdzisrZeoNfmI3Tw== +"@formatjs/intl-utils@^2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@formatjs/intl-utils/-/intl-utils-2.2.5.tgz#eaafd94df3d102ee13e54e80f992a33868a6b1e8" + integrity sha512-p7gcmazKROteL4IECCp03Qrs790fZ8tbemUAjQu0+K0AaAlK49rI1SIFFq3LzDUAqXIshV95JJhRe/yXxkal5g== + "@fullcalendar/core@^5.0.0-beta.2": version "5.0.0-beta.2" resolved "https://registry.yarnpkg.com/@fullcalendar/core/-/core-5.0.0-beta.2.tgz#30a9cbbbf2d6476568f53cfa1c0746d06daa9660"