@jarenjs/locales 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/types/ar.d.ts +7 -0
- package/dist/types/de.d.ts +7 -0
- package/dist/types/es.d.ts +7 -0
- package/dist/types/fr.d.ts +7 -0
- package/dist/types/helpers.d.ts +41 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/ja.d.ts +7 -0
- package/dist/types/ko.d.ts +7 -0
- package/dist/types/nl.d.ts +7 -0
- package/dist/types/pt.d.ts +7 -0
- package/dist/types/ru.d.ts +7 -0
- package/dist/types/tr.d.ts +7 -0
- package/dist/types/zh-tw.d.ts +7 -0
- package/package.json +95 -0
- package/src/ar.js +159 -0
- package/src/de.js +131 -0
- package/src/es.js +131 -0
- package/src/fr.js +131 -0
- package/src/helpers.js +59 -0
- package/src/index.js +26 -0
- package/src/ja.js +126 -0
- package/src/ko.js +129 -0
- package/src/nl.js +130 -0
- package/src/pt.js +131 -0
- package/src/ru.js +141 -0
- package/src/tr.js +128 -0
- package/src/zh-tw.js +129 -0
package/src/ko.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
//@ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Korean (ko) message catalog for @jarenjs/validate and @jarenjs/forms.
|
|
5
|
+
*
|
|
6
|
+
* A catalog is a plain flat object `{ [key]: closure | template string }`;
|
|
7
|
+
* compile it with `compileMessageCatalog` from either consumer package
|
|
8
|
+
* and hand it to `localizeErrors` (validate) or the `catalog` parameters
|
|
9
|
+
* of `validateField` / `evaluateFormRules` (forms). A pack imports only
|
|
10
|
+
* the shared rendering helpers; key parity with the built-in English
|
|
11
|
+
* catalogs is enforced by tests in the repo, not by imports.
|
|
12
|
+
*
|
|
13
|
+
* Globalization mechanics (the pack-authoring pattern - see
|
|
14
|
+
* packages/validate/docs/ERROR-MESSAGES.md):
|
|
15
|
+
* - Korean has no grammatical plural, so there is no plural helper here;
|
|
16
|
+
* counts read through counters ("2자", "3개"). Where a subject particle
|
|
17
|
+
* would depend on the final consonant of interpolated text, the
|
|
18
|
+
* messages either hedge ("이(가)") or attach the particle to a fixed
|
|
19
|
+
* noun instead - the standard software-string conventions,
|
|
20
|
+
* - `Intl.NumberFormat` renders numeric limits the Korean way,
|
|
21
|
+
* - `Intl.ListFormat` renders enum alternatives ("a, b 또는 c"),
|
|
22
|
+
* all held as module-level singletons (allocation discipline).
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
formatMessageValue,
|
|
27
|
+
makeNumberRenderer,
|
|
28
|
+
makeTypeNamer,
|
|
29
|
+
} from './helpers.js';
|
|
30
|
+
|
|
31
|
+
//#region Intl singletons
|
|
32
|
+
|
|
33
|
+
const numberFormat = new Intl.NumberFormat('ko-KR');
|
|
34
|
+
const listFormat = new Intl.ListFormat('ko', { style: 'long', type: 'disjunction' });
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Render a numeric limit through the Korean number format; non-numbers
|
|
38
|
+
* (e.g. an unresolved $data pointer) render as-is.
|
|
39
|
+
*/
|
|
40
|
+
const num = makeNumberRenderer(numberFormat);
|
|
41
|
+
|
|
42
|
+
/** Korean names for the JSON Schema type keyword values. */
|
|
43
|
+
const TYPE_NAMES = {
|
|
44
|
+
string: '문자열 (string)',
|
|
45
|
+
number: '숫자',
|
|
46
|
+
integer: '정수',
|
|
47
|
+
boolean: '불리언',
|
|
48
|
+
array: '배열 (array)',
|
|
49
|
+
object: '객체',
|
|
50
|
+
null: 'null',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** Type keyword values under their Korean display name. */
|
|
54
|
+
const typeName = makeTypeNamer(TYPE_NAMES);
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The Korean catalog. Covers every key of validate's `messagesEn`,
|
|
60
|
+
* every `form/*` key of forms' `formsMessagesEn`, `x-form/assert`, and
|
|
61
|
+
* the `JQ2xxx` codes reachable through `$query`.
|
|
62
|
+
* @type {Record<string, string | ((params: any, error?: object) => string)>}
|
|
63
|
+
*/
|
|
64
|
+
export const ko = {
|
|
65
|
+
//#region @jarenjs/validate (document voice)
|
|
66
|
+
type: (p) => p.types
|
|
67
|
+
? `다음 유형 중 하나여야 합니다: ${p.types.join(', ')}`
|
|
68
|
+
: `${typeName(p.type)} 유형이어야 합니다`,
|
|
69
|
+
required: (p) => p.missingProperty
|
|
70
|
+
? `필수 속성 '${p.missingProperty}'이(가) 필요합니다`
|
|
71
|
+
: '필수 속성이 필요합니다',
|
|
72
|
+
minimum: (p) => `${p.comparison} ${num(p.limit)} 이어야 합니다`,
|
|
73
|
+
maximum: (p) => `${p.comparison} ${num(p.limit)} 이어야 합니다`,
|
|
74
|
+
exclusiveMinimum: (p) => `${p.comparison} ${num(p.limit)} 이어야 합니다`,
|
|
75
|
+
exclusiveMaximum: (p) => `${p.comparison} ${num(p.limit)} 이어야 합니다`,
|
|
76
|
+
multipleOf: (p) => `${num(p.multipleOf)}의 배수여야 합니다`,
|
|
77
|
+
minLength: (p) => `${num(p.limit)}자 이상이어야 합니다`,
|
|
78
|
+
maxLength: (p) => `${num(p.limit)}자 이하여야 합니다`,
|
|
79
|
+
pattern: '"{pattern}" 패턴과 일치해야 합니다',
|
|
80
|
+
additionalProperties: (p) => p.additionalProperty
|
|
81
|
+
? `추가 속성 '${p.additionalProperty}'은(는) 허용되지 않습니다`
|
|
82
|
+
: '추가 속성은 허용되지 않습니다',
|
|
83
|
+
minProperties: (p) => `속성이 ${num(p.limit)}개 이상이어야 합니다`,
|
|
84
|
+
maxProperties: (p) => `속성이 ${num(p.limit)}개 이하여야 합니다`,
|
|
85
|
+
minItems: (p) => `항목이 ${num(p.limit)}개 이상이어야 합니다`,
|
|
86
|
+
maxItems: (p) => `항목이 ${num(p.limit)}개 이하여야 합니다`,
|
|
87
|
+
uniqueItems: '중복된 항목이 없어야 합니다',
|
|
88
|
+
contains: '유효한 항목을 하나 이상 포함해야 합니다',
|
|
89
|
+
items: '배열의 항목이 유효하지 않습니다',
|
|
90
|
+
allOf: '모든 하위 스키마와 일치해야 합니다',
|
|
91
|
+
anyOf: 'anyOf의 하위 스키마 중 하나와 일치해야 합니다',
|
|
92
|
+
oneOf: 'oneOf의 하위 스키마 중 정확히 하나와 일치해야 합니다',
|
|
93
|
+
not: '하위 스키마와 일치하지 않아야 합니다',
|
|
94
|
+
format: '"{format}" 형식과 일치해야 합니다',
|
|
95
|
+
if: '"if" 스키마와 일치해야 합니다',
|
|
96
|
+
then: '"then" 스키마와 일치해야 합니다',
|
|
97
|
+
else: '"else" 스키마와 일치해야 합니다',
|
|
98
|
+
'false schema': '불리언 스키마 false는 항상 유효하지 않습니다',
|
|
99
|
+
$query: (p) => p.code
|
|
100
|
+
? `'$query' 어설션이 '${p.docPath}'에서 ${p.code} 오류를 발생시켰습니다`
|
|
101
|
+
: "'$query' 어설션을 만족해야 합니다",
|
|
102
|
+
JQ2001: (p) => `'$query' 어설션을 평가할 수 없습니다 ('${p.docPath}'에서 ${p.code})`,
|
|
103
|
+
JQ2003: (p) => `'$query' 어설션이 여러 개의 결과를 반환했습니다 ('${p.docPath}'에서 ${p.code})`,
|
|
104
|
+
//#endregion
|
|
105
|
+
|
|
106
|
+
//#region @jarenjs/forms (second-person field voice)
|
|
107
|
+
'form/required': '이 항목은 필수입니다',
|
|
108
|
+
'form/type': (p) => `${typeName(p.type)} 유형이어야 합니다`,
|
|
109
|
+
'form/const': (p) => `${formatMessageValue(p.constValue)} 값이어야 합니다`,
|
|
110
|
+
'form/enum': (p) => `${Array.isArray(p.enumValues) ? listFormat.format(p.enumValues.map(formatMessageValue)) : formatMessageValue(p.enumValues)} 중 하나여야 합니다`,
|
|
111
|
+
'form/minLength': (p) => `${num(p.limit)}자 이상 입력해야 합니다 (현재 ${num(p.len)}자)`,
|
|
112
|
+
'form/maxLength': (p) => `${num(p.limit)}자 이하로 입력해야 합니다 (현재 ${num(p.len)}자)`,
|
|
113
|
+
'form/pattern': '{pattern} 패턴과 일치해야 합니다',
|
|
114
|
+
'form/format': (p) => `올바른 ${p.format} 형식이어야 합니다`,
|
|
115
|
+
'form/minimum': (p) => `${num(p.limit)} 이상이어야 합니다`,
|
|
116
|
+
'form/maximum': (p) => `${num(p.limit)} 이하여야 합니다`,
|
|
117
|
+
'form/exclusiveMinimum': (p) => `${num(p.limit)}보다 커야 합니다`,
|
|
118
|
+
'form/exclusiveMaximum': (p) => `${num(p.limit)}보다 작아야 합니다`,
|
|
119
|
+
'form/multipleOf': (p) => `${num(p.multipleOf)}의 배수여야 합니다`,
|
|
120
|
+
'form/minItems': (p) => `항목이 ${num(p.limit)}개 이상 필요합니다`,
|
|
121
|
+
'form/maxItems': (p) => `항목은 ${num(p.limit)}개 이하여야 합니다`,
|
|
122
|
+
'form/uniqueItems': '항목은 서로 달라야 합니다',
|
|
123
|
+
'form/minProperties': (p) => `속성이 ${num(p.limit)}개 이상 필요합니다`,
|
|
124
|
+
'form/maxProperties': (p) => `속성은 ${num(p.limit)}개 이하여야 합니다`,
|
|
125
|
+
'x-form/assert': '유효하지 않은 값입니다',
|
|
126
|
+
'form/addItem': '항목 추가',
|
|
127
|
+
'form/removeItem': '항목 삭제',
|
|
128
|
+
//#endregion
|
|
129
|
+
};
|
package/src/nl.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
//@ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Dutch (nl) message catalog for @jarenjs/validate and @jarenjs/forms.
|
|
5
|
+
*
|
|
6
|
+
* A catalog is a plain flat object `{ [key]: closure | template string }`;
|
|
7
|
+
* compile it with `compileMessageCatalog` from either consumer package
|
|
8
|
+
* and hand it to `localizeErrors` (validate) or the `catalog` parameters
|
|
9
|
+
* of `validateField` / `evaluateFormRules` (forms). A pack imports only
|
|
10
|
+
* the shared rendering helpers; key parity with the built-in English
|
|
11
|
+
* catalogs is enforced by tests in the repo, not by imports.
|
|
12
|
+
*
|
|
13
|
+
* Globalization mechanics (the pack-authoring pattern - see
|
|
14
|
+
* packages/validate/docs/ERROR-MESSAGES.md):
|
|
15
|
+
* - `Intl.PluralRules` picks plural categories ("1 teken" / "2 tekens"),
|
|
16
|
+
* - `Intl.NumberFormat` renders numeric limits the Dutch way,
|
|
17
|
+
* - `Intl.ListFormat` renders enum alternatives ("a, b of c"),
|
|
18
|
+
* all held as module-level singletons (allocation discipline).
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
formatMessageValue,
|
|
23
|
+
makeNumberRenderer,
|
|
24
|
+
makePluralPicker,
|
|
25
|
+
makeTypeNamer,
|
|
26
|
+
} from './helpers.js';
|
|
27
|
+
|
|
28
|
+
//#region Intl singletons
|
|
29
|
+
|
|
30
|
+
const pluralRules = new Intl.PluralRules('nl');
|
|
31
|
+
const numberFormat = new Intl.NumberFormat('nl-NL');
|
|
32
|
+
const listFormat = new Intl.ListFormat('nl', { style: 'long', type: 'disjunction' });
|
|
33
|
+
|
|
34
|
+
/** Pick the Dutch singular or plural noun form for a count. */
|
|
35
|
+
const plural = makePluralPicker(pluralRules);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Render a numeric limit through the Dutch number format; non-numbers
|
|
39
|
+
* (e.g. an unresolved $data pointer) render as-is.
|
|
40
|
+
*/
|
|
41
|
+
const num = makeNumberRenderer(numberFormat);
|
|
42
|
+
|
|
43
|
+
/** Dutch names for the JSON Schema type keyword values. */
|
|
44
|
+
const TYPE_NAMES = {
|
|
45
|
+
string: 'tekst (string)',
|
|
46
|
+
number: 'getal',
|
|
47
|
+
integer: 'geheel getal',
|
|
48
|
+
boolean: 'boolean',
|
|
49
|
+
array: 'lijst (array)',
|
|
50
|
+
object: 'object',
|
|
51
|
+
null: 'null',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** Type keyword values under their Dutch display name. */
|
|
55
|
+
const typeName = makeTypeNamer(TYPE_NAMES);
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The Dutch catalog. Covers every key of validate's `messagesEn`, every
|
|
61
|
+
* `form/*` key of forms' `formsMessagesEn`, `x-form/assert`, and the
|
|
62
|
+
* `JQ2xxx` codes reachable through `$query`.
|
|
63
|
+
* @type {Record<string, string | ((params: any, error?: object) => string)>}
|
|
64
|
+
*/
|
|
65
|
+
export const nl = {
|
|
66
|
+
//#region @jarenjs/validate (document voice)
|
|
67
|
+
type: (p) => p.types
|
|
68
|
+
? `moet een van de volgende typen zijn: ${p.types.join(', ')}`
|
|
69
|
+
: `moet een ${typeName(p.type)} zijn`,
|
|
70
|
+
required: (p) => p.missingProperty
|
|
71
|
+
? `moet de verplichte eigenschap '${p.missingProperty}' bevatten`
|
|
72
|
+
: 'moet de verplichte eigenschappen bevatten',
|
|
73
|
+
minimum: (p) => `moet ${p.comparison} ${num(p.limit)} zijn`,
|
|
74
|
+
maximum: (p) => `moet ${p.comparison} ${num(p.limit)} zijn`,
|
|
75
|
+
exclusiveMinimum: (p) => `moet ${p.comparison} ${num(p.limit)} zijn`,
|
|
76
|
+
exclusiveMaximum: (p) => `moet ${p.comparison} ${num(p.limit)} zijn`,
|
|
77
|
+
multipleOf: (p) => `moet een veelvoud van ${num(p.multipleOf)} zijn`,
|
|
78
|
+
minLength: (p) => `mag niet minder dan ${num(p.limit)} ${plural(p.limit, 'teken', 'tekens')} bevatten`,
|
|
79
|
+
maxLength: (p) => `mag niet meer dan ${num(p.limit)} ${plural(p.limit, 'teken', 'tekens')} bevatten`,
|
|
80
|
+
pattern: 'moet overeenkomen met patroon "{pattern}"',
|
|
81
|
+
additionalProperties: (p) => p.additionalProperty
|
|
82
|
+
? `mag de extra eigenschap '${p.additionalProperty}' niet bevatten`
|
|
83
|
+
: 'mag geen extra eigenschappen bevatten',
|
|
84
|
+
minProperties: (p) => `mag niet minder dan ${num(p.limit)} ${plural(p.limit, 'eigenschap', 'eigenschappen')} bevatten`,
|
|
85
|
+
maxProperties: (p) => `mag niet meer dan ${num(p.limit)} ${plural(p.limit, 'eigenschap', 'eigenschappen')} bevatten`,
|
|
86
|
+
minItems: (p) => `mag niet minder dan ${num(p.limit)} ${plural(p.limit, 'item', 'items')} bevatten`,
|
|
87
|
+
maxItems: (p) => `mag niet meer dan ${num(p.limit)} ${plural(p.limit, 'item', 'items')} bevatten`,
|
|
88
|
+
uniqueItems: 'mag geen dubbele items bevatten',
|
|
89
|
+
contains: 'moet ten minste één geldig item bevatten',
|
|
90
|
+
items: 'de items van de lijst zijn ongeldig',
|
|
91
|
+
allOf: "moet aan alle subschema's voldoen",
|
|
92
|
+
anyOf: 'moet aan een subschema in anyOf voldoen',
|
|
93
|
+
oneOf: 'moet aan precies één subschema in oneOf voldoen',
|
|
94
|
+
not: 'mag NIET aan het subschema voldoen',
|
|
95
|
+
format: 'moet overeenkomen met formaat "{format}"',
|
|
96
|
+
if: 'moet aan het "if"-schema voldoen',
|
|
97
|
+
then: 'moet aan het "then"-schema voldoen',
|
|
98
|
+
else: 'moet aan het "else"-schema voldoen',
|
|
99
|
+
'false schema': 'booleaans schema false is altijd ongeldig',
|
|
100
|
+
$query: (p) => p.code
|
|
101
|
+
? `de '$query'-assertie gaf ${p.code} op '${p.docPath}'`
|
|
102
|
+
: "moet aan de '$query'-assertie voldoen",
|
|
103
|
+
JQ2001: (p) => `de '$query'-assertie kon niet worden berekend (${p.code} op '${p.docPath}')`,
|
|
104
|
+
JQ2003: (p) => `de '$query'-assertie gaf meerdere resultaten (${p.code} op '${p.docPath}')`,
|
|
105
|
+
//#endregion
|
|
106
|
+
|
|
107
|
+
//#region @jarenjs/forms (second-person field voice)
|
|
108
|
+
'form/required': 'Dit veld is verplicht',
|
|
109
|
+
'form/type': (p) => `Moet een ${typeName(p.type)} zijn`,
|
|
110
|
+
'form/const': (p) => `Moet ${formatMessageValue(p.constValue)} zijn`,
|
|
111
|
+
'form/enum': (p) => `Moet ${Array.isArray(p.enumValues) ? listFormat.format(p.enumValues.map(formatMessageValue)) : formatMessageValue(p.enumValues)} zijn`,
|
|
112
|
+
'form/minLength': (p) => `Moet ten minste ${num(p.limit)} ${plural(p.limit, 'teken', 'tekens')} bevatten (nu ${num(p.len)})`,
|
|
113
|
+
'form/maxLength': (p) => `Mag ten hoogste ${num(p.limit)} ${plural(p.limit, 'teken', 'tekens')} bevatten (nu ${num(p.len)})`,
|
|
114
|
+
'form/pattern': 'Moet overeenkomen met patroon {pattern}',
|
|
115
|
+
'form/format': (p) => `Moet een geldige ${p.format} zijn`,
|
|
116
|
+
'form/minimum': (p) => `Moet ten minste ${num(p.limit)} zijn`,
|
|
117
|
+
'form/maximum': (p) => `Mag ten hoogste ${num(p.limit)} zijn`,
|
|
118
|
+
'form/exclusiveMinimum': (p) => `Moet groter zijn dan ${num(p.limit)}`,
|
|
119
|
+
'form/exclusiveMaximum': (p) => `Moet kleiner zijn dan ${num(p.limit)}`,
|
|
120
|
+
'form/multipleOf': (p) => `Moet een veelvoud van ${num(p.multipleOf)} zijn`,
|
|
121
|
+
'form/minItems': (p) => `Moet ten minste ${num(p.limit)} ${plural(p.limit, 'item', 'items')} bevatten`,
|
|
122
|
+
'form/maxItems': (p) => `Mag ten hoogste ${num(p.limit)} ${plural(p.limit, 'item', 'items')} bevatten`,
|
|
123
|
+
'form/uniqueItems': 'Items moeten uniek zijn',
|
|
124
|
+
'form/minProperties': (p) => `Moet ten minste ${num(p.limit)} ${plural(p.limit, 'eigenschap', 'eigenschappen')} bevatten`,
|
|
125
|
+
'form/maxProperties': (p) => `Mag ten hoogste ${num(p.limit)} ${plural(p.limit, 'eigenschap', 'eigenschappen')} bevatten`,
|
|
126
|
+
'x-form/assert': 'Ongeldige waarde',
|
|
127
|
+
'form/addItem': 'Item toevoegen',
|
|
128
|
+
'form/removeItem': 'Item verwijderen',
|
|
129
|
+
//#endregion
|
|
130
|
+
};
|
package/src/pt.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
//@ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Portuguese (pt) message catalog for @jarenjs/validate and @jarenjs/forms.
|
|
5
|
+
*
|
|
6
|
+
* A catalog is a plain flat object `{ [key]: closure | template string }`;
|
|
7
|
+
* compile it with `compileMessageCatalog` from either consumer package
|
|
8
|
+
* and hand it to `localizeErrors` (validate) or the `catalog` parameters
|
|
9
|
+
* of `validateField` / `evaluateFormRules` (forms). A pack imports only
|
|
10
|
+
* the shared rendering helpers; key parity with the built-in English
|
|
11
|
+
* catalogs is enforced by tests in the repo, not by imports.
|
|
12
|
+
*
|
|
13
|
+
* Globalization mechanics (the pack-authoring pattern - see
|
|
14
|
+
* packages/validate/docs/ERROR-MESSAGES.md):
|
|
15
|
+
* - `Intl.PluralRules` picks plural categories, and "item" pluralizes
|
|
16
|
+
* irregularly ("1 item" / "2 itens"),
|
|
17
|
+
* - `Intl.NumberFormat` renders numeric limits the Portuguese way,
|
|
18
|
+
* - `Intl.ListFormat` renders enum alternatives ("a, b ou c"),
|
|
19
|
+
* all held as module-level singletons (allocation discipline).
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import {
|
|
23
|
+
formatMessageValue,
|
|
24
|
+
makeNumberRenderer,
|
|
25
|
+
makePluralPicker,
|
|
26
|
+
makeTypeNamer,
|
|
27
|
+
} from './helpers.js';
|
|
28
|
+
|
|
29
|
+
//#region Intl singletons
|
|
30
|
+
|
|
31
|
+
const pluralRules = new Intl.PluralRules('pt');
|
|
32
|
+
const numberFormat = new Intl.NumberFormat('pt');
|
|
33
|
+
const listFormat = new Intl.ListFormat('pt', { style: 'long', type: 'disjunction' });
|
|
34
|
+
|
|
35
|
+
/** Pick the Portuguese singular or plural noun form for a count. */
|
|
36
|
+
const plural = makePluralPicker(pluralRules);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Render a numeric limit through the Portuguese number format;
|
|
40
|
+
* non-numbers (e.g. an unresolved $data pointer) render as-is.
|
|
41
|
+
*/
|
|
42
|
+
const num = makeNumberRenderer(numberFormat);
|
|
43
|
+
|
|
44
|
+
/** Portuguese names (with article) for the JSON Schema type keyword values. */
|
|
45
|
+
const TYPE_NAMES = {
|
|
46
|
+
string: 'um texto (string)',
|
|
47
|
+
number: 'um número',
|
|
48
|
+
integer: 'um número inteiro',
|
|
49
|
+
boolean: 'um booleano',
|
|
50
|
+
array: 'uma lista (array)',
|
|
51
|
+
object: 'um objeto',
|
|
52
|
+
null: 'null',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** Type keyword values under their Portuguese display name, article included. */
|
|
56
|
+
const typeName = makeTypeNamer(TYPE_NAMES);
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The Portuguese catalog. Covers every key of validate's `messagesEn`,
|
|
62
|
+
* every `form/*` key of forms' `formsMessagesEn`, `x-form/assert`, and
|
|
63
|
+
* the `JQ2xxx` codes reachable through `$query`.
|
|
64
|
+
* @type {Record<string, string | ((params: any, error?: object) => string)>}
|
|
65
|
+
*/
|
|
66
|
+
export const pt = {
|
|
67
|
+
//#region @jarenjs/validate (document voice)
|
|
68
|
+
type: (p) => p.types
|
|
69
|
+
? `deve ser um dos seguintes tipos: ${p.types.join(', ')}`
|
|
70
|
+
: `deve ser ${typeName(p.type)}`,
|
|
71
|
+
required: (p) => p.missingProperty
|
|
72
|
+
? `deve ter a propriedade obrigatória '${p.missingProperty}'`
|
|
73
|
+
: 'deve ter as propriedades obrigatórias',
|
|
74
|
+
minimum: (p) => `deve ser ${p.comparison} ${num(p.limit)}`,
|
|
75
|
+
maximum: (p) => `deve ser ${p.comparison} ${num(p.limit)}`,
|
|
76
|
+
exclusiveMinimum: (p) => `deve ser ${p.comparison} ${num(p.limit)}`,
|
|
77
|
+
exclusiveMaximum: (p) => `deve ser ${p.comparison} ${num(p.limit)}`,
|
|
78
|
+
multipleOf: (p) => `deve ser um múltiplo de ${num(p.multipleOf)}`,
|
|
79
|
+
minLength: (p) => `não deve ter menos de ${num(p.limit)} ${plural(p.limit, 'caractere', 'caracteres')}`,
|
|
80
|
+
maxLength: (p) => `não deve ter mais de ${num(p.limit)} ${plural(p.limit, 'caractere', 'caracteres')}`,
|
|
81
|
+
pattern: 'deve corresponder ao padrão "{pattern}"',
|
|
82
|
+
additionalProperties: (p) => p.additionalProperty
|
|
83
|
+
? `não deve ter a propriedade adicional '${p.additionalProperty}'`
|
|
84
|
+
: 'não deve ter propriedades adicionais',
|
|
85
|
+
minProperties: (p) => `não deve ter menos de ${num(p.limit)} ${plural(p.limit, 'propriedade', 'propriedades')}`,
|
|
86
|
+
maxProperties: (p) => `não deve ter mais de ${num(p.limit)} ${plural(p.limit, 'propriedade', 'propriedades')}`,
|
|
87
|
+
minItems: (p) => `não deve ter menos de ${num(p.limit)} ${plural(p.limit, 'item', 'itens')}`,
|
|
88
|
+
maxItems: (p) => `não deve ter mais de ${num(p.limit)} ${plural(p.limit, 'item', 'itens')}`,
|
|
89
|
+
uniqueItems: 'não deve ter itens duplicados',
|
|
90
|
+
contains: 'deve conter pelo menos um item válido',
|
|
91
|
+
items: 'os itens da lista são inválidos',
|
|
92
|
+
allOf: 'deve corresponder a todos os subesquemas',
|
|
93
|
+
anyOf: 'deve corresponder a um subesquema de anyOf',
|
|
94
|
+
oneOf: 'deve corresponder a exatamente um subesquema de oneOf',
|
|
95
|
+
not: 'NÃO deve corresponder ao subesquema',
|
|
96
|
+
format: 'deve corresponder ao formato "{format}"',
|
|
97
|
+
if: 'deve corresponder ao esquema "if"',
|
|
98
|
+
then: 'deve corresponder ao esquema "then"',
|
|
99
|
+
else: 'deve corresponder ao esquema "else"',
|
|
100
|
+
'false schema': 'o esquema booleano false é sempre inválido',
|
|
101
|
+
$query: (p) => p.code
|
|
102
|
+
? `a asserção '$query' gerou ${p.code} em '${p.docPath}'`
|
|
103
|
+
: "deve satisfazer a asserção '$query'",
|
|
104
|
+
JQ2001: (p) => `a asserção '$query' não pôde ser avaliada (${p.code} em '${p.docPath}')`,
|
|
105
|
+
JQ2003: (p) => `a asserção '$query' gerou vários resultados (${p.code} em '${p.docPath}')`,
|
|
106
|
+
//#endregion
|
|
107
|
+
|
|
108
|
+
//#region @jarenjs/forms (second-person field voice)
|
|
109
|
+
'form/required': 'Este campo é obrigatório',
|
|
110
|
+
'form/type': (p) => `Deve ser ${typeName(p.type)}`,
|
|
111
|
+
'form/const': (p) => `Deve ser ${formatMessageValue(p.constValue)}`,
|
|
112
|
+
'form/enum': (p) => `Deve ser ${Array.isArray(p.enumValues) ? listFormat.format(p.enumValues.map(formatMessageValue)) : formatMessageValue(p.enumValues)}`,
|
|
113
|
+
'form/minLength': (p) => `Deve ter pelo menos ${num(p.limit)} ${plural(p.limit, 'caractere', 'caracteres')} (atualmente ${num(p.len)})`,
|
|
114
|
+
'form/maxLength': (p) => `Deve ter no máximo ${num(p.limit)} ${plural(p.limit, 'caractere', 'caracteres')} (atualmente ${num(p.len)})`,
|
|
115
|
+
'form/pattern': 'Deve corresponder ao padrão {pattern}',
|
|
116
|
+
'form/format': (p) => `Deve respeitar o formato ${p.format}`,
|
|
117
|
+
'form/minimum': (p) => `Deve ser pelo menos ${num(p.limit)}`,
|
|
118
|
+
'form/maximum': (p) => `Deve ser no máximo ${num(p.limit)}`,
|
|
119
|
+
'form/exclusiveMinimum': (p) => `Deve ser maior que ${num(p.limit)}`,
|
|
120
|
+
'form/exclusiveMaximum': (p) => `Deve ser menor que ${num(p.limit)}`,
|
|
121
|
+
'form/multipleOf': (p) => `Deve ser um múltiplo de ${num(p.multipleOf)}`,
|
|
122
|
+
'form/minItems': (p) => `Deve ter pelo menos ${num(p.limit)} ${plural(p.limit, 'item', 'itens')}`,
|
|
123
|
+
'form/maxItems': (p) => `Deve ter no máximo ${num(p.limit)} ${plural(p.limit, 'item', 'itens')}`,
|
|
124
|
+
'form/uniqueItems': 'Os itens devem ser únicos',
|
|
125
|
+
'form/minProperties': (p) => `Deve ter pelo menos ${num(p.limit)} ${plural(p.limit, 'propriedade', 'propriedades')}`,
|
|
126
|
+
'form/maxProperties': (p) => `Deve ter no máximo ${num(p.limit)} ${plural(p.limit, 'propriedade', 'propriedades')}`,
|
|
127
|
+
'x-form/assert': 'Valor inválido',
|
|
128
|
+
'form/addItem': 'Adicionar item',
|
|
129
|
+
'form/removeItem': 'Remover item',
|
|
130
|
+
//#endregion
|
|
131
|
+
};
|
package/src/ru.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
//@ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Russian (ru) message catalog for @jarenjs/validate and @jarenjs/forms.
|
|
5
|
+
*
|
|
6
|
+
* A catalog is a plain flat object `{ [key]: closure | template string }`;
|
|
7
|
+
* compile it with `compileMessageCatalog` from either consumer package
|
|
8
|
+
* and hand it to `localizeErrors` (validate) or the `catalog` parameters
|
|
9
|
+
* of `validateField` / `evaluateFormRules` (forms). A pack imports only
|
|
10
|
+
* the shared rendering helpers; key parity with the built-in English
|
|
11
|
+
* catalogs is enforced by tests in the repo, not by imports.
|
|
12
|
+
*
|
|
13
|
+
* Globalization mechanics (the pack-authoring pattern - see
|
|
14
|
+
* packages/validate/docs/ERROR-MESSAGES.md):
|
|
15
|
+
* - `Intl.PluralRules` picks plural categories. Russian counts split
|
|
16
|
+
* one/few/many, but every counted noun here follows "менее/более"
|
|
17
|
+
* and therefore reads in the genitive - where only the 'one'
|
|
18
|
+
* category differs ("21 символа" / "22 символов"), so a two-form
|
|
19
|
+
* helper suffices,
|
|
20
|
+
* - `Intl.NumberFormat` renders numeric limits the Russian way,
|
|
21
|
+
* - `Intl.ListFormat` renders enum alternatives ("a, b или c"),
|
|
22
|
+
* all held as module-level singletons (allocation discipline).
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
formatMessageValue,
|
|
27
|
+
makeNumberRenderer,
|
|
28
|
+
makePluralPicker,
|
|
29
|
+
makeTypeNamer,
|
|
30
|
+
} from './helpers.js';
|
|
31
|
+
|
|
32
|
+
//#region Intl singletons
|
|
33
|
+
|
|
34
|
+
const pluralRules = new Intl.PluralRules('ru');
|
|
35
|
+
const numberFormat = new Intl.NumberFormat('ru-RU');
|
|
36
|
+
const listFormat = new Intl.ListFormat('ru', { style: 'long', type: 'disjunction' });
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Pick the genitive singular ('символа') or genitive plural
|
|
40
|
+
* ('символов') noun form for a count - the shape every "менее/более
|
|
41
|
+
* N ..." message needs.
|
|
42
|
+
*/
|
|
43
|
+
const plural = makePluralPicker(pluralRules);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Render a numeric limit through the Russian number format; non-numbers
|
|
47
|
+
* (e.g. an unresolved $data pointer) render as-is.
|
|
48
|
+
*/
|
|
49
|
+
const num = makeNumberRenderer(numberFormat);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Russian names for the JSON Schema type keyword values, in the
|
|
53
|
+
* instrumental case ("должно быть строкой").
|
|
54
|
+
*/
|
|
55
|
+
const TYPE_NAMES = {
|
|
56
|
+
string: 'строкой (string)',
|
|
57
|
+
number: 'числом',
|
|
58
|
+
integer: 'целым числом',
|
|
59
|
+
boolean: 'булевым значением',
|
|
60
|
+
array: 'списком (array)',
|
|
61
|
+
object: 'объектом',
|
|
62
|
+
null: 'null',
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** Type keyword values under their Russian display name, instrumental case. */
|
|
66
|
+
const typeName = makeTypeNamer(TYPE_NAMES);
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The Russian catalog. Covers every key of validate's `messagesEn`,
|
|
72
|
+
* every `form/*` key of forms' `formsMessagesEn`, `x-form/assert`, and
|
|
73
|
+
* the `JQ2xxx` codes reachable through `$query`.
|
|
74
|
+
* @type {Record<string, string | ((params: any, error?: object) => string)>}
|
|
75
|
+
*/
|
|
76
|
+
export const ru = {
|
|
77
|
+
//#region @jarenjs/validate (document voice)
|
|
78
|
+
type: (p) => p.types
|
|
79
|
+
? `должно быть одним из следующих типов: ${p.types.join(', ')}`
|
|
80
|
+
: `должно быть ${typeName(p.type)}`,
|
|
81
|
+
required: (p) => p.missingProperty
|
|
82
|
+
? `должно содержать обязательное свойство '${p.missingProperty}'`
|
|
83
|
+
: 'должно содержать обязательные свойства',
|
|
84
|
+
minimum: (p) => `должно быть ${p.comparison} ${num(p.limit)}`,
|
|
85
|
+
maximum: (p) => `должно быть ${p.comparison} ${num(p.limit)}`,
|
|
86
|
+
exclusiveMinimum: (p) => `должно быть ${p.comparison} ${num(p.limit)}`,
|
|
87
|
+
exclusiveMaximum: (p) => `должно быть ${p.comparison} ${num(p.limit)}`,
|
|
88
|
+
multipleOf: (p) => `должно быть кратно ${num(p.multipleOf)}`,
|
|
89
|
+
minLength: (p) => `не должно содержать менее ${num(p.limit)} ${plural(p.limit, 'символа', 'символов')}`,
|
|
90
|
+
maxLength: (p) => `не должно содержать более ${num(p.limit)} ${plural(p.limit, 'символа', 'символов')}`,
|
|
91
|
+
pattern: 'должно соответствовать шаблону "{pattern}"',
|
|
92
|
+
additionalProperties: (p) => p.additionalProperty
|
|
93
|
+
? `не должно содержать дополнительное свойство '${p.additionalProperty}'`
|
|
94
|
+
: 'не должно содержать дополнительных свойств',
|
|
95
|
+
minProperties: (p) => `не должно содержать менее ${num(p.limit)} ${plural(p.limit, 'свойства', 'свойств')}`,
|
|
96
|
+
maxProperties: (p) => `не должно содержать более ${num(p.limit)} ${plural(p.limit, 'свойства', 'свойств')}`,
|
|
97
|
+
minItems: (p) => `не должно содержать менее ${num(p.limit)} ${plural(p.limit, 'элемента', 'элементов')}`,
|
|
98
|
+
maxItems: (p) => `не должно содержать более ${num(p.limit)} ${plural(p.limit, 'элемента', 'элементов')}`,
|
|
99
|
+
uniqueItems: 'не должно содержать повторяющихся элементов',
|
|
100
|
+
contains: 'должно содержать хотя бы один допустимый элемент',
|
|
101
|
+
items: 'элементы списка недопустимы',
|
|
102
|
+
allOf: 'должно соответствовать всем подсхемам',
|
|
103
|
+
anyOf: 'должно соответствовать одной из подсхем в anyOf',
|
|
104
|
+
oneOf: 'должно соответствовать ровно одной подсхеме в oneOf',
|
|
105
|
+
not: 'НЕ должно соответствовать подсхеме',
|
|
106
|
+
format: 'должно соответствовать формату "{format}"',
|
|
107
|
+
if: 'должно соответствовать схеме "if"',
|
|
108
|
+
then: 'должно соответствовать схеме "then"',
|
|
109
|
+
else: 'должно соответствовать схеме "else"',
|
|
110
|
+
'false schema': 'булева схема false всегда недопустима',
|
|
111
|
+
$query: (p) => p.code
|
|
112
|
+
? `утверждение '$query' вызвало ${p.code} в '${p.docPath}'`
|
|
113
|
+
: "должно удовлетворять утверждению '$query'",
|
|
114
|
+
JQ2001: (p) => `утверждение '$query' не удалось вычислить (${p.code} в '${p.docPath}')`,
|
|
115
|
+
JQ2003: (p) => `утверждение '$query' вернуло несколько результатов (${p.code} в '${p.docPath}')`,
|
|
116
|
+
//#endregion
|
|
117
|
+
|
|
118
|
+
//#region @jarenjs/forms (second-person field voice)
|
|
119
|
+
'form/required': 'Это поле обязательно',
|
|
120
|
+
'form/type': (p) => `Должно быть ${typeName(p.type)}`,
|
|
121
|
+
'form/const': (p) => `Должно быть ${formatMessageValue(p.constValue)}`,
|
|
122
|
+
'form/enum': (p) => `Должно быть ${Array.isArray(p.enumValues) ? listFormat.format(p.enumValues.map(formatMessageValue)) : formatMessageValue(p.enumValues)}`,
|
|
123
|
+
'form/minLength': (p) => `Должно содержать не менее ${num(p.limit)} ${plural(p.limit, 'символа', 'символов')} (сейчас ${num(p.len)})`,
|
|
124
|
+
'form/maxLength': (p) => `Должно содержать не более ${num(p.limit)} ${plural(p.limit, 'символа', 'символов')} (сейчас ${num(p.len)})`,
|
|
125
|
+
'form/pattern': 'Должно соответствовать шаблону {pattern}',
|
|
126
|
+
'form/format': (p) => `Должно соответствовать формату ${p.format}`,
|
|
127
|
+
'form/minimum': (p) => `Должно быть не менее ${num(p.limit)}`,
|
|
128
|
+
'form/maximum': (p) => `Должно быть не более ${num(p.limit)}`,
|
|
129
|
+
'form/exclusiveMinimum': (p) => `Должно быть больше ${num(p.limit)}`,
|
|
130
|
+
'form/exclusiveMaximum': (p) => `Должно быть меньше ${num(p.limit)}`,
|
|
131
|
+
'form/multipleOf': (p) => `Должно быть кратно ${num(p.multipleOf)}`,
|
|
132
|
+
'form/minItems': (p) => `Должно содержать не менее ${num(p.limit)} ${plural(p.limit, 'элемента', 'элементов')}`,
|
|
133
|
+
'form/maxItems': (p) => `Должно содержать не более ${num(p.limit)} ${plural(p.limit, 'элемента', 'элементов')}`,
|
|
134
|
+
'form/uniqueItems': 'Элементы должны быть уникальными',
|
|
135
|
+
'form/minProperties': (p) => `Должно содержать не менее ${num(p.limit)} ${plural(p.limit, 'свойства', 'свойств')}`,
|
|
136
|
+
'form/maxProperties': (p) => `Должно содержать не более ${num(p.limit)} ${plural(p.limit, 'свойства', 'свойств')}`,
|
|
137
|
+
'x-form/assert': 'Недопустимое значение',
|
|
138
|
+
'form/addItem': 'Добавить элемент',
|
|
139
|
+
'form/removeItem': 'Удалить элемент',
|
|
140
|
+
//#endregion
|
|
141
|
+
};
|
package/src/tr.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
//@ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Turkish (tr) message catalog for @jarenjs/validate and @jarenjs/forms.
|
|
5
|
+
*
|
|
6
|
+
* A catalog is a plain flat object `{ [key]: closure | template string }`;
|
|
7
|
+
* compile it with `compileMessageCatalog` from either consumer package
|
|
8
|
+
* and hand it to `localizeErrors` (validate) or the `catalog` parameters
|
|
9
|
+
* of `validateField` / `evaluateFormRules` (forms). A pack imports only
|
|
10
|
+
* the shared rendering helpers; key parity with the built-in English
|
|
11
|
+
* catalogs is enforced by tests in the repo, not by imports.
|
|
12
|
+
*
|
|
13
|
+
* Globalization mechanics (the pack-authoring pattern - see
|
|
14
|
+
* packages/validate/docs/ERROR-MESSAGES.md):
|
|
15
|
+
* - Turkish nouns stay singular after a numeral ("2 karakter"), so
|
|
16
|
+
* there is no plural helper. Case suffixes obey vowel harmony, so
|
|
17
|
+
* every message attaches suffixes to FIXED nouns ("'name'
|
|
18
|
+
* özelliğini", "5 sayısının katı"), never to interpolated text,
|
|
19
|
+
* - `Intl.NumberFormat` renders numeric limits the Turkish way,
|
|
20
|
+
* - `Intl.ListFormat` renders enum alternatives ("a, b veya c"),
|
|
21
|
+
* all held as module-level singletons (allocation discipline).
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
formatMessageValue,
|
|
26
|
+
makeNumberRenderer,
|
|
27
|
+
makeTypeNamer,
|
|
28
|
+
} from './helpers.js';
|
|
29
|
+
|
|
30
|
+
//#region Intl singletons
|
|
31
|
+
|
|
32
|
+
const numberFormat = new Intl.NumberFormat('tr-TR');
|
|
33
|
+
const listFormat = new Intl.ListFormat('tr', { style: 'long', type: 'disjunction' });
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Render a numeric limit through the Turkish number format; non-numbers
|
|
37
|
+
* (e.g. an unresolved $data pointer) render as-is.
|
|
38
|
+
*/
|
|
39
|
+
const num = makeNumberRenderer(numberFormat);
|
|
40
|
+
|
|
41
|
+
/** Turkish names for the JSON Schema type keyword values. */
|
|
42
|
+
const TYPE_NAMES = {
|
|
43
|
+
string: 'metin (string)',
|
|
44
|
+
number: 'sayı',
|
|
45
|
+
integer: 'tam sayı',
|
|
46
|
+
boolean: 'boole değeri',
|
|
47
|
+
array: 'liste (array)',
|
|
48
|
+
object: 'nesne',
|
|
49
|
+
null: 'null',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Type keyword values under their Turkish display name. */
|
|
53
|
+
const typeName = makeTypeNamer(TYPE_NAMES);
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The Turkish catalog. Covers every key of validate's `messagesEn`,
|
|
59
|
+
* every `form/*` key of forms' `formsMessagesEn`, `x-form/assert`, and
|
|
60
|
+
* the `JQ2xxx` codes reachable through `$query`.
|
|
61
|
+
* @type {Record<string, string | ((params: any, error?: object) => string)>}
|
|
62
|
+
*/
|
|
63
|
+
export const tr = {
|
|
64
|
+
//#region @jarenjs/validate (document voice)
|
|
65
|
+
type: (p) => p.types
|
|
66
|
+
? `şu türlerden biri olmalıdır: ${p.types.join(', ')}`
|
|
67
|
+
: `${typeName(p.type)} olmalıdır`,
|
|
68
|
+
required: (p) => p.missingProperty
|
|
69
|
+
? `zorunlu '${p.missingProperty}' özelliğini içermelidir`
|
|
70
|
+
: 'zorunlu özellikleri içermelidir',
|
|
71
|
+
minimum: (p) => `${p.comparison} ${num(p.limit)} olmalıdır`,
|
|
72
|
+
maximum: (p) => `${p.comparison} ${num(p.limit)} olmalıdır`,
|
|
73
|
+
exclusiveMinimum: (p) => `${p.comparison} ${num(p.limit)} olmalıdır`,
|
|
74
|
+
exclusiveMaximum: (p) => `${p.comparison} ${num(p.limit)} olmalıdır`,
|
|
75
|
+
multipleOf: (p) => `${num(p.multipleOf)} sayısının katı olmalıdır`,
|
|
76
|
+
minLength: (p) => `en az ${num(p.limit)} karakter içermelidir`,
|
|
77
|
+
maxLength: (p) => `en fazla ${num(p.limit)} karakter içermelidir`,
|
|
78
|
+
pattern: '"{pattern}" desenine uymalıdır',
|
|
79
|
+
additionalProperties: (p) => p.additionalProperty
|
|
80
|
+
? `ek '${p.additionalProperty}' özelliğini içermemelidir`
|
|
81
|
+
: 'ek özellikler içermemelidir',
|
|
82
|
+
minProperties: (p) => `en az ${num(p.limit)} özellik içermelidir`,
|
|
83
|
+
maxProperties: (p) => `en fazla ${num(p.limit)} özellik içermelidir`,
|
|
84
|
+
minItems: (p) => `en az ${num(p.limit)} öğe içermelidir`,
|
|
85
|
+
maxItems: (p) => `en fazla ${num(p.limit)} öğe içermelidir`,
|
|
86
|
+
uniqueItems: 'yinelenen öğeler içermemelidir',
|
|
87
|
+
contains: 'en az bir geçerli öğe içermelidir',
|
|
88
|
+
items: 'listedeki öğeler geçersiz',
|
|
89
|
+
allOf: 'tüm alt şemalarla eşleşmelidir',
|
|
90
|
+
anyOf: "anyOf içindeki bir alt şemayla eşleşmelidir",
|
|
91
|
+
oneOf: "oneOf içindeki tam olarak bir alt şemayla eşleşmelidir",
|
|
92
|
+
not: 'alt şemayla eşleşmemelidir',
|
|
93
|
+
format: '"{format}" biçimine uymalıdır',
|
|
94
|
+
if: '"if" şemasıyla eşleşmelidir',
|
|
95
|
+
then: '"then" şemasıyla eşleşmelidir',
|
|
96
|
+
else: '"else" şemasıyla eşleşmelidir',
|
|
97
|
+
'false schema': 'false boole şeması her zaman geçersizdir',
|
|
98
|
+
$query: (p) => p.code
|
|
99
|
+
? `'$query' doğrulaması '${p.docPath}' konumunda ${p.code} hatası verdi`
|
|
100
|
+
: "'$query' doğrulamasını karşılamalıdır",
|
|
101
|
+
JQ2001: (p) => `'$query' doğrulaması değerlendirilemedi ('${p.docPath}' konumunda ${p.code})`,
|
|
102
|
+
JQ2003: (p) => `'$query' doğrulaması birden çok sonuç döndürdü ('${p.docPath}' konumunda ${p.code})`,
|
|
103
|
+
//#endregion
|
|
104
|
+
|
|
105
|
+
//#region @jarenjs/forms (second-person field voice)
|
|
106
|
+
'form/required': 'Bu alan zorunludur',
|
|
107
|
+
'form/type': (p) => `${typeName(p.type)} olmalıdır`,
|
|
108
|
+
'form/const': (p) => `${formatMessageValue(p.constValue)} olmalıdır`,
|
|
109
|
+
'form/enum': (p) => `${Array.isArray(p.enumValues) ? listFormat.format(p.enumValues.map(formatMessageValue)) : formatMessageValue(p.enumValues)} değerlerinden biri olmalıdır`,
|
|
110
|
+
'form/minLength': (p) => `En az ${num(p.limit)} karakter içermelidir (şu an ${num(p.len)})`,
|
|
111
|
+
'form/maxLength': (p) => `En fazla ${num(p.limit)} karakter içermelidir (şu an ${num(p.len)})`,
|
|
112
|
+
'form/pattern': '{pattern} desenine uymalıdır',
|
|
113
|
+
'form/format': (p) => `Geçerli bir ${p.format} değeri olmalıdır`,
|
|
114
|
+
'form/minimum': (p) => `En az ${num(p.limit)} olmalıdır`,
|
|
115
|
+
'form/maximum': (p) => `En fazla ${num(p.limit)} olmalıdır`,
|
|
116
|
+
'form/exclusiveMinimum': (p) => `${num(p.limit)} değerinden büyük olmalıdır`,
|
|
117
|
+
'form/exclusiveMaximum': (p) => `${num(p.limit)} değerinden küçük olmalıdır`,
|
|
118
|
+
'form/multipleOf': (p) => `${num(p.multipleOf)} sayısının katı olmalıdır`,
|
|
119
|
+
'form/minItems': (p) => `En az ${num(p.limit)} öğe içermelidir`,
|
|
120
|
+
'form/maxItems': (p) => `En fazla ${num(p.limit)} öğe içermelidir`,
|
|
121
|
+
'form/uniqueItems': 'Öğeler benzersiz olmalıdır',
|
|
122
|
+
'form/minProperties': (p) => `En az ${num(p.limit)} özellik içermelidir`,
|
|
123
|
+
'form/maxProperties': (p) => `En fazla ${num(p.limit)} özellik içermelidir`,
|
|
124
|
+
'x-form/assert': 'Geçersiz değer',
|
|
125
|
+
'form/addItem': 'Öğe ekle',
|
|
126
|
+
'form/removeItem': 'Öğeyi kaldır',
|
|
127
|
+
//#endregion
|
|
128
|
+
};
|