@lokalise/polyglot-sdk 21.0.2 → 22.1.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/dist/index.d.ts +11 -10
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/sdk/PolyglotClient.js.map +1 -1
- package/dist/sdk/schemas/common/asyncRequestSchemas.d.ts +4 -14
- package/dist/sdk/schemas/common/asyncRequestSchemas.js +1 -2
- package/dist/sdk/schemas/common/asyncRequestSchemas.js.map +1 -1
- package/dist/sdk/schemas/common/commonSchemas.d.ts +19 -68
- package/dist/sdk/schemas/common/commonSchemas.js +6 -9
- package/dist/sdk/schemas/common/commonSchemas.js.map +1 -1
- package/dist/sdk/schemas/common/errorSchemas.d.ts +6 -51
- package/dist/sdk/schemas/common/errorSchemas.js +1 -1
- package/dist/sdk/schemas/common/errorSchemas.js.map +1 -1
- package/dist/sdk/schemas/common/pluralFormSchemas.d.ts +28 -0
- package/dist/sdk/schemas/common/pluralFormSchemas.js +48 -0
- package/dist/sdk/schemas/common/pluralFormSchemas.js.map +1 -0
- package/dist/sdk/schemas/common/translationContextSchemas.d.ts +142 -438
- package/dist/sdk/schemas/common/translationContextSchemas.js +4 -3
- package/dist/sdk/schemas/common/translationContextSchemas.js.map +1 -1
- package/dist/sdk/schemas/lqa/commonSchemas.d.ts +62 -264
- package/dist/sdk/schemas/lqa/commonSchemas.js +12 -3
- package/dist/sdk/schemas/lqa/commonSchemas.js.map +1 -1
- package/dist/sdk/schemas/lqa/lqaAsyncSchemas.d.ts +133 -817
- package/dist/sdk/schemas/lqa/lqaAsyncSchemas.js +7 -4
- package/dist/sdk/schemas/lqa/lqaAsyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/lqa/lqaSyncSchemas.d.ts +106 -685
- package/dist/sdk/schemas/lqa/lqaSyncSchemas.js +5 -2
- package/dist/sdk/schemas/lqa/lqaSyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/generateVariants.d.ts +67 -524
- package/dist/sdk/schemas/translation/generateVariants.js +16 -6
- package/dist/sdk/schemas/translation/generateVariants.js.map +1 -1
- package/dist/sdk/schemas/translation/rewriteTextSchemas.d.ts +245 -1512
- package/dist/sdk/schemas/translation/rewriteTextSchemas.js +22 -4
- package/dist/sdk/schemas/translation/rewriteTextSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/sharedSchemas.d.ts +114 -451
- package/dist/sdk/schemas/translation/sharedSchemas.js +27 -25
- package/dist/sdk/schemas/translation/sharedSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/translateAsyncSchemas.d.ts +179 -2123
- package/dist/sdk/schemas/translation/translateAsyncSchemas.js +18 -6
- package/dist/sdk/schemas/translation/translateAsyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/translateSyncSchemas.d.ts +142 -1680
- package/dist/sdk/schemas/translation/translateSyncSchemas.js +19 -6
- package/dist/sdk/schemas/translation/translateSyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/translateTextSegmentSchemas.d.ts +87 -1079
- package/dist/sdk/schemas/translation/translateTextSegmentSchemas.js +4 -4
- package/dist/sdk/schemas/translation/translateTextSegmentSchemas.js.map +1 -1
- package/package.json +9 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translationContextSchemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/common/translationContextSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"translationContextSchemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/common/translationContextSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AAEtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAA;AAC1F,OAAO,EAAE,mCAAmC,EAAE,MAAM,iCAAiC,CAAA;AACrF,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAC/E,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iB,EAAE,IAAI,EAAE,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import z from 'zod';
|
|
1
|
+
import z from 'zod/v4';
|
|
2
2
|
import type { ObjectValues } from '../../types/common.ts';
|
|
3
3
|
export declare const LqaIssueSeverityEnum: {
|
|
4
4
|
readonly NEUTRAL: "neutral";
|
|
@@ -9,90 +9,37 @@ export declare const LqaIssueSeverityEnum: {
|
|
|
9
9
|
export type LqaIssueSeverityEnum = ObjectValues<typeof LqaIssueSeverityEnum>;
|
|
10
10
|
export declare const LQA_TRANSLATION_ID_SCHEMA: z.ZodString;
|
|
11
11
|
export declare const LQA_CONTENT_UNIT_ID_SCHEMA: z.ZodString;
|
|
12
|
-
export declare const LQA_SEGMENT_SCHEMA: z.
|
|
13
|
-
sourceValue: z.
|
|
12
|
+
export declare const LQA_SEGMENT_SCHEMA: z.ZodPipe<z.ZodObject<{
|
|
13
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
14
|
+
pluralForm: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
readonly ZERO: "zero";
|
|
16
|
+
readonly ONE: "one";
|
|
17
|
+
readonly TWO: "two";
|
|
18
|
+
readonly FEW: "few";
|
|
19
|
+
readonly MANY: "many";
|
|
20
|
+
readonly OTHER: "other";
|
|
21
|
+
}>>;
|
|
14
22
|
translations: z.ZodArray<z.ZodObject<{
|
|
15
23
|
id: z.ZodString;
|
|
16
|
-
locale: z.
|
|
17
|
-
value: z.
|
|
18
|
-
},
|
|
19
|
-
value: string;
|
|
20
|
-
id: string;
|
|
21
|
-
locale: string;
|
|
22
|
-
}, {
|
|
23
|
-
value: string;
|
|
24
|
-
id: string;
|
|
25
|
-
locale: string;
|
|
26
|
-
}>, "atleastone">;
|
|
24
|
+
locale: z.ZodString;
|
|
25
|
+
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
27
|
tmMatch: z.ZodOptional<z.ZodObject<{
|
|
28
|
-
sourceValue: z.
|
|
29
|
-
translatedValue: z.
|
|
30
|
-
},
|
|
31
|
-
sourceValue: string;
|
|
32
|
-
translatedValue: string;
|
|
33
|
-
}, {
|
|
34
|
-
sourceValue: string;
|
|
35
|
-
translatedValue: string;
|
|
36
|
-
}>>;
|
|
28
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
29
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
37
31
|
translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
-
sourceValue: z.
|
|
39
|
-
translatedValue: z.
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
translatedValue: string;
|
|
43
|
-
}, {
|
|
44
|
-
sourceValue: string;
|
|
45
|
-
translatedValue: string;
|
|
46
|
-
}>, "many">>;
|
|
47
|
-
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
sourceValue: string;
|
|
49
|
-
translations: [{
|
|
50
|
-
value: string;
|
|
51
|
-
id: string;
|
|
52
|
-
locale: string;
|
|
53
|
-
}, ...{
|
|
54
|
-
value: string;
|
|
55
|
-
id: string;
|
|
56
|
-
locale: string;
|
|
57
|
-
}[]];
|
|
58
|
-
tmMatch?: {
|
|
59
|
-
sourceValue: string;
|
|
60
|
-
translatedValue: string;
|
|
61
|
-
} | undefined;
|
|
62
|
-
translationExamples?: {
|
|
63
|
-
sourceValue: string;
|
|
64
|
-
translatedValue: string;
|
|
65
|
-
}[] | undefined;
|
|
66
|
-
}, {
|
|
67
|
-
sourceValue: string;
|
|
68
|
-
translations: [{
|
|
69
|
-
value: string;
|
|
70
|
-
id: string;
|
|
71
|
-
locale: string;
|
|
72
|
-
}, ...{
|
|
73
|
-
value: string;
|
|
74
|
-
id: string;
|
|
75
|
-
locale: string;
|
|
76
|
-
}[]];
|
|
77
|
-
tmMatch?: {
|
|
78
|
-
sourceValue: string;
|
|
79
|
-
translatedValue: string;
|
|
80
|
-
} | undefined;
|
|
81
|
-
translationExamples?: {
|
|
82
|
-
sourceValue: string;
|
|
83
|
-
translatedValue: string;
|
|
84
|
-
}[] | undefined;
|
|
85
|
-
}>, {
|
|
32
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
33
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
86
36
|
sourceValue: string;
|
|
87
|
-
translations:
|
|
88
|
-
value: string;
|
|
37
|
+
translations: {
|
|
89
38
|
id: string;
|
|
90
39
|
locale: string;
|
|
91
|
-
}, ...{
|
|
92
40
|
value: string;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}[]];
|
|
41
|
+
}[];
|
|
42
|
+
pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
|
|
96
43
|
tmMatch?: {
|
|
97
44
|
sourceValue: string;
|
|
98
45
|
translatedValue: string;
|
|
@@ -103,15 +50,12 @@ export declare const LQA_SEGMENT_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
103
50
|
}[] | undefined;
|
|
104
51
|
}, {
|
|
105
52
|
sourceValue: string;
|
|
106
|
-
translations:
|
|
107
|
-
value: string;
|
|
53
|
+
translations: {
|
|
108
54
|
id: string;
|
|
109
55
|
locale: string;
|
|
110
|
-
}, ...{
|
|
111
56
|
value: string;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}[]];
|
|
57
|
+
}[];
|
|
58
|
+
pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
|
|
115
59
|
tmMatch?: {
|
|
116
60
|
sourceValue: string;
|
|
117
61
|
translatedValue: string;
|
|
@@ -120,62 +64,47 @@ export declare const LQA_SEGMENT_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
120
64
|
sourceValue: string;
|
|
121
65
|
translatedValue: string;
|
|
122
66
|
}[] | undefined;
|
|
123
|
-
}
|
|
67
|
+
}>>;
|
|
124
68
|
export declare const LQA_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
125
69
|
id: z.ZodString;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
description?: string | undefined;
|
|
130
|
-
}, {
|
|
131
|
-
description?: string | undefined;
|
|
70
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
71
|
+
readonly SEGMENTED: "segmented";
|
|
72
|
+
readonly PLURAL: "plural";
|
|
132
73
|
}>>;
|
|
133
|
-
|
|
134
|
-
|
|
74
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
segments: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
78
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
79
|
+
pluralForm: z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
readonly ZERO: "zero";
|
|
81
|
+
readonly ONE: "one";
|
|
82
|
+
readonly TWO: "two";
|
|
83
|
+
readonly FEW: "few";
|
|
84
|
+
readonly MANY: "many";
|
|
85
|
+
readonly OTHER: "other";
|
|
86
|
+
}>>;
|
|
135
87
|
translations: z.ZodArray<z.ZodObject<{
|
|
136
88
|
id: z.ZodString;
|
|
137
|
-
locale: z.
|
|
138
|
-
value: z.
|
|
139
|
-
},
|
|
140
|
-
value: string;
|
|
141
|
-
id: string;
|
|
142
|
-
locale: string;
|
|
143
|
-
}, {
|
|
144
|
-
value: string;
|
|
145
|
-
id: string;
|
|
146
|
-
locale: string;
|
|
147
|
-
}>, "atleastone">;
|
|
89
|
+
locale: z.ZodString;
|
|
90
|
+
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
148
92
|
tmMatch: z.ZodOptional<z.ZodObject<{
|
|
149
|
-
sourceValue: z.
|
|
150
|
-
translatedValue: z.
|
|
151
|
-
},
|
|
152
|
-
sourceValue: string;
|
|
153
|
-
translatedValue: string;
|
|
154
|
-
}, {
|
|
155
|
-
sourceValue: string;
|
|
156
|
-
translatedValue: string;
|
|
157
|
-
}>>;
|
|
93
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
94
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
158
96
|
translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
159
|
-
sourceValue: z.
|
|
160
|
-
translatedValue: z.
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
translatedValue: string;
|
|
164
|
-
}, {
|
|
165
|
-
sourceValue: string;
|
|
166
|
-
translatedValue: string;
|
|
167
|
-
}>, "many">>;
|
|
168
|
-
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
98
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
99
|
+
}, z.core.$strip>>>;
|
|
100
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
169
101
|
sourceValue: string;
|
|
170
|
-
translations:
|
|
171
|
-
value: string;
|
|
102
|
+
translations: {
|
|
172
103
|
id: string;
|
|
173
104
|
locale: string;
|
|
174
|
-
}, ...{
|
|
175
105
|
value: string;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}[]];
|
|
106
|
+
}[];
|
|
107
|
+
pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
|
|
179
108
|
tmMatch?: {
|
|
180
109
|
sourceValue: string;
|
|
181
110
|
translatedValue: string;
|
|
@@ -186,15 +115,12 @@ export declare const LQA_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
|
186
115
|
}[] | undefined;
|
|
187
116
|
}, {
|
|
188
117
|
sourceValue: string;
|
|
189
|
-
translations:
|
|
190
|
-
value: string;
|
|
118
|
+
translations: {
|
|
191
119
|
id: string;
|
|
192
120
|
locale: string;
|
|
193
|
-
}, ...{
|
|
194
121
|
value: string;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}[]];
|
|
122
|
+
}[];
|
|
123
|
+
pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
|
|
198
124
|
tmMatch?: {
|
|
199
125
|
sourceValue: string;
|
|
200
126
|
translatedValue: string;
|
|
@@ -203,136 +129,8 @@ export declare const LQA_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
|
203
129
|
sourceValue: string;
|
|
204
130
|
translatedValue: string;
|
|
205
131
|
}[] | undefined;
|
|
206
|
-
}
|
|
207
|
-
sourceValue: string;
|
|
208
|
-
translations: [{
|
|
209
|
-
value: string;
|
|
210
|
-
id: string;
|
|
211
|
-
locale: string;
|
|
212
|
-
}, ...{
|
|
213
|
-
value: string;
|
|
214
|
-
id: string;
|
|
215
|
-
locale: string;
|
|
216
|
-
}[]];
|
|
217
|
-
tmMatch?: {
|
|
218
|
-
sourceValue: string;
|
|
219
|
-
translatedValue: string;
|
|
220
|
-
} | undefined;
|
|
221
|
-
translationExamples?: {
|
|
222
|
-
sourceValue: string;
|
|
223
|
-
translatedValue: string;
|
|
224
|
-
}[] | undefined;
|
|
225
|
-
}, {
|
|
226
|
-
sourceValue: string;
|
|
227
|
-
translations: [{
|
|
228
|
-
value: string;
|
|
229
|
-
id: string;
|
|
230
|
-
locale: string;
|
|
231
|
-
}, ...{
|
|
232
|
-
value: string;
|
|
233
|
-
id: string;
|
|
234
|
-
locale: string;
|
|
235
|
-
}[]];
|
|
236
|
-
tmMatch?: {
|
|
237
|
-
sourceValue: string;
|
|
238
|
-
translatedValue: string;
|
|
239
|
-
} | undefined;
|
|
240
|
-
translationExamples?: {
|
|
241
|
-
sourceValue: string;
|
|
242
|
-
translatedValue: string;
|
|
243
|
-
}[] | undefined;
|
|
244
|
-
}>, "atleastone">;
|
|
132
|
+
}>>>;
|
|
245
133
|
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
246
|
-
},
|
|
247
|
-
segments: [{
|
|
248
|
-
sourceValue: string;
|
|
249
|
-
translations: [{
|
|
250
|
-
value: string;
|
|
251
|
-
id: string;
|
|
252
|
-
locale: string;
|
|
253
|
-
}, ...{
|
|
254
|
-
value: string;
|
|
255
|
-
id: string;
|
|
256
|
-
locale: string;
|
|
257
|
-
}[]];
|
|
258
|
-
tmMatch?: {
|
|
259
|
-
sourceValue: string;
|
|
260
|
-
translatedValue: string;
|
|
261
|
-
} | undefined;
|
|
262
|
-
translationExamples?: {
|
|
263
|
-
sourceValue: string;
|
|
264
|
-
translatedValue: string;
|
|
265
|
-
}[] | undefined;
|
|
266
|
-
}, ...{
|
|
267
|
-
sourceValue: string;
|
|
268
|
-
translations: [{
|
|
269
|
-
value: string;
|
|
270
|
-
id: string;
|
|
271
|
-
locale: string;
|
|
272
|
-
}, ...{
|
|
273
|
-
value: string;
|
|
274
|
-
id: string;
|
|
275
|
-
locale: string;
|
|
276
|
-
}[]];
|
|
277
|
-
tmMatch?: {
|
|
278
|
-
sourceValue: string;
|
|
279
|
-
translatedValue: string;
|
|
280
|
-
} | undefined;
|
|
281
|
-
translationExamples?: {
|
|
282
|
-
sourceValue: string;
|
|
283
|
-
translatedValue: string;
|
|
284
|
-
}[] | undefined;
|
|
285
|
-
}[]];
|
|
286
|
-
id: string;
|
|
287
|
-
context?: {
|
|
288
|
-
description?: string | undefined;
|
|
289
|
-
} | undefined;
|
|
290
|
-
characterLimit?: number | undefined;
|
|
291
|
-
}, {
|
|
292
|
-
segments: [{
|
|
293
|
-
sourceValue: string;
|
|
294
|
-
translations: [{
|
|
295
|
-
value: string;
|
|
296
|
-
id: string;
|
|
297
|
-
locale: string;
|
|
298
|
-
}, ...{
|
|
299
|
-
value: string;
|
|
300
|
-
id: string;
|
|
301
|
-
locale: string;
|
|
302
|
-
}[]];
|
|
303
|
-
tmMatch?: {
|
|
304
|
-
sourceValue: string;
|
|
305
|
-
translatedValue: string;
|
|
306
|
-
} | undefined;
|
|
307
|
-
translationExamples?: {
|
|
308
|
-
sourceValue: string;
|
|
309
|
-
translatedValue: string;
|
|
310
|
-
}[] | undefined;
|
|
311
|
-
}, ...{
|
|
312
|
-
sourceValue: string;
|
|
313
|
-
translations: [{
|
|
314
|
-
value: string;
|
|
315
|
-
id: string;
|
|
316
|
-
locale: string;
|
|
317
|
-
}, ...{
|
|
318
|
-
value: string;
|
|
319
|
-
id: string;
|
|
320
|
-
locale: string;
|
|
321
|
-
}[]];
|
|
322
|
-
tmMatch?: {
|
|
323
|
-
sourceValue: string;
|
|
324
|
-
translatedValue: string;
|
|
325
|
-
} | undefined;
|
|
326
|
-
translationExamples?: {
|
|
327
|
-
sourceValue: string;
|
|
328
|
-
translatedValue: string;
|
|
329
|
-
}[] | undefined;
|
|
330
|
-
}[]];
|
|
331
|
-
id: string;
|
|
332
|
-
context?: {
|
|
333
|
-
description?: string | undefined;
|
|
334
|
-
} | undefined;
|
|
335
|
-
characterLimit?: number | undefined;
|
|
336
|
-
}>;
|
|
134
|
+
}, z.core.$strip>;
|
|
337
135
|
export type LqaAsyncContentUnit = z.infer<typeof LQA_CONTENT_UNIT_SCHEMA>;
|
|
338
136
|
export type LqaAsyncSegment = z.infer<typeof LQA_SEGMENT_SCHEMA>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import z from 'zod';
|
|
1
|
+
import z from 'zod/v4';
|
|
2
2
|
import { removeUnicodeNullCharacters } from "../../helpers/removeUnicodeNullCharacters.js";
|
|
3
3
|
import { isSegmentUnderLengthLimit } from "../../validation/isSegmentUnderLengthLimit.js";
|
|
4
4
|
import { CONTENT_ID_PROP_SCHEMA, LOCALE_SCHEMA, SEGMENT_VALUE_MAX_LENGTH_DEFAULT, TM_MATCH_SCHEMA, TRANSLATION_EXAMPLE_SCHEMA, } from "../common/commonSchemas.js";
|
|
5
|
+
import { CLDRPluralForm, ContentUnitType, refineIdsUniqueInSegmentedUnit, refineOtherFormIsPresentInPluralUnit, refinePluralFormNotAllowedInSegmentedUnit, refinePluralFormRequiredInPluralUnit, refinePluralFormsUniqueInPluralUnit, } from "../common/pluralFormSchemas.js";
|
|
5
6
|
export const LqaIssueSeverityEnum = {
|
|
6
7
|
NEUTRAL: 'neutral',
|
|
7
8
|
MINOR: 'minor',
|
|
@@ -31,6 +32,7 @@ export const LQA_SEGMENT_SCHEMA = z
|
|
|
31
32
|
.refine((value) => isSegmentUnderLengthLimit(value), `Too long segment value, max length is ${SEGMENT_VALUE_MAX_LENGTH_DEFAULT} characters`)
|
|
32
33
|
.transform(removeUnicodeNullCharacters)
|
|
33
34
|
.describe('Text content of the segment in source language'),
|
|
35
|
+
pluralForm: z.enum(CLDRPluralForm).optional(),
|
|
34
36
|
translations: z
|
|
35
37
|
.array(LQA_TRANSLATION_SCHEMA)
|
|
36
38
|
.nonempty()
|
|
@@ -53,8 +55,10 @@ export const LQA_SEGMENT_SCHEMA = z
|
|
|
53
55
|
}
|
|
54
56
|
return segment;
|
|
55
57
|
});
|
|
56
|
-
export const LQA_CONTENT_UNIT_SCHEMA = z
|
|
58
|
+
export const LQA_CONTENT_UNIT_SCHEMA = z
|
|
59
|
+
.object({
|
|
57
60
|
id: LQA_CONTENT_UNIT_ID_SCHEMA,
|
|
61
|
+
type: z.enum(ContentUnitType).default(ContentUnitType.SEGMENTED),
|
|
58
62
|
context: z
|
|
59
63
|
.object({
|
|
60
64
|
description: z
|
|
@@ -72,5 +76,10 @@ export const LQA_CONTENT_UNIT_SCHEMA = z.object({
|
|
|
72
76
|
.max(LQA_CONTENT_UNIT_SEGMENTS_MAX_LENGTH)
|
|
73
77
|
.describe('List of segments to be reviewed'),
|
|
74
78
|
characterLimit: z.number().optional(),
|
|
75
|
-
})
|
|
79
|
+
})
|
|
80
|
+
.refine(...refinePluralFormRequiredInPluralUnit)
|
|
81
|
+
.refine(...refinePluralFormNotAllowedInSegmentedUnit)
|
|
82
|
+
.refine(...refinePluralFormsUniqueInPluralUnit)
|
|
83
|
+
.refine(...refineOtherFormIsPresentInPluralUnit)
|
|
84
|
+
.refine(...refineIdsUniqueInSegmentedUnit);
|
|
76
85
|
//# sourceMappingURL=commonSchemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonSchemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/lqa/commonSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"commonSchemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/lqa/commonSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAA;AAE1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAA;AACzF,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,gCAAgC,EAChC,eAAe,EACf,0BAA0B,GAC3B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,cAAc,EACd,eAAe,EACf,8BAA8B,EAC9B,oCAAoC,EACpC,yCAAyC,EACzC,oCAAoC,EACpC,mCAAmC,GACpC,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACZ,CAAA;AAIV,MAAM,mCAAmC,GAAG,EAAE,CAAA;AAC9C,MAAM,uCAAuC,GAAG,KAAK,CAAA;AACrD,MAAM,oCAAoC,GAAG,GAAG,CAAA;AAEhD,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAC,QAAQ,CACtE,sCAAsC,CACvC,CAAA;AAED,MAAM,CAAC,MAAM,0BA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