Skip to content

Commit 3240efc

Browse files
authored
docs: new Crowdin updates (formatjs#2002)
1 parent 751afd3 commit 3240efc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+336
-324
lines changed

translated/es-ES/website/docs/polyfills/intl-datetimeformat.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,26 @@ import '@formatjs/intl-datetimeformat/add-all-tz' // Add ALL tz data
3535
3636
```tsx
3737
import {shouldPolyfill} from '@formatjs/intl-datetimeformat/should-polyfill'
38-
function polyfill(locale: string): Promise<any> {
39-
// This platform already supports Intl.PluralRules
38+
async function polyfill(locale: string) {
39+
// This platform already supports Intl.DateTimeFormat ES2020
4040
if (!shouldPolyfill()) {
41-
return Promise.resolve()
41+
return
4242
}
43-
const polyfills = [
44-
import('@formatjs/intl-datetimeformat/polyfill'),
45-
import('@formatjs/intl-datetimeformat/add-all-tz'),
46-
]
43+
// Load the polyfill 1st BEFORE loading data
44+
await import('@formatjs/intl-datetimeformat/polyfill')
45+
46+
// Parallelize CLDR data loading
47+
const dataPolyfills = [import('@formatjs/intl-datetimeformat/add-all-tz')]
48+
4749
switch (locale) {
4850
default:
49-
polyfills.push(import('@formatjs/intl-datetimeformat/locale-data/en'))
51+
dataPolyfills.push(import('@formatjs/intl-datetimeformat/locale-data/en'))
5052
break
5153
case 'fr':
52-
polyfills.push(import('@formatjs/intl-datetimeformat/locale-data/fr'))
54+
dataPolyfills.push(import('@formatjs/intl-datetimeformat/locale-data/fr'))
5355
break
5456
}
55-
return Promise.all(polyfills)
57+
await Promise.all(polyfills)
5658
}
5759
```
5860

translated/es-ES/website/docs/polyfills/intl-displaynames.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ import '@formatjs/intl-displaynames/locale-data/en' // locale-data for en
3434
3535
```tsx
3636
import {shouldPolyfill} from '@formatjs/intl-displaynames/should-polyfill'
37-
function polyfill(locale: string): Promise<any> {
38-
// This platform already supports Intl.PluralRules
37+
async function polyfill(locale: string) {
38+
// This platform already supports Intl.DisplayNames
3939
if (!shouldPolyfill()) {
40-
return Promise.resolve()
40+
return
4141
}
42-
const polyfills = [import('@formatjs/intl-displaynames/polyfill')]
42+
// Load the polyfill 1st BEFORE loading data
43+
await import('@formatjs/intl-displaynames/polyfill')
4344
switch (locale) {
4445
default:
45-
polyfills.push(import('@formatjs/intl-displaynames/locale-data/en'))
46+
await import('@formatjs/intl-displaynames/locale-data/en')
4647
break
4748
case 'fr':
48-
polyfills.push(import('@formatjs/intl-displaynames/locale-data/fr'))
49+
await import('@formatjs/intl-displaynames/locale-data/fr')
4950
break
5051
}
51-
return Promise.all(polyfills)
5252
}
5353
```

translated/es-ES/website/docs/polyfills/intl-getcanonicallocales.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ import '@formatjs/intl-getcanonicallocales/polyfill'
2525

2626
```tsx
2727
import {shouldPolyfill} from '@formatjs/intl-getcanonicallocales/should-polyfill'
28-
function polyfill(): Promise<any> {
29-
// This platform already supports Intl.PluralRules
30-
if (!shouldPolyfill()) {
31-
return Promise.resolve()
28+
async function polyfill() {
29+
// This platform already supports Intl.getCanonicalLocales
30+
if (shouldPolyfill()) {
31+
await import('@formatjs/intl-getcanonicallocales/polyfill')
3232
}
33-
return import('@formatjs/intl-getcanonicallocales/polyfill')
3433
}
3534
```
3635

translated/es-ES/website/docs/polyfills/intl-listformat.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,22 @@ import '@formatjs/intl-listformat/locale-data/en' // locale-data for en
3030
3131
```tsx
3232
import {shouldPolyfill} from '@formatjs/intl-listformat/should-polyfill'
33-
function polyfill(locale: string): Promise<any> {
34-
// This platform already supports Intl.PluralRules
33+
async function polyfill(locale: string) {
34+
// This platform already supports Intl.ListFormat
3535
if (!shouldPolyfill()) {
36-
return Promise.resolve()
36+
return
3737
}
38-
const polyfills = [import('@formatjs/intl-listformat/polyfill')]
38+
// Load the polyfill 1st BEFORE loading data
39+
await import('@formatjs/intl-listformat/polyfill')
3940
switch (locale) {
4041
default:
41-
polyfills.push(import('@formatjs/intl-listformat/locale-data/en'))
42+
await import('@formatjs/intl-listformat/locale-data/en')
4243
break
44+
4345
case 'fr':
44-
polyfills.push(import('@formatjs/intl-listformat/locale-data/fr'))
46+
await import('@formatjs/intl-listformat/locale-data/fr')
4547
break
4648
}
47-
return Promise.all(polyfills)
4849
}
4950
```
5051

translated/es-ES/website/docs/polyfills/intl-locale.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ import '@formatjs/intl-locale/polyfill'
2929

3030
```tsx
3131
import {shouldPolyfill} from '@formatjs/intl-locale/should-polyfill'
32-
function polyfill(locale: string): Promise<any> {
33-
// This platform already supports Intl.PluralRules
34-
if (!shouldPolyfill()) {
35-
return Promise.resolve()
32+
async function polyfill(locale: string) {
33+
// This platform already supports Intl.Locale
34+
if (shouldPolyfill()) {
35+
await import('@formatjs/intl-locale/polyfill')
3636
}
37-
return import('@formatjs/intl-locale/polyfill')
3837
}
3938
```
4039

translated/es-ES/website/docs/polyfills/intl-numberformat.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,22 @@ import '@formatjs/intl-numberformat/locale-data/en' // locale-data for en
3838
3939
```tsx
4040
import {shouldPolyfill} from '@formatjs/intl-numberformat/should-polyfill'
41-
function polyfill(locale: string): Promise<any> {
42-
// This platform already supports Intl.PluralRules
41+
async function polyfill(locale: string) {
42+
// This platform already supports Intl.NumberFormat ES2020
4343
if (!shouldPolyfill()) {
44-
return Promise.resolve()
44+
return
4545
}
46-
const polyfills = [import('@formatjs/intl-numberformat/polyfill')]
46+
// Load the polyfill 1st BEFORE loading data
47+
await import('@formatjs/intl-numberformat/polyfill')
4748
switch (locale) {
4849
default:
49-
polyfills.push(import('@formatjs/intl-numberformat/locale-data/en'))
50+
await import('@formatjs/intl-numberformat/locale-data/en')
5051
break
52+
5153
case 'fr':
52-
polyfills.push(import('@formatjs/intl-numberformat/locale-data/fr'))
54+
await import('@formatjs/intl-numberformat/locale-data/fr')
5355
break
5456
}
55-
return Promise.all(polyfills)
5657
}
5758
```
5859

translated/es-ES/website/docs/polyfills/intl-pluralrules.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ import '@formatjs/intl-pluralrules/locale-data/en' // locale-data for en
3030
3131
```tsx
3232
import {shouldPolyfill} from '@formatjs/intl-pluralrules/should-polyfill'
33-
function polyfill(locale: string): Promise<any> {
33+
async function polyfill(locale: string) {
3434
// This platform already supports Intl.PluralRules
3535
if (!shouldPolyfill()) {
36-
return Promise.resolve()
36+
return
3737
}
38-
const polyfills = [import('@formatjs/intl-pluralrules/polyfill')]
38+
// Load the polyfill 1st BEFORE loading data
39+
await import('@formatjs/intl-pluralrules/polyfill')
3940
switch (locale) {
4041
default:
41-
polyfills.push(import('@formatjs/intl-pluralrules/locale-data/en'))
42+
await import('@formatjs/intl-pluralrules/locale-data/en')
4243
break
4344
case 'fr':
44-
polyfills.push(import('@formatjs/intl-pluralrules/locale-data/fr'))
45+
await import('@formatjs/intl-pluralrules/locale-data/fr')
4546
break
4647
}
47-
return Promise.all(polyfills)
4848
}
4949
```

translated/es-ES/website/docs/polyfills/intl-relativetimeformat.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ import '@formatjs/intl-relativetimeformat/locale-data/en' // locale-data for en
3636
3737
```tsx
3838
import {shouldPolyfill} from '@formatjs/intl-relativetimeformat/should-polyfill'
39-
function polyfill(locale: string): Promise<any> {
40-
// This platform already supports Intl.PluralRules
39+
async function polyfill(locale: string) {
40+
// This platform already supports Intl.RelativeTimeFormat
4141
if (!shouldPolyfill()) {
42-
return Promise.resolve()
42+
return
4343
}
44-
const polyfills = [import('@formatjs/intl-relativetimeformat/polyfill')]
44+
// Load the polyfill 1st BEFORE loading data
45+
await import('@formatjs/intl-relativetimeformat/polyfill')
4546
switch (locale) {
4647
default:
47-
polyfills.push(import('@formatjs/intl-relativetimeformat/locale-data/en'))
48+
await import('@formatjs/intl-relativetimeformat/locale-data/en')
4849
break
4950
case 'fr':
50-
polyfills.push(import('@formatjs/intl-relativetimeformat/locale-data/fr'))
51+
await import('@formatjs/intl-relativetimeformat/locale-data/fr')
5152
break
5253
}
53-
return Promise.all(polyfills)
5454
}
5555
```
5656

translated/fr-FR/website/docs/polyfills/intl-datetimeformat.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,26 @@ import '@formatjs/intl-datetimeformat/add-all-tz' // Add ALL tz data
3535
3636
```tsx
3737
import {shouldPolyfill} from '@formatjs/intl-datetimeformat/should-polyfill'
38-
function polyfill(locale: string): Promise<any> {
39-
// This platform already supports Intl.PluralRules
38+
async function polyfill(locale: string) {
39+
// This platform already supports Intl.DateTimeFormat ES2020
4040
if (!shouldPolyfill()) {
41-
return Promise.resolve()
41+
return
4242
}
43-
const polyfills = [
44-
import('@formatjs/intl-datetimeformat/polyfill'),
45-
import('@formatjs/intl-datetimeformat/add-all-tz'),
46-
]
43+
// Load the polyfill 1st BEFORE loading data
44+
await import('@formatjs/intl-datetimeformat/polyfill')
45+
46+
// Parallelize CLDR data loading
47+
const dataPolyfills = [import('@formatjs/intl-datetimeformat/add-all-tz')]
48+
4749
switch (locale) {
4850
default:
49-
polyfills.push(import('@formatjs/intl-datetimeformat/locale-data/en'))
51+
dataPolyfills.push(import('@formatjs/intl-datetimeformat/locale-data/en'))
5052
break
5153
case 'fr':
52-
polyfills.push(import('@formatjs/intl-datetimeformat/locale-data/fr'))
54+
dataPolyfills.push(import('@formatjs/intl-datetimeformat/locale-data/fr'))
5355
break
5456
}
55-
return Promise.all(polyfills)
57+
await Promise.all(polyfills)
5658
}
5759
```
5860

translated/fr-FR/website/docs/polyfills/intl-displaynames.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ import '@formatjs/intl-displaynames/locale-data/en' // locale-data for en
3434
3535
```tsx
3636
import {shouldPolyfill} from '@formatjs/intl-displaynames/should-polyfill'
37-
function polyfill(locale: string): Promise<any> {
38-
// This platform already supports Intl.PluralRules
37+
async function polyfill(locale: string) {
38+
// This platform already supports Intl.DisplayNames
3939
if (!shouldPolyfill()) {
40-
return Promise.resolve()
40+
return
4141
}
42-
const polyfills = [import('@formatjs/intl-displaynames/polyfill')]
42+
// Load the polyfill 1st BEFORE loading data
43+
await import('@formatjs/intl-displaynames/polyfill')
4344
switch (locale) {
4445
default:
45-
polyfills.push(import('@formatjs/intl-displaynames/locale-data/en'))
46+
await import('@formatjs/intl-displaynames/locale-data/en')
4647
break
4748
case 'fr':
48-
polyfills.push(import('@formatjs/intl-displaynames/locale-data/fr'))
49+
await import('@formatjs/intl-displaynames/locale-data/fr')
4950
break
5051
}
51-
return Promise.all(polyfills)
5252
}
5353
```

0 commit comments

Comments
 (0)