diff --git a/scripts/list-outdated-dependencies/mobile-dependencies.txt b/scripts/list-outdated-dependencies/mobile-dependencies.txt index da52d28a5be..90131efcbf2 100644 --- a/scripts/list-outdated-dependencies/mobile-dependencies.txt +++ b/scripts/list-outdated-dependencies/mobile-dependencies.txt @@ -66,4 +66,5 @@ react-native-reanimated yup metro metro-react-native-babel-preset -jest-expo \ No newline at end of file +jest-expo +intl-pluralrules \ No newline at end of file diff --git a/suite-native/intl/package.json b/suite-native/intl/package.json index 4ea4f5b955c..65f9b06440f 100644 --- a/suite-native/intl/package.json +++ b/suite-native/intl/package.json @@ -13,6 +13,7 @@ "type-check": "yarn g:tsc --build" }, "dependencies": { + "intl-pluralrules": "^2.0.1", "react": "18.2.0", "react-intl": "^6.6.8" } diff --git a/suite-native/intl/src/IntlProvider.tsx b/suite-native/intl/src/IntlProvider.tsx index 5e7f64404ea..2576cf0478e 100644 --- a/suite-native/intl/src/IntlProvider.tsx +++ b/suite-native/intl/src/IntlProvider.tsx @@ -1,5 +1,8 @@ import { IntlProvider as ReactIntlProvider } from 'react-intl'; +// Polyfill to support plural syntax +import 'intl-pluralrules'; + import { en } from './en'; // flatten object to single level deep like { a: { b: { c: 1 } } } => { 'a.b.c': 1 } diff --git a/suite-native/intl/src/en.ts b/suite-native/intl/src/en.ts index 92c47d6f947..4b8833862ee 100644 --- a/suite-native/intl/src/en.ts +++ b/suite-native/intl/src/en.ts @@ -85,7 +85,7 @@ export const en = { }, }, accountList: { - numberOfTokens: '+{numberOfTokens} Tokens', + numberOfTokens: '+{numberOfTokens, plural, one{1 Token} other{# Tokens}}', tokens: 'Tokens', }, assets: { diff --git a/yarn.lock b/yarn.lock index 042842ed1ee..5a6dd04e4b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9998,6 +9998,7 @@ __metadata: version: 0.0.0-use.local resolution: "@suite-native/intl@workspace:suite-native/intl" dependencies: + intl-pluralrules: "npm:^2.0.1" react: "npm:18.2.0" react-intl: "npm:^6.6.8" languageName: unknown @@ -25759,6 +25760,13 @@ __metadata: languageName: node linkType: hard +"intl-pluralrules@npm:^2.0.1": + version: 2.0.1 + resolution: "intl-pluralrules@npm:2.0.1" + checksum: 10/562964d81c4477ab0b66e051c31cdbb2ca599307ffdfdc88a1e16d2cf137e481082b90d5ad81f9d2d5f6767ec5528d764a44462f6752109ac035c04604973e23 + languageName: node + linkType: hard + "into-stream@npm:^6.0.0": version: 6.0.0 resolution: "into-stream@npm:6.0.0"