|
8 | 8 | ResponseObject, |
9 | 9 | Status, |
10 | 10 | } from '../core'; |
| 11 | +import { ProjectsGroupsModel } from '../projectsGroups'; |
11 | 12 |
|
12 | 13 | /** |
13 | 14 | * Translators can work with entirely untranslated project or you can pre-translate the files to ease the translations process. |
@@ -70,6 +71,19 @@ export class Translations extends CrowdinApi { |
70 | 71 | return this.patch(url, request, this.defaultConfig()); |
71 | 72 | } |
72 | 73 |
|
| 74 | + /** |
| 75 | + * @param projectId project identifier |
| 76 | + * @param preTranslationId pre translation identifier |
| 77 | + * @see https://developer.crowdin.com/api/v2/#operation/api.projects.pre-translations.report.getReport |
| 78 | + */ |
| 79 | + getPreTranslationReport( |
| 80 | + projectId: number, |
| 81 | + preTranslationId: string, |
| 82 | + ): Promise<ResponseObject<TranslationsModel.PreTranslationReport>> { |
| 83 | + const url = `${this.url}/projects/${projectId}/pre-translations/${preTranslationId}/report`; |
| 84 | + return this.get(url, this.defaultConfig()); |
| 85 | + } |
| 86 | + |
73 | 87 | /** |
74 | 88 | * @param projectId project identifier |
75 | 89 | * @param directoryId directory identifier |
@@ -419,4 +433,30 @@ export namespace TranslationsModel { |
419 | 433 | export interface ListProjectBuildsOptions extends PaginationOptions { |
420 | 434 | branchId?: number; |
421 | 435 | } |
| 436 | + |
| 437 | + export interface PreTranslationReport { |
| 438 | + languages: TargetLanguage[]; |
| 439 | + preTranslateType: Method; |
| 440 | + } |
| 441 | + |
| 442 | + export interface TargetLanguage { |
| 443 | + id: string; |
| 444 | + files: TargetLanguageFile[]; |
| 445 | + skipped: SkippedInfo; |
| 446 | + skippedQaCheckCategories: ProjectsGroupsModel.CheckCategories; |
| 447 | + } |
| 448 | + |
| 449 | + export interface TargetLanguageFile { |
| 450 | + id: string; |
| 451 | + statistics: TargetLanguageFileStatistics; |
| 452 | + } |
| 453 | + |
| 454 | + export interface TargetLanguageFileStatistics { |
| 455 | + phrases: number; |
| 456 | + words: number; |
| 457 | + } |
| 458 | + |
| 459 | + export interface SkippedInfo { |
| 460 | + [key: string]: any; |
| 461 | + } |
422 | 462 | } |
0 commit comments