JSON Format

i18next JSON v4

1
{
2
"key": "value",
3
"keyDeep": {
4
"inner": "value"
5
},
6
"keyNesting": "reuse $t(keyDeep.inner)",
7
"keyInterpolate": "replace this {{value}}",
8
"keyInterpolateUnescaped": "replace this {{- value}}",
9
"keyInterpolateWithFormatting": "replace this {{value, format}}",
10
"keyContext_male": "the male variant",
11
"keyContext_female": "the female variant",
12
"keyPluralSimple_one": "the singular",
13
"keyPluralSimple_other": "the plural",
14
"keyPluralMultipleEgArabic_zero": "the plural form 0",
15
"keyPluralMultipleEgArabic_one": "the plural form 1",
16
"keyPluralMultipleEgArabic_two": "the plural form 2",
17
"keyPluralMultipleEgArabic_few": "the plural form 3",
18
"keyPluralMultipleEgArabic_many": "the plural form 4",
19
"keyPluralMultipleEgArabic_other": "the plural form 5",
20
"keyWithArrayValue": ["multipe", "things"],
21
"keyWithObjectValue": { "valueA": "return this with valueB", "valueB": "more text" }
22
}
Copied!
These are the defaults. Nesting and Interpolation formats are configurable.
To learn more about the features check the documentation:
The only difference to v3 is the plural suffixes.
You may need to polyfill the Intl.PluralRules API, in case it is not available it will fallback to the i18next JSON format v3 plural handling.

i18next JSON v3

enabled by:
1
i18next.init({
2
compatibilityJSON: 'v3'
3
});
Copied!
formats:
1
{
2
"key": "value",
3
"keyDeep": {
4
"inner": "value"
5
},
6
"keyNesting": "reuse $t(keyDeep.inner)",
7
"keyInterpolate": "replace this {{value}}",
8
"keyInterpolateUnescaped": "replace this {{- value}}",
9
"keyInterpolateWithFormatting": "replace this {{value, format}}",
10
"keyContext_male": "the male variant",
11
"keyContext_female": "the female variant",
12
"keyPluralSimple": "the singular",
13
"keyPluralSimple_plural": "the plural",
14
"keyPluralMultipleEgArabic_0": "the plural form 0",
15
"keyPluralMultipleEgArabic_1": "the plural form 1",
16
"keyPluralMultipleEgArabic_2": "the plural form 2",
17
"keyPluralMultipleEgArabic_3": "the plural form 3",
18
"keyPluralMultipleEgArabic_4": "the plural form 4",
19
"keyPluralMultipleEgArabic_5": "the plural form 5",
20
"keyWithArrayValue": ["multipe", "things"],
21
"keyWithObjectValue": { "valueA": "return this with valueB", "valueB": "more text" }
22
}
Copied!
The only difference to v2 is the plural suffixes for languages with multiple plural forms.

i18next JSON v2

enabled by:
1
i18next.init({
2
compatibilityJSON: 'v2'
3
});
Copied!
formats:
1
{
2
"key": "value",
3
"keyDeep": {
4
"inner": "value"
5
},
6
"keyNesting": "reuse $t(keyDeep.inner)",
7
"keyInterpolate": "replace this {{value}}",
8
"keyInterpolateUnescaped": "replace this {{- value}}",
9
"keyContext_male": "the male variant",
10
"keyContext_female": "the female variant",
11
"keyPluralSimple": "the singular",
12
"keyPluralSimple_plural": "the plural",
13
"keyPluralMultipleEgArabic_0": "the plural form 0",
14
"keyPluralMultipleEgArabic_1": "the plural form 1",
15
"keyPluralMultipleEgArabic_2": "the plural form 2",
16
"keyPluralMultipleEgArabic_3": "the plural form 3",
17
"keyPluralMultipleEgArabic_11": "the plural form 4",
18
"keyPluralMultipleEgArabic_100": "the plural form 5"
19
}
Copied!
These are the defaults. Nesting and Interpolation formats are configurable.

i18next JSON v1

enabled by:
1
i18next.init({
2
compatibilityJSON: 'v1'
3
});
Copied!
formats:
1
{
2
"key": "value",
3
"keyDeep": {
4
"inner": "value"
5
},
6
"keyNesting": "reuse $t(keyDeep.inner)",
7
"keyInterpolate": "replace this __value__",
8
"keyInterpolateUnescaped": "replace this __valueHTML__",
9
"keyContext_male": "the male variant",
10
"keyContext_female": "the female variant",
11
"keyPluralSimple": "the singular",
12
"keyPluralSimple_plural": "the plural",
13
"keyPluralMultipleEgArabic": "the plural form 0",
14
"keyPluralMultipleEgArabic_plural_1": "the plural form 1",
15
"keyPluralMultipleEgArabic_plural_2": "the plural form 2",
16
"keyPluralMultipleEgArabic_plural_3": "the plural form 3",
17
"keyPluralMultipleEgArabic_plural_11": "the plural form 4",
18
"keyPluralMultipleEgArabic_plural_100": "the plural form 5"
19
}
Copied!
These are the defaults. Nesting and Interpolation formats are configurable.
Last modified 1mo ago