Skip to content

Commit 94ddbcf

Browse files
authored
Merge pull request #10 from aboutbits/add-translations-for-ru
Add translations for Russian
2 parents 5b1bdb1 + cb07fee commit 94ddbcf

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

src/ru.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import {
2+
MixedLocale,
3+
StringLocale,
4+
NumberLocale,
5+
DateLocale,
6+
BooleanLocale,
7+
ObjectLocale,
8+
ArrayLocale,
9+
LocaleObject,
10+
} from 'yup/es/locale'
11+
12+
export const mixed: Required<MixedLocale> = {
13+
default: 'Недопустимое значение',
14+
required: 'Обязательное поле',
15+
defined: 'Обязательное поле',
16+
oneOf: 'Одно из: ${values}',
17+
notOneOf: 'Не одно из: ${values}',
18+
notType: 'Недопустимый тип',
19+
}
20+
21+
export const string: Required<StringLocale> = {
22+
length: 'Должно содержать ровно ${length} символов',
23+
min: 'Минимум ${min} символов',
24+
max: 'Максимум ${max} символов',
25+
matches: 'Должно соответствовать: "${regex}"',
26+
email: 'Недопустимый email',
27+
url: 'Недопустимый URL',
28+
uuid: 'Недопустимый UUID',
29+
trim: 'Не обрезано',
30+
lowercase: 'Только строчные буквы',
31+
uppercase: 'Только заглавные буквы',
32+
}
33+
34+
export const number: Required<NumberLocale> = {
35+
min: 'Минимум: ${min}',
36+
max: 'Максимум: ${max}',
37+
lessThan: 'Меньше ${less}',
38+
moreThan: 'Больше ${more}',
39+
positive: 'Положительное число',
40+
negative: 'Отрицательное число',
41+
integer: 'Только числа',
42+
}
43+
44+
export const date: Required<DateLocale> = {
45+
min: 'Позже ${min}',
46+
max: 'Раньше ${max}',
47+
}
48+
49+
export const boolean: BooleanLocale = {
50+
isValue: 'Должно быть ${value}',
51+
}
52+
53+
export const object: Required<ObjectLocale> = {
54+
noUnknown: 'Неизвестное значение',
55+
}
56+
57+
export const array: Required<ArrayLocale> = {
58+
min: 'Минимум ${min} элементов',
59+
max: 'Не более ${max} элементов',
60+
length: 'Ровно ${length} элементов',
61+
}
62+
63+
export default {
64+
mixed,
65+
string,
66+
number,
67+
date,
68+
object,
69+
array,
70+
boolean,
71+
} as LocaleObject

0 commit comments

Comments
 (0)