@lokalise/polyglot-sdk 19.0.0 → 19.0.2
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 +22 -22
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/dist/sdk/PolyglotClient.d.ts +7 -7
- package/dist/sdk/PolyglotClient.js +6 -6
- package/dist/sdk/helpers/htmlEscaping.d.ts +1 -1
- package/dist/sdk/helpers/htmlEscaping.js +3 -3
- package/dist/sdk/helpers/htmlEscaping.js.map +1 -1
- package/dist/sdk/helpers/nonTranslatableContentHelper.d.ts +1 -1
- package/dist/sdk/helpers/nonTranslatableContentHelper.js +3 -3
- package/dist/sdk/helpers/nonTranslatableContentHelper.js.map +1 -1
- package/dist/sdk/helpers/nonTranslatableContentWrappers.d.ts +2 -12
- package/dist/sdk/helpers/nonTranslatableContentWrappers.js +26 -38
- package/dist/sdk/helpers/nonTranslatableContentWrappers.js.map +1 -1
- package/dist/sdk/schemas/common/asyncRequestSchemas.d.ts +1 -1
- package/dist/sdk/schemas/common/commonSchemas.d.ts +12 -1
- package/dist/sdk/schemas/common/commonSchemas.js +5 -1
- package/dist/sdk/schemas/common/commonSchemas.js.map +1 -1
- package/dist/sdk/schemas/common/errorSchemas.d.ts +1 -1
- package/dist/sdk/schemas/common/errorSchemas.js +1 -1
- package/dist/sdk/schemas/common/translationContextSchemas.d.ts +0 -11
- package/dist/sdk/schemas/common/translationContextSchemas.js +2 -6
- package/dist/sdk/schemas/common/translationContextSchemas.js.map +1 -1
- package/dist/sdk/schemas/lqa/commonSchemas.d.ts +1 -1
- package/dist/sdk/schemas/lqa/lqaAsyncSchemas.js +8 -7
- package/dist/sdk/schemas/lqa/lqaAsyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/lqa/lqaSyncSchemas.js +7 -6
- package/dist/sdk/schemas/lqa/lqaSyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/generateVariants.js +3 -3
- package/dist/sdk/schemas/translation/rewriteTextSchemas.d.ts +1 -1
- package/dist/sdk/schemas/translation/rewriteTextSchemas.js +4 -4
- package/dist/sdk/schemas/translation/sharedSchemas.d.ts +117 -4
- package/dist/sdk/schemas/translation/sharedSchemas.js +21 -5
- package/dist/sdk/schemas/translation/sharedSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/translateAsyncSchemas.d.ts +265 -1
- package/dist/sdk/schemas/translation/translateAsyncSchemas.js +5 -5
- package/dist/sdk/schemas/translation/translateSyncSchemas.d.ts +233 -1
- package/dist/sdk/schemas/translation/translateSyncSchemas.js +4 -4
- package/dist/sdk/schemas/translation/translateTextSegmentSchemas.js +4 -4
- package/dist/sdk/schemas/translation/translateTextSegmentSchemas.js.map +1 -1
- package/dist/sdk/validation/isSegmentUnderLengthLimit.d.ts +1 -1
- package/dist/sdk/validation/isSegmentUnderLengthLimit.js +3 -3
- package/dist/sdk/validation/requestSizeLimit.d.ts +2 -2
- package/dist/sdk/validation/requestSizeLimit.js +2 -2
- package/package.json +17 -15
|
@@ -237,7 +237,7 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
237
237
|
description: string;
|
|
238
238
|
}>>;
|
|
239
239
|
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
240
|
-
segments: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
240
|
+
segments: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
241
241
|
id: z.ZodString;
|
|
242
242
|
tmMatch: z.ZodOptional<z.ZodObject<{
|
|
243
243
|
sourceValue: z.ZodString;
|
|
@@ -249,10 +249,24 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
249
249
|
sourceValue: string;
|
|
250
250
|
translatedValue: string;
|
|
251
251
|
}>>;
|
|
252
|
+
translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
253
|
+
sourceValue: z.ZodString;
|
|
254
|
+
translatedValue: z.ZodString;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
sourceValue: string;
|
|
257
|
+
translatedValue: string;
|
|
258
|
+
}, {
|
|
259
|
+
sourceValue: string;
|
|
260
|
+
translatedValue: string;
|
|
261
|
+
}>, "many">>;
|
|
252
262
|
value: z.ZodString;
|
|
253
263
|
}, "strip", z.ZodTypeAny, {
|
|
254
264
|
value: string;
|
|
255
265
|
id: string;
|
|
266
|
+
translationExamples?: {
|
|
267
|
+
sourceValue: string;
|
|
268
|
+
translatedValue: string;
|
|
269
|
+
}[] | undefined;
|
|
256
270
|
tmMatch?: {
|
|
257
271
|
sourceValue: string;
|
|
258
272
|
translatedValue: string;
|
|
@@ -260,6 +274,32 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
260
274
|
}, {
|
|
261
275
|
value: string;
|
|
262
276
|
id: string;
|
|
277
|
+
translationExamples?: {
|
|
278
|
+
sourceValue: string;
|
|
279
|
+
translatedValue: string;
|
|
280
|
+
}[] | undefined;
|
|
281
|
+
tmMatch?: {
|
|
282
|
+
sourceValue: string;
|
|
283
|
+
translatedValue: string;
|
|
284
|
+
} | undefined;
|
|
285
|
+
}>, {
|
|
286
|
+
value: string;
|
|
287
|
+
id: string;
|
|
288
|
+
translationExamples?: {
|
|
289
|
+
sourceValue: string;
|
|
290
|
+
translatedValue: string;
|
|
291
|
+
}[] | undefined;
|
|
292
|
+
tmMatch?: {
|
|
293
|
+
sourceValue: string;
|
|
294
|
+
translatedValue: string;
|
|
295
|
+
} | undefined;
|
|
296
|
+
}, {
|
|
297
|
+
value: string;
|
|
298
|
+
id: string;
|
|
299
|
+
translationExamples?: {
|
|
300
|
+
sourceValue: string;
|
|
301
|
+
translatedValue: string;
|
|
302
|
+
}[] | undefined;
|
|
263
303
|
tmMatch?: {
|
|
264
304
|
sourceValue: string;
|
|
265
305
|
translatedValue: string;
|
|
@@ -267,6 +307,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
267
307
|
}>, "atleastone">, [{
|
|
268
308
|
value: string;
|
|
269
309
|
id: string;
|
|
310
|
+
translationExamples?: {
|
|
311
|
+
sourceValue: string;
|
|
312
|
+
translatedValue: string;
|
|
313
|
+
}[] | undefined;
|
|
270
314
|
tmMatch?: {
|
|
271
315
|
sourceValue: string;
|
|
272
316
|
translatedValue: string;
|
|
@@ -274,6 +318,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
274
318
|
}, ...{
|
|
275
319
|
value: string;
|
|
276
320
|
id: string;
|
|
321
|
+
translationExamples?: {
|
|
322
|
+
sourceValue: string;
|
|
323
|
+
translatedValue: string;
|
|
324
|
+
}[] | undefined;
|
|
277
325
|
tmMatch?: {
|
|
278
326
|
sourceValue: string;
|
|
279
327
|
translatedValue: string;
|
|
@@ -281,6 +329,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
281
329
|
}[]], [{
|
|
282
330
|
value: string;
|
|
283
331
|
id: string;
|
|
332
|
+
translationExamples?: {
|
|
333
|
+
sourceValue: string;
|
|
334
|
+
translatedValue: string;
|
|
335
|
+
}[] | undefined;
|
|
284
336
|
tmMatch?: {
|
|
285
337
|
sourceValue: string;
|
|
286
338
|
translatedValue: string;
|
|
@@ -288,6 +340,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
288
340
|
}, ...{
|
|
289
341
|
value: string;
|
|
290
342
|
id: string;
|
|
343
|
+
translationExamples?: {
|
|
344
|
+
sourceValue: string;
|
|
345
|
+
translatedValue: string;
|
|
346
|
+
}[] | undefined;
|
|
291
347
|
tmMatch?: {
|
|
292
348
|
sourceValue: string;
|
|
293
349
|
translatedValue: string;
|
|
@@ -298,6 +354,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
298
354
|
segments: [{
|
|
299
355
|
value: string;
|
|
300
356
|
id: string;
|
|
357
|
+
translationExamples?: {
|
|
358
|
+
sourceValue: string;
|
|
359
|
+
translatedValue: string;
|
|
360
|
+
}[] | undefined;
|
|
301
361
|
tmMatch?: {
|
|
302
362
|
sourceValue: string;
|
|
303
363
|
translatedValue: string;
|
|
@@ -305,6 +365,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
305
365
|
}, ...{
|
|
306
366
|
value: string;
|
|
307
367
|
id: string;
|
|
368
|
+
translationExamples?: {
|
|
369
|
+
sourceValue: string;
|
|
370
|
+
translatedValue: string;
|
|
371
|
+
}[] | undefined;
|
|
308
372
|
tmMatch?: {
|
|
309
373
|
sourceValue: string;
|
|
310
374
|
translatedValue: string;
|
|
@@ -319,6 +383,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
319
383
|
segments: [{
|
|
320
384
|
value: string;
|
|
321
385
|
id: string;
|
|
386
|
+
translationExamples?: {
|
|
387
|
+
sourceValue: string;
|
|
388
|
+
translatedValue: string;
|
|
389
|
+
}[] | undefined;
|
|
322
390
|
tmMatch?: {
|
|
323
391
|
sourceValue: string;
|
|
324
392
|
translatedValue: string;
|
|
@@ -326,6 +394,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
326
394
|
}, ...{
|
|
327
395
|
value: string;
|
|
328
396
|
id: string;
|
|
397
|
+
translationExamples?: {
|
|
398
|
+
sourceValue: string;
|
|
399
|
+
translatedValue: string;
|
|
400
|
+
}[] | undefined;
|
|
329
401
|
tmMatch?: {
|
|
330
402
|
sourceValue: string;
|
|
331
403
|
translatedValue: string;
|
|
@@ -340,6 +412,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
340
412
|
segments: [{
|
|
341
413
|
value: string;
|
|
342
414
|
id: string;
|
|
415
|
+
translationExamples?: {
|
|
416
|
+
sourceValue: string;
|
|
417
|
+
translatedValue: string;
|
|
418
|
+
}[] | undefined;
|
|
343
419
|
tmMatch?: {
|
|
344
420
|
sourceValue: string;
|
|
345
421
|
translatedValue: string;
|
|
@@ -347,6 +423,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
347
423
|
}, ...{
|
|
348
424
|
value: string;
|
|
349
425
|
id: string;
|
|
426
|
+
translationExamples?: {
|
|
427
|
+
sourceValue: string;
|
|
428
|
+
translatedValue: string;
|
|
429
|
+
}[] | undefined;
|
|
350
430
|
tmMatch?: {
|
|
351
431
|
sourceValue: string;
|
|
352
432
|
translatedValue: string;
|
|
@@ -361,6 +441,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
361
441
|
segments: [{
|
|
362
442
|
value: string;
|
|
363
443
|
id: string;
|
|
444
|
+
translationExamples?: {
|
|
445
|
+
sourceValue: string;
|
|
446
|
+
translatedValue: string;
|
|
447
|
+
}[] | undefined;
|
|
364
448
|
tmMatch?: {
|
|
365
449
|
sourceValue: string;
|
|
366
450
|
translatedValue: string;
|
|
@@ -368,6 +452,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
368
452
|
}, ...{
|
|
369
453
|
value: string;
|
|
370
454
|
id: string;
|
|
455
|
+
translationExamples?: {
|
|
456
|
+
sourceValue: string;
|
|
457
|
+
translatedValue: string;
|
|
458
|
+
}[] | undefined;
|
|
371
459
|
tmMatch?: {
|
|
372
460
|
sourceValue: string;
|
|
373
461
|
translatedValue: string;
|
|
@@ -382,6 +470,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
382
470
|
segments: [{
|
|
383
471
|
value: string;
|
|
384
472
|
id: string;
|
|
473
|
+
translationExamples?: {
|
|
474
|
+
sourceValue: string;
|
|
475
|
+
translatedValue: string;
|
|
476
|
+
}[] | undefined;
|
|
385
477
|
tmMatch?: {
|
|
386
478
|
sourceValue: string;
|
|
387
479
|
translatedValue: string;
|
|
@@ -389,6 +481,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
389
481
|
}, ...{
|
|
390
482
|
value: string;
|
|
391
483
|
id: string;
|
|
484
|
+
translationExamples?: {
|
|
485
|
+
sourceValue: string;
|
|
486
|
+
translatedValue: string;
|
|
487
|
+
}[] | undefined;
|
|
392
488
|
tmMatch?: {
|
|
393
489
|
sourceValue: string;
|
|
394
490
|
translatedValue: string;
|
|
@@ -403,6 +499,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
403
499
|
segments: [{
|
|
404
500
|
value: string;
|
|
405
501
|
id: string;
|
|
502
|
+
translationExamples?: {
|
|
503
|
+
sourceValue: string;
|
|
504
|
+
translatedValue: string;
|
|
505
|
+
}[] | undefined;
|
|
406
506
|
tmMatch?: {
|
|
407
507
|
sourceValue: string;
|
|
408
508
|
translatedValue: string;
|
|
@@ -410,6 +510,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
410
510
|
}, ...{
|
|
411
511
|
value: string;
|
|
412
512
|
id: string;
|
|
513
|
+
translationExamples?: {
|
|
514
|
+
sourceValue: string;
|
|
515
|
+
translatedValue: string;
|
|
516
|
+
}[] | undefined;
|
|
413
517
|
tmMatch?: {
|
|
414
518
|
sourceValue: string;
|
|
415
519
|
translatedValue: string;
|
|
@@ -427,6 +531,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
427
531
|
segments: [{
|
|
428
532
|
value: string;
|
|
429
533
|
id: string;
|
|
534
|
+
translationExamples?: {
|
|
535
|
+
sourceValue: string;
|
|
536
|
+
translatedValue: string;
|
|
537
|
+
}[] | undefined;
|
|
430
538
|
tmMatch?: {
|
|
431
539
|
sourceValue: string;
|
|
432
540
|
translatedValue: string;
|
|
@@ -434,6 +542,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
434
542
|
}, ...{
|
|
435
543
|
value: string;
|
|
436
544
|
id: string;
|
|
545
|
+
translationExamples?: {
|
|
546
|
+
sourceValue: string;
|
|
547
|
+
translatedValue: string;
|
|
548
|
+
}[] | undefined;
|
|
437
549
|
tmMatch?: {
|
|
438
550
|
sourceValue: string;
|
|
439
551
|
translatedValue: string;
|
|
@@ -448,6 +560,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
448
560
|
segments: [{
|
|
449
561
|
value: string;
|
|
450
562
|
id: string;
|
|
563
|
+
translationExamples?: {
|
|
564
|
+
sourceValue: string;
|
|
565
|
+
translatedValue: string;
|
|
566
|
+
}[] | undefined;
|
|
451
567
|
tmMatch?: {
|
|
452
568
|
sourceValue: string;
|
|
453
569
|
translatedValue: string;
|
|
@@ -455,6 +571,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
455
571
|
}, ...{
|
|
456
572
|
value: string;
|
|
457
573
|
id: string;
|
|
574
|
+
translationExamples?: {
|
|
575
|
+
sourceValue: string;
|
|
576
|
+
translatedValue: string;
|
|
577
|
+
}[] | undefined;
|
|
458
578
|
tmMatch?: {
|
|
459
579
|
sourceValue: string;
|
|
460
580
|
translatedValue: string;
|
|
@@ -530,6 +650,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
530
650
|
segments: [{
|
|
531
651
|
value: string;
|
|
532
652
|
id: string;
|
|
653
|
+
translationExamples?: {
|
|
654
|
+
sourceValue: string;
|
|
655
|
+
translatedValue: string;
|
|
656
|
+
}[] | undefined;
|
|
533
657
|
tmMatch?: {
|
|
534
658
|
sourceValue: string;
|
|
535
659
|
translatedValue: string;
|
|
@@ -537,6 +661,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
537
661
|
}, ...{
|
|
538
662
|
value: string;
|
|
539
663
|
id: string;
|
|
664
|
+
translationExamples?: {
|
|
665
|
+
sourceValue: string;
|
|
666
|
+
translatedValue: string;
|
|
667
|
+
}[] | undefined;
|
|
540
668
|
tmMatch?: {
|
|
541
669
|
sourceValue: string;
|
|
542
670
|
translatedValue: string;
|
|
@@ -551,6 +679,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
551
679
|
segments: [{
|
|
552
680
|
value: string;
|
|
553
681
|
id: string;
|
|
682
|
+
translationExamples?: {
|
|
683
|
+
sourceValue: string;
|
|
684
|
+
translatedValue: string;
|
|
685
|
+
}[] | undefined;
|
|
554
686
|
tmMatch?: {
|
|
555
687
|
sourceValue: string;
|
|
556
688
|
translatedValue: string;
|
|
@@ -558,6 +690,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
558
690
|
}, ...{
|
|
559
691
|
value: string;
|
|
560
692
|
id: string;
|
|
693
|
+
translationExamples?: {
|
|
694
|
+
sourceValue: string;
|
|
695
|
+
translatedValue: string;
|
|
696
|
+
}[] | undefined;
|
|
561
697
|
tmMatch?: {
|
|
562
698
|
sourceValue: string;
|
|
563
699
|
translatedValue: string;
|
|
@@ -633,6 +769,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
633
769
|
segments: [{
|
|
634
770
|
value: string;
|
|
635
771
|
id: string;
|
|
772
|
+
translationExamples?: {
|
|
773
|
+
sourceValue: string;
|
|
774
|
+
translatedValue: string;
|
|
775
|
+
}[] | undefined;
|
|
636
776
|
tmMatch?: {
|
|
637
777
|
sourceValue: string;
|
|
638
778
|
translatedValue: string;
|
|
@@ -640,6 +780,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
640
780
|
}, ...{
|
|
641
781
|
value: string;
|
|
642
782
|
id: string;
|
|
783
|
+
translationExamples?: {
|
|
784
|
+
sourceValue: string;
|
|
785
|
+
translatedValue: string;
|
|
786
|
+
}[] | undefined;
|
|
643
787
|
tmMatch?: {
|
|
644
788
|
sourceValue: string;
|
|
645
789
|
translatedValue: string;
|
|
@@ -654,6 +798,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
654
798
|
segments: [{
|
|
655
799
|
value: string;
|
|
656
800
|
id: string;
|
|
801
|
+
translationExamples?: {
|
|
802
|
+
sourceValue: string;
|
|
803
|
+
translatedValue: string;
|
|
804
|
+
}[] | undefined;
|
|
657
805
|
tmMatch?: {
|
|
658
806
|
sourceValue: string;
|
|
659
807
|
translatedValue: string;
|
|
@@ -661,6 +809,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
661
809
|
}, ...{
|
|
662
810
|
value: string;
|
|
663
811
|
id: string;
|
|
812
|
+
translationExamples?: {
|
|
813
|
+
sourceValue: string;
|
|
814
|
+
translatedValue: string;
|
|
815
|
+
}[] | undefined;
|
|
664
816
|
tmMatch?: {
|
|
665
817
|
sourceValue: string;
|
|
666
818
|
translatedValue: string;
|
|
@@ -736,6 +888,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
736
888
|
segments: [{
|
|
737
889
|
value: string;
|
|
738
890
|
id: string;
|
|
891
|
+
translationExamples?: {
|
|
892
|
+
sourceValue: string;
|
|
893
|
+
translatedValue: string;
|
|
894
|
+
}[] | undefined;
|
|
739
895
|
tmMatch?: {
|
|
740
896
|
sourceValue: string;
|
|
741
897
|
translatedValue: string;
|
|
@@ -743,6 +899,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
743
899
|
}, ...{
|
|
744
900
|
value: string;
|
|
745
901
|
id: string;
|
|
902
|
+
translationExamples?: {
|
|
903
|
+
sourceValue: string;
|
|
904
|
+
translatedValue: string;
|
|
905
|
+
}[] | undefined;
|
|
746
906
|
tmMatch?: {
|
|
747
907
|
sourceValue: string;
|
|
748
908
|
translatedValue: string;
|
|
@@ -757,6 +917,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
757
917
|
segments: [{
|
|
758
918
|
value: string;
|
|
759
919
|
id: string;
|
|
920
|
+
translationExamples?: {
|
|
921
|
+
sourceValue: string;
|
|
922
|
+
translatedValue: string;
|
|
923
|
+
}[] | undefined;
|
|
760
924
|
tmMatch?: {
|
|
761
925
|
sourceValue: string;
|
|
762
926
|
translatedValue: string;
|
|
@@ -764,6 +928,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
764
928
|
}, ...{
|
|
765
929
|
value: string;
|
|
766
930
|
id: string;
|
|
931
|
+
translationExamples?: {
|
|
932
|
+
sourceValue: string;
|
|
933
|
+
translatedValue: string;
|
|
934
|
+
}[] | undefined;
|
|
767
935
|
tmMatch?: {
|
|
768
936
|
sourceValue: string;
|
|
769
937
|
translatedValue: string;
|
|
@@ -839,6 +1007,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
839
1007
|
segments: [{
|
|
840
1008
|
value: string;
|
|
841
1009
|
id: string;
|
|
1010
|
+
translationExamples?: {
|
|
1011
|
+
sourceValue: string;
|
|
1012
|
+
translatedValue: string;
|
|
1013
|
+
}[] | undefined;
|
|
842
1014
|
tmMatch?: {
|
|
843
1015
|
sourceValue: string;
|
|
844
1016
|
translatedValue: string;
|
|
@@ -846,6 +1018,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
846
1018
|
}, ...{
|
|
847
1019
|
value: string;
|
|
848
1020
|
id: string;
|
|
1021
|
+
translationExamples?: {
|
|
1022
|
+
sourceValue: string;
|
|
1023
|
+
translatedValue: string;
|
|
1024
|
+
}[] | undefined;
|
|
849
1025
|
tmMatch?: {
|
|
850
1026
|
sourceValue: string;
|
|
851
1027
|
translatedValue: string;
|
|
@@ -860,6 +1036,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
860
1036
|
segments: [{
|
|
861
1037
|
value: string;
|
|
862
1038
|
id: string;
|
|
1039
|
+
translationExamples?: {
|
|
1040
|
+
sourceValue: string;
|
|
1041
|
+
translatedValue: string;
|
|
1042
|
+
}[] | undefined;
|
|
863
1043
|
tmMatch?: {
|
|
864
1044
|
sourceValue: string;
|
|
865
1045
|
translatedValue: string;
|
|
@@ -867,6 +1047,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
867
1047
|
}, ...{
|
|
868
1048
|
value: string;
|
|
869
1049
|
id: string;
|
|
1050
|
+
translationExamples?: {
|
|
1051
|
+
sourceValue: string;
|
|
1052
|
+
translatedValue: string;
|
|
1053
|
+
}[] | undefined;
|
|
870
1054
|
tmMatch?: {
|
|
871
1055
|
sourceValue: string;
|
|
872
1056
|
translatedValue: string;
|
|
@@ -942,6 +1126,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
942
1126
|
segments: [{
|
|
943
1127
|
value: string;
|
|
944
1128
|
id: string;
|
|
1129
|
+
translationExamples?: {
|
|
1130
|
+
sourceValue: string;
|
|
1131
|
+
translatedValue: string;
|
|
1132
|
+
}[] | undefined;
|
|
945
1133
|
tmMatch?: {
|
|
946
1134
|
sourceValue: string;
|
|
947
1135
|
translatedValue: string;
|
|
@@ -949,6 +1137,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
949
1137
|
}, ...{
|
|
950
1138
|
value: string;
|
|
951
1139
|
id: string;
|
|
1140
|
+
translationExamples?: {
|
|
1141
|
+
sourceValue: string;
|
|
1142
|
+
translatedValue: string;
|
|
1143
|
+
}[] | undefined;
|
|
952
1144
|
tmMatch?: {
|
|
953
1145
|
sourceValue: string;
|
|
954
1146
|
translatedValue: string;
|
|
@@ -963,6 +1155,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
963
1155
|
segments: [{
|
|
964
1156
|
value: string;
|
|
965
1157
|
id: string;
|
|
1158
|
+
translationExamples?: {
|
|
1159
|
+
sourceValue: string;
|
|
1160
|
+
translatedValue: string;
|
|
1161
|
+
}[] | undefined;
|
|
966
1162
|
tmMatch?: {
|
|
967
1163
|
sourceValue: string;
|
|
968
1164
|
translatedValue: string;
|
|
@@ -970,6 +1166,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
970
1166
|
}, ...{
|
|
971
1167
|
value: string;
|
|
972
1168
|
id: string;
|
|
1169
|
+
translationExamples?: {
|
|
1170
|
+
sourceValue: string;
|
|
1171
|
+
translatedValue: string;
|
|
1172
|
+
}[] | undefined;
|
|
973
1173
|
tmMatch?: {
|
|
974
1174
|
sourceValue: string;
|
|
975
1175
|
translatedValue: string;
|
|
@@ -1045,6 +1245,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
1045
1245
|
segments: [{
|
|
1046
1246
|
value: string;
|
|
1047
1247
|
id: string;
|
|
1248
|
+
translationExamples?: {
|
|
1249
|
+
sourceValue: string;
|
|
1250
|
+
translatedValue: string;
|
|
1251
|
+
}[] | undefined;
|
|
1048
1252
|
tmMatch?: {
|
|
1049
1253
|
sourceValue: string;
|
|
1050
1254
|
translatedValue: string;
|
|
@@ -1052,6 +1256,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
1052
1256
|
}, ...{
|
|
1053
1257
|
value: string;
|
|
1054
1258
|
id: string;
|
|
1259
|
+
translationExamples?: {
|
|
1260
|
+
sourceValue: string;
|
|
1261
|
+
translatedValue: string;
|
|
1262
|
+
}[] | undefined;
|
|
1055
1263
|
tmMatch?: {
|
|
1056
1264
|
sourceValue: string;
|
|
1057
1265
|
translatedValue: string;
|
|
@@ -1066,6 +1274,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
1066
1274
|
segments: [{
|
|
1067
1275
|
value: string;
|
|
1068
1276
|
id: string;
|
|
1277
|
+
translationExamples?: {
|
|
1278
|
+
sourceValue: string;
|
|
1279
|
+
translatedValue: string;
|
|
1280
|
+
}[] | undefined;
|
|
1069
1281
|
tmMatch?: {
|
|
1070
1282
|
sourceValue: string;
|
|
1071
1283
|
translatedValue: string;
|
|
@@ -1073,6 +1285,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
1073
1285
|
}, ...{
|
|
1074
1286
|
value: string;
|
|
1075
1287
|
id: string;
|
|
1288
|
+
translationExamples?: {
|
|
1289
|
+
sourceValue: string;
|
|
1290
|
+
translatedValue: string;
|
|
1291
|
+
}[] | undefined;
|
|
1076
1292
|
tmMatch?: {
|
|
1077
1293
|
sourceValue: string;
|
|
1078
1294
|
translatedValue: string;
|
|
@@ -1148,6 +1364,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
1148
1364
|
segments: [{
|
|
1149
1365
|
value: string;
|
|
1150
1366
|
id: string;
|
|
1367
|
+
translationExamples?: {
|
|
1368
|
+
sourceValue: string;
|
|
1369
|
+
translatedValue: string;
|
|
1370
|
+
}[] | undefined;
|
|
1151
1371
|
tmMatch?: {
|
|
1152
1372
|
sourceValue: string;
|
|
1153
1373
|
translatedValue: string;
|
|
@@ -1155,6 +1375,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
1155
1375
|
}, ...{
|
|
1156
1376
|
value: string;
|
|
1157
1377
|
id: string;
|
|
1378
|
+
translationExamples?: {
|
|
1379
|
+
sourceValue: string;
|
|
1380
|
+
translatedValue: string;
|
|
1381
|
+
}[] | undefined;
|
|
1158
1382
|
tmMatch?: {
|
|
1159
1383
|
sourceValue: string;
|
|
1160
1384
|
translatedValue: string;
|
|
@@ -1169,6 +1393,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
1169
1393
|
segments: [{
|
|
1170
1394
|
value: string;
|
|
1171
1395
|
id: string;
|
|
1396
|
+
translationExamples?: {
|
|
1397
|
+
sourceValue: string;
|
|
1398
|
+
translatedValue: string;
|
|
1399
|
+
}[] | undefined;
|
|
1172
1400
|
tmMatch?: {
|
|
1173
1401
|
sourceValue: string;
|
|
1174
1402
|
translatedValue: string;
|
|
@@ -1176,6 +1404,10 @@ export declare const TRANSLATE_SYNC_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z.Zod
|
|
|
1176
1404
|
}, ...{
|
|
1177
1405
|
value: string;
|
|
1178
1406
|
id: string;
|
|
1407
|
+
translationExamples?: {
|
|
1408
|
+
sourceValue: string;
|
|
1409
|
+
translatedValue: string;
|
|
1410
|
+
}[] | undefined;
|
|
1179
1411
|
tmMatch?: {
|
|
1180
1412
|
sourceValue: string;
|
|
1181
1413
|
translatedValue: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { OWNER_ID_SCHEMA, TENANT_ID_SCHEMA } from
|
|
3
|
-
import { COMMON_ERROR_RESPONSE_SCHEMA, COMMON_REQUEST_HEADERS_SCHEMA, FORCE_INTEGRATION_SCHEMA, LOCALE_SCHEMA, METADATA_SCHEMA, REAL_INTEGRATION_ENGINE_SCHEMA, refineIntegrationIsPresent, } from
|
|
4
|
-
import { TRANSLATION_CONTEXT_SCHEMA } from
|
|
5
|
-
import { CONTENT_ID_PROP_SCHEMA, SEGMENT_WARNINGS_SCHEMA, TRANSLATE_CONTENT_UNIT_SCHEMA, refineDifferentSourceAndTargetLang, refineRequestSizeLimit, refineUniqueIds, } from
|
|
2
|
+
import { OWNER_ID_SCHEMA, TENANT_ID_SCHEMA } from "../common/asyncRequestSchemas.js";
|
|
3
|
+
import { COMMON_ERROR_RESPONSE_SCHEMA, COMMON_REQUEST_HEADERS_SCHEMA, FORCE_INTEGRATION_SCHEMA, LOCALE_SCHEMA, METADATA_SCHEMA, REAL_INTEGRATION_ENGINE_SCHEMA, refineIntegrationIsPresent, } from "../common/commonSchemas.js";
|
|
4
|
+
import { TRANSLATION_CONTEXT_SCHEMA } from "../common/translationContextSchemas.js";
|
|
5
|
+
import { CONTENT_ID_PROP_SCHEMA, SEGMENT_WARNINGS_SCHEMA, TRANSLATE_CONTENT_UNIT_SCHEMA, refineDifferentSourceAndTargetLang, refineRequestSizeLimit, refineUniqueIds, } from "./sharedSchemas.js";
|
|
6
6
|
// See https://lokalise.slack.com/archives/C05FLMT3GQK/p1730293588636539 for context
|
|
7
7
|
const CONTENT_UNITS_MAX_LENGTH = 50;
|
|
8
8
|
export const TRANSLATE_SYNC_BODY_SCHEMA = z
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { OWNER_ID_SCHEMA } from
|
|
3
|
-
import { COMMON_REQUEST_HEADERS_SCHEMA, FORCE_INTEGRATION_SCHEMA, LOCALE_SCHEMA, METADATA_SCHEMA, REAL_INTEGRATION_ENGINE_SCHEMA, refineIntegrationIsPresent, } from
|
|
4
|
-
import { TRANSLATION_CONTEXT_SCHEMA
|
|
5
|
-
import { CONTENT_ID_PROP_SCHEMA, CONTENT_UNIT_DESCRIPTION_MAX_LENGTH, HISTORY_ENTRY_SCHEMA, TranslateModeEnum, refineDifferentSourceAndTargetLang, refineHistoryIsPresent, } from
|
|
2
|
+
import { OWNER_ID_SCHEMA } from "../common/asyncRequestSchemas.js";
|
|
3
|
+
import { COMMON_REQUEST_HEADERS_SCHEMA, FORCE_INTEGRATION_SCHEMA, LOCALE_SCHEMA, METADATA_SCHEMA, REAL_INTEGRATION_ENGINE_SCHEMA, TRANSLATION_EXAMPLE_SCHEMA, refineIntegrationIsPresent, } from "../common/commonSchemas.js";
|
|
4
|
+
import { TRANSLATION_CONTEXT_SCHEMA } from "../common/translationContextSchemas.js";
|
|
5
|
+
import { CONTENT_ID_PROP_SCHEMA, CONTENT_UNIT_DESCRIPTION_MAX_LENGTH, HISTORY_ENTRY_SCHEMA, TranslateModeEnum, refineDifferentSourceAndTargetLang, refineHistoryIsPresent, } from "./sharedSchemas.js";
|
|
6
6
|
export const TRANSLATE_TEXT_SEGMENT_BODY_SCHEMA = z
|
|
7
7
|
.object({
|
|
8
8
|
ownerId: OWNER_ID_SCHEMA.optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translateTextSegmentSchemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/translation/translateTextSegmentSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,aAAa,EACb,eAAe,EACf,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,4BAA4B,CAAA;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"translateTextSegmentSchemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/translation/translateTextSegmentSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,aAAa,EACb,eAAe,EACf,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAA;AACnF,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,oBAAoB,EACpB,iBAAiB,EACjB,kCAAkC,EAClC,sBAAsB,GACvB,MAAM,oBAAoB,CAAA;AAE3B,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC;KAChD,MAAM,CAAC;IACN,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,aAAa;IAC3B,YAAY,EAAE,aAAa;IAC3B,WAAW,EAAE,8BAA8B,CAAC,QAAQ,EAAE;IACtD,gBAAgB,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IACrD,OAAO,EAAE,0BAA0B,CAAC,MAAM,CAAC;QACzC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC,QAAQ,EAAE;QAClF,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE;KACpE,CAAC,CAAC,QAAQ,EAAE;IACb,QAAQ,EAAE,eAAe;IACzB,IAAI,EAAE,CAAC;SACJ,UAAU,CAAC,iBAAiB,CAAC;SAC7B,QAAQ,CACP,2TAA2T,CAC5T;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,aAAa,EAAE,sBAAsB;QACrC,SAAS,EAAE,sBAAsB,CAAC,QAAQ,EAAE;QAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACxB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACtC,CAAC;IACF,OAAO,EAAE,CAAC;SACP,KAAK,CAAC,oBAAoB,CAAC;SAC3B,QAAQ,CAAC,oEAAoE,CAAC;SAC9E,QAAQ,EAAE;CACd,CAAC;KACD,MAAM,CAAC,GAAG,kCAAkC,CAAC;KAC7C,MAAM,CAAC,GAAG,sBAAsB,CAAC;KACjC,MAAM,CAAC,GAAG,0BAA0B,CAAC,CAAA;AAExC,MAAM,CAAC,MAAM,qCAAqC,GAAG,6BAA6B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IntegrationEngineEnum } from '../schemas/common/commonSchemas.
|
|
1
|
+
import type { IntegrationEngineEnum } from '../schemas/common/commonSchemas.ts';
|
|
2
2
|
export declare const isSegmentUnderLengthLimit: (value: string, integration?: IntegrationEngineEnum) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { handleHtmlEscape } from
|
|
2
|
-
import { wrapNonTranslatableRegions } from
|
|
3
|
-
import { getRequestSizeLimit } from
|
|
1
|
+
import { handleHtmlEscape } from "../helpers/htmlEscaping.js";
|
|
2
|
+
import { wrapNonTranslatableRegions } from "../helpers/nonTranslatableContentHelper.js";
|
|
3
|
+
import { getRequestSizeLimit } from "./requestSizeLimit.js";
|
|
4
4
|
export const isSegmentUnderLengthLimit = (value, integration) => {
|
|
5
5
|
const limit = getRequestSizeLimit(integration);
|
|
6
6
|
const htmlEscaped = handleHtmlEscape(value, integration);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type IntegrationEngineEnum } from '../schemas/common/commonSchemas.
|
|
2
|
-
import type { ContentUnitLike } from '../schemas/translation/sharedSchemas.
|
|
1
|
+
import { type IntegrationEngineEnum } from '../schemas/common/commonSchemas.ts';
|
|
2
|
+
import type { ContentUnitLike } from '../schemas/translation/sharedSchemas.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Checks if every segment in the content unit is under the size limit.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { REQUEST_SIZE_LIMIT_MAP, SEGMENT_VALUE_MAX_LENGTH_DEFAULT, } from
|
|
2
|
-
import { isSegmentUnderLengthLimit } from
|
|
1
|
+
import { REQUEST_SIZE_LIMIT_MAP, SEGMENT_VALUE_MAX_LENGTH_DEFAULT, } from "../schemas/common/commonSchemas.js";
|
|
2
|
+
import { isSegmentUnderLengthLimit } from "./isSegmentUnderLengthLimit.js";
|
|
3
3
|
/**
|
|
4
4
|
* Checks if every segment in the content unit is under the size limit.
|
|
5
5
|
*/
|