You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/I18n.md
+38-21
Original file line number
Diff line number
Diff line change
@@ -108,39 +108,56 @@ Old template of the part of a Day.js locale Object for the RelativeTime plugin.
108
108
}
109
109
```
110
110
111
-
New template of the part of a Day.js locale Object for the RelativeTime plugin. It works well for fusional languages which decline nouns and which habe two form of plural. Slavic languages like Czech language, for example. The `duration` expressions will be used if the `withoutSuffix` parameter is set to `true` in the method calls. The plural rule is an index of a function in the array in `src/plugins/relativeTime/pluralRules.js`, of a function itself. The function gets a number and return an index of the plural form to use. The keys with time units point to arrays with plural forms.
111
+
New template of the part of a Day.js locale Object for the RelativeTime plugin. It works well for fusional languages which decline nouns and which have two forms of plural. Slavic languages like Czech language, for example. The `duration` expressions will be used if the `withoutSuffix` parameter is set to `true` in the method calls.
112
112
```javascript
113
113
relativeTime: { // relative time format strings, keep %d as the same
114
114
// Plural rule for 3 plural forms in Slavic languages
115
115
pluralRule:8,
116
116
duration: {
117
-
// Static message, just one plural form needed
118
-
s: ['několik sekund'],
119
-
// for 1 minute, for 2-4 minutes, for 5 and more minutes
120
-
m: ['minuta', '%d minuty', '%d minut'],
121
-
h: ['hodina', '%d hodiny', '%d hodin'],
122
-
d: ['den', '%d dny', '%d dní'],
123
-
M: ['měsíc', '%d měsíce', '%d měsícú'],
124
-
y: ['rok', '%d roky', '%d let']
117
+
// Static message, just one singular/plural form needed
118
+
s:'několik sekund',
119
+
// Static message for a single minute without any number
120
+
m:'minuta',
121
+
// Plural forms for 1, 2 to 4, and 5 and more minutes
The plural rule is an index of a function in the array in `src/plugins/relativeTime/pluralRules.js`, or an actual function. The function gets a number and return an index of the plural form to use. The keys with two-letter time units point to arrays with plural forms. The keys with single-letter time units point to a string shown for a single value, usually without any number.
0 commit comments