-
-
Notifications
You must be signed in to change notification settings - Fork 407
/
Copy pathro.ts
26 lines (24 loc) · 959 Bytes
/
ro.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
export default function(number: number, index: number): [string, string] {
const langTable = [
['chiar acum', 'chiar acum'],
['acum %s secunde', 'peste %s secunde'],
['acum un minut', 'peste un minut'],
['acum %s minute', 'peste %s minute'],
['acum o oră', 'peste o oră'],
['acum %s ore', 'peste %s ore'],
['acum o zi', 'peste o zi'],
['acum %s zile', 'peste %s zile'],
['acum o săptămână', 'peste o săptămână'],
['acum %s săptămâni', 'peste %s săptămâni'],
['acum o lună', 'peste o lună'],
['acum %s luni', 'peste %s luni'],
['acum un an', 'peste un an'],
['acum %s ani', 'peste %s ani'],
];
if (number < 20) {
return langTable[index] as [string, string];
}
// A `de` preposition must be added between the number and the adverb
// if the number is greater than 20.
return [langTable[index][0].replace('%s', '%s de'), langTable[index][1].replace('%s', '%s de')];
}