Skip to content

Commit ca48c21

Browse files
Update README.md
1 parent 607ed0f commit ca48c21

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,35 +226,38 @@ npm install react-native-localize @formatjs/intl-pluralrules @formatjs/intl-getc
226226
In your app starting entrypoint e.g. `./index.js` or even better use a `index.android.js` to prevent importing on iOS/web put the following code. (don't forget to import the languages you want to support, in the example only english language is supported)
227227

228228
```javascript
229-
// on top of your index.js file
229+
// on top of your index.android.js file
230230
const isAndroid = require('react-native').Platform.OS === 'android';
231231
const isHermesEnabled = !!global.HermesInternal;
232232

233233
// in your index.js file
234234
if (isHermesEnabled || isAndroid) {
235+
235236
require('@formatjs/intl-getcanonicallocales/polyfill');
237+
require('@formatjs/intl-locale/polyfill');
238+
236239

237240
require('@formatjs/intl-pluralrules/polyfill');
238241
require('@formatjs/intl-pluralrules/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
239242

240-
require('@formatjs/intl-relativetimeformat/polyfill');
241-
require('@formatjs/intl-relativetimeformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
242-
243-
require('@formatjs/intl-listformat/polyfill');
244-
require('@formatjs/intl-listformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
245-
246243
require('@formatjs/intl-displaynames/polyfill');
247244
require('@formatjs/intl-displaynames/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
248-
245+
246+
require('@formatjs/intl-listformat/polyfill');
247+
require('@formatjs/intl-listformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
248+
249249
require('@formatjs/intl-numberformat/polyfill');
250250
require('@formatjs/intl-numberformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
251+
252+
require('@formatjs/intl-relativetimeformat/polyfill');
253+
require('@formatjs/intl-relativetimeformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
251254

252255
require('@formatjs/intl-datetimeformat/polyfill');
253256
require('@formatjs/intl-datetimeformat/locale-data/en.js'); // USE YOUR OWN LANGUAGE OR MULTIPLE IMPORTS YOU WANT TO SUPPORT
254257

255258
require('@formatjs/intl-datetimeformat/add-golden-tz.js');
256259

257-
require('@formatjs/intl-locale/polyfill');
260+
258261

259262
// https://formatjs.io/docs/polyfills/intl-datetimeformat/#default-timezone
260263
let RNLocalize = require('react-native-localize');

0 commit comments

Comments
 (0)