Skip to content

Commit 35fe486

Browse files
authored
docs: new Crowdin updates (formatjs#2003)
1 parent ad60b3b commit 35fe486

Some content is hidden

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

42 files changed

+522
-474
lines changed

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

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,29 @@ import '@formatjs/intl-datetimeformat/add-all-tz' // Add ALL tz data
3636
```tsx
3737
import {shouldPolyfill} from '@formatjs/intl-datetimeformat/should-polyfill'
3838
async function polyfill(locale: string) {
39-
// This platform already supports Intl.DateTimeFormat ES2020
40-
if (!shouldPolyfill()) {
41-
return
39+
if (shouldPolyfill()) {
40+
// Load the polyfill 1st BEFORE loading data
41+
await import('@formatjs/intl-datetimeformat/polyfill')
4242
}
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-
49-
switch (locale) {
50-
default:
51-
dataPolyfills.push(import('@formatjs/intl-datetimeformat/locale-data/en'))
52-
break
53-
case 'fr':
54-
dataPolyfills.push(import('@formatjs/intl-datetimeformat/locale-data/fr'))
55-
break
43+
44+
if (Intl.DateTimeFormat.polyfilled) {
45+
// Parallelize CLDR data loading
46+
const dataPolyfills = [import('@formatjs/intl-datetimeformat/add-all-tz')]
47+
48+
switch (locale) {
49+
default:
50+
dataPolyfills.push(
51+
import('@formatjs/intl-datetimeformat/locale-data/en')
52+
)
53+
break
54+
case 'fr':
55+
dataPolyfills.push(
56+
import('@formatjs/intl-datetimeformat/locale-data/fr')
57+
)
58+
break
59+
}
60+
await Promise.all(polyfills)
5661
}
57-
await Promise.all(polyfills)
5862
}
5963
```
6064

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,20 @@ import '@formatjs/intl-displaynames/locale-data/en' // locale-data for en
3535
```tsx
3636
import {shouldPolyfill} from '@formatjs/intl-displaynames/should-polyfill'
3737
async function polyfill(locale: string) {
38-
// This platform already supports Intl.DisplayNames
39-
if (!shouldPolyfill()) {
40-
return
38+
if (shouldPolyfill()) {
39+
// Load the polyfill 1st BEFORE loading data
40+
await import('@formatjs/intl-displaynames/polyfill')
4141
}
42-
// Load the polyfill 1st BEFORE loading data
43-
await import('@formatjs/intl-displaynames/polyfill')
44-
switch (locale) {
45-
default:
46-
await import('@formatjs/intl-displaynames/locale-data/en')
47-
break
48-
case 'fr':
49-
await import('@formatjs/intl-displaynames/locale-data/fr')
50-
break
42+
43+
if (Intl.DisplayNames.polyfilled) {
44+
switch (locale) {
45+
default:
46+
await import('@formatjs/intl-displaynames/locale-data/en')
47+
break
48+
case 'fr':
49+
await import('@formatjs/intl-displaynames/locale-data/fr')
50+
break
51+
}
5152
}
5253
}
5354
```

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,21 @@ import '@formatjs/intl-listformat/locale-data/en' // locale-data for en
3232
import {shouldPolyfill} from '@formatjs/intl-listformat/should-polyfill'
3333
async function polyfill(locale: string) {
3434
// This platform already supports Intl.ListFormat
35-
if (!shouldPolyfill()) {
36-
return
35+
if (shouldPolyfill()) {
36+
// Load the polyfill 1st BEFORE loading data
37+
await import('@formatjs/intl-listformat/polyfill')
3738
}
38-
// Load the polyfill 1st BEFORE loading data
39-
await import('@formatjs/intl-listformat/polyfill')
40-
switch (locale) {
41-
default:
42-
await import('@formatjs/intl-listformat/locale-data/en')
43-
break
44-
45-
case 'fr':
46-
await import('@formatjs/intl-listformat/locale-data/fr')
47-
break
39+
40+
if (Intl.ListFormat.polyfilled) {
41+
switch (locale) {
42+
default:
43+
await import('@formatjs/intl-listformat/locale-data/en')
44+
break
45+
46+
case 'fr':
47+
await import('@formatjs/intl-listformat/locale-data/fr')
48+
break
49+
}
4850
}
4951
}
5052
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import '@formatjs/intl-locale/polyfill'
2929

3030
```tsx
3131
import {shouldPolyfill} from '@formatjs/intl-locale/should-polyfill'
32-
async function polyfill(locale: string) {
32+
async function polyfill() {
3333
// This platform already supports Intl.Locale
3434
if (shouldPolyfill()) {
3535
await import('@formatjs/intl-locale/polyfill')

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,19 @@ import '@formatjs/intl-numberformat/locale-data/en' // locale-data for en
3939
```tsx
4040
import {shouldPolyfill} from '@formatjs/intl-numberformat/should-polyfill'
4141
async function polyfill(locale: string) {
42-
// This platform already supports Intl.NumberFormat ES2020
43-
if (!shouldPolyfill()) {
44-
return
42+
if (shouldPolyfill()) {
43+
// Load the polyfill 1st BEFORE loading data
44+
await import('@formatjs/intl-numberformat/polyfill')
4545
}
46-
// Load the polyfill 1st BEFORE loading data
47-
await import('@formatjs/intl-numberformat/polyfill')
48-
switch (locale) {
49-
default:
50-
await import('@formatjs/intl-numberformat/locale-data/en')
51-
break
52-
53-
case 'fr':
54-
await import('@formatjs/intl-numberformat/locale-data/fr')
55-
break
46+
if (Intl.NumberFormat.polyfilled) {
47+
switch (locale) {
48+
default:
49+
await import('@formatjs/intl-numberformat/locale-data/en')
50+
break
51+
case 'fr':
52+
await import('@formatjs/intl-numberformat/locale-data/fr')
53+
break
54+
}
5655
}
5756
}
5857
```

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,20 @@ import '@formatjs/intl-pluralrules/locale-data/en' // locale-data for en
3131
```tsx
3232
import {shouldPolyfill} from '@formatjs/intl-pluralrules/should-polyfill'
3333
async function polyfill(locale: string) {
34-
// This platform already supports Intl.PluralRules
35-
if (!shouldPolyfill()) {
36-
return
34+
if (shouldPolyfill()) {
35+
// Load the polyfill 1st BEFORE loading data
36+
await import('@formatjs/intl-pluralrules/polyfill')
3737
}
38-
// Load the polyfill 1st BEFORE loading data
39-
await import('@formatjs/intl-pluralrules/polyfill')
40-
switch (locale) {
41-
default:
42-
await import('@formatjs/intl-pluralrules/locale-data/en')
43-
break
44-
case 'fr':
45-
await import('@formatjs/intl-pluralrules/locale-data/fr')
46-
break
38+
39+
if (Intl.PluralRules.polyfilled) {
40+
switch (locale) {
41+
default:
42+
await import('@formatjs/intl-pluralrules/locale-data/en')
43+
break
44+
case 'fr':
45+
await import('@formatjs/intl-pluralrules/locale-data/fr')
46+
break
47+
}
4748
}
4849
}
4950
```

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,20 @@ import '@formatjs/intl-relativetimeformat/locale-data/en' // locale-data for en
3737
```tsx
3838
import {shouldPolyfill} from '@formatjs/intl-relativetimeformat/should-polyfill'
3939
async function polyfill(locale: string) {
40-
// This platform already supports Intl.RelativeTimeFormat
41-
if (!shouldPolyfill()) {
42-
return
40+
if (shouldPolyfill()) {
41+
// Load the polyfill 1st BEFORE loading data
42+
await import('@formatjs/intl-relativetimeformat/polyfill')
4343
}
44-
// Load the polyfill 1st BEFORE loading data
45-
await import('@formatjs/intl-relativetimeformat/polyfill')
46-
switch (locale) {
47-
default:
48-
await import('@formatjs/intl-relativetimeformat/locale-data/en')
49-
break
50-
case 'fr':
51-
await import('@formatjs/intl-relativetimeformat/locale-data/fr')
52-
break
44+
45+
if (Intl.RelativeTimeFormat.polyfilled) {
46+
switch (locale) {
47+
default:
48+
await import('@formatjs/intl-relativetimeformat/locale-data/en')
49+
break
50+
case 'fr':
51+
await import('@formatjs/intl-relativetimeformat/locale-data/fr')
52+
break
53+
}
5354
}
5455
}
5556
```

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

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,29 @@ import '@formatjs/intl-datetimeformat/add-all-tz' // Add ALL tz data
3636
```tsx
3737
import {shouldPolyfill} from '@formatjs/intl-datetimeformat/should-polyfill'
3838
async function polyfill(locale: string) {
39-
// This platform already supports Intl.DateTimeFormat ES2020
40-
if (!shouldPolyfill()) {
41-
return
39+
if (shouldPolyfill()) {
40+
// Load the polyfill 1st BEFORE loading data
41+
await import('@formatjs/intl-datetimeformat/polyfill')
4242
}
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-
49-
switch (locale) {
50-
default:
51-
dataPolyfills.push(import('@formatjs/intl-datetimeformat/locale-data/en'))
52-
break
53-
case 'fr':
54-
dataPolyfills.push(import('@formatjs/intl-datetimeformat/locale-data/fr'))
55-
break
43+
44+
if (Intl.DateTimeFormat.polyfilled) {
45+
// Parallelize CLDR data loading
46+
const dataPolyfills = [import('@formatjs/intl-datetimeformat/add-all-tz')]
47+
48+
switch (locale) {
49+
default:
50+
dataPolyfills.push(
51+
import('@formatjs/intl-datetimeformat/locale-data/en')
52+
)
53+
break
54+
case 'fr':
55+
dataPolyfills.push(
56+
import('@formatjs/intl-datetimeformat/locale-data/fr')
57+
)
58+
break
59+
}
60+
await Promise.all(polyfills)
5661
}
57-
await Promise.all(polyfills)
5862
}
5963
```
6064

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,20 @@ import '@formatjs/intl-displaynames/locale-data/en' // locale-data for en
3535
```tsx
3636
import {shouldPolyfill} from '@formatjs/intl-displaynames/should-polyfill'
3737
async function polyfill(locale: string) {
38-
// This platform already supports Intl.DisplayNames
39-
if (!shouldPolyfill()) {
40-
return
38+
if (shouldPolyfill()) {
39+
// Load the polyfill 1st BEFORE loading data
40+
await import('@formatjs/intl-displaynames/polyfill')
4141
}
42-
// Load the polyfill 1st BEFORE loading data
43-
await import('@formatjs/intl-displaynames/polyfill')
44-
switch (locale) {
45-
default:
46-
await import('@formatjs/intl-displaynames/locale-data/en')
47-
break
48-
case 'fr':
49-
await import('@formatjs/intl-displaynames/locale-data/fr')
50-
break
42+
43+
if (Intl.DisplayNames.polyfilled) {
44+
switch (locale) {
45+
default:
46+
await import('@formatjs/intl-displaynames/locale-data/en')
47+
break
48+
case 'fr':
49+
await import('@formatjs/intl-displaynames/locale-data/fr')
50+
break
51+
}
5152
}
5253
}
5354
```

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,21 @@ import '@formatjs/intl-listformat/locale-data/en' // locale-data for en
3232
import {shouldPolyfill} from '@formatjs/intl-listformat/should-polyfill'
3333
async function polyfill(locale: string) {
3434
// This platform already supports Intl.ListFormat
35-
if (!shouldPolyfill()) {
36-
return
35+
if (shouldPolyfill()) {
36+
// Load the polyfill 1st BEFORE loading data
37+
await import('@formatjs/intl-listformat/polyfill')
3738
}
38-
// Load the polyfill 1st BEFORE loading data
39-
await import('@formatjs/intl-listformat/polyfill')
40-
switch (locale) {
41-
default:
42-
await import('@formatjs/intl-listformat/locale-data/en')
43-
break
44-
45-
case 'fr':
46-
await import('@formatjs/intl-listformat/locale-data/fr')
47-
break
39+
40+
if (Intl.ListFormat.polyfilled) {
41+
switch (locale) {
42+
default:
43+
await import('@formatjs/intl-listformat/locale-data/en')
44+
break
45+
46+
case 'fr':
47+
await import('@formatjs/intl-listformat/locale-data/fr')
48+
break
49+
}
4850
}
4951
}
5052
```

0 commit comments

Comments
 (0)