Skip to content

Commit

Permalink
feat: support for ai pre-translation (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
yevheniyJ authored Jul 7, 2024
1 parent 9170e29 commit 07984eb
Showing 1 changed file with 38 additions and 10 deletions.
48 changes: 38 additions & 10 deletions src/translations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,15 @@ export namespace TranslationsModel {
fileIds: number[];
method?: Method;
engineId?: number;
aiPromptId?: number;
autoApproveOption?: AutoApproveOption;
duplicateTranslations?: boolean;
skipApprovedTranslations?: boolean;
translateUntranslatedOnly?: boolean;
translateWithPerfectMatchOnly?: boolean;
markAddedTranslationsAsDone?: boolean;
fallbackLanguages?: {
languageId?: string[];
};
labelIds?: number[];
excludeLabelIds?: number[];
}
Expand All @@ -216,15 +220,15 @@ export namespace TranslationsModel {
branchIds?: number[];
method?: Method;
engineId?: number;
aiPromptId?: number;
autoApproveOption?: AutoApproveOption;
duplicateTranslations?: boolean;
skipApprovedTranslations?: boolean;
translateUntranslatedOnly?: boolean;
translateWithPerfectMatchOnly?: boolean;
markAddedTranslationsAsDone?: boolean;
fallbackLanguages?: {
languageId: string;
}[];
languageId: string[];
};
labelIds?: number[];
excludeLabelIds?: number[];
}
Expand All @@ -233,15 +237,22 @@ export namespace TranslationsModel {
targetLanguageIds?: string[];
skipUntranslatedStrings?: boolean;
skipUntranslatedFiles?: boolean;
exportApprovedOnly?: boolean;
preserveFolderHierarchy?: boolean;
// enterprise
exportStringsThatPassedWorkflow?: boolean;
exportWithMinApprovalsCount?: number;
// community
exportApprovedOnly?: boolean;
}

export interface BuildProjectDirectoryTranslationResponse {
id: number;
projectId: number;
status: BuildStatus;
progress: number;
createdAt: string;
updatedAt: string;
finishedAt: string;
}

export type BuildStatus = 'created' | 'inProgress' | 'canceled' | 'failed' | 'finished';
Expand All @@ -254,8 +265,11 @@ export namespace TranslationsModel {
exportAsXliff?: boolean;
skipUntranslatedStrings?: boolean;
skipUntranslatedFiles?: boolean;
// community
exportApprovedOnly?: boolean;
// enterprise
exportWithMinApprovalsCount?: number;
exportStringsThatPassedWorkflow?: boolean;
}

export interface BuildProjectFileTranslationResponse extends DownloadLink {
Expand All @@ -272,7 +286,6 @@ export namespace TranslationsModel {
skipApprovedTranslations: boolean;
translateUntranslatedOnly: boolean;
translateWithPerfectMatchOnly: boolean;
markAddedTranslationsAsDone: boolean;
labelIds?: number[];
excludeLabelIds?: number[];
}
Expand All @@ -285,28 +298,38 @@ export namespace TranslationsModel {

export interface Build {
id: number;
projectId: number;
status: BuildStatus;
progress: number;
attributes: Attribute[];
createdAt: string;
updatedAt: string;
finishedAt: string;
}

export interface Attribute {
projectId: number;
branchId: number;
directoryId: number;
targetLanguagesId: string[];
skipUntranslatedStrings: boolean;
skipUntranslatedFiles: boolean;
// community
exportApprovedOnly: boolean;
// enterprise
exportWithMinApprovalsCount: number;
skipUntranslatedFiles: boolean;
exportStringsThatPassedWorkflow: boolean;
}

export interface BuildRequest {
branchId?: number;
targetLanguageIds?: string[];
skipUntranslatedStrings?: boolean;
skipUntranslatedFiles?: boolean;
// community
exportApprovedOnly?: boolean;
// enterprise
exportWithMinApprovalsCount?: number;
exportStringsThatPassedWorkflow?: boolean;
}

export interface PseudoBuildRequest {
Expand All @@ -323,8 +346,11 @@ export namespace TranslationsModel {
fileId: number;
importEqSuggestions?: boolean;
autoApproveImported?: boolean;
markAddedTranslationsAsDone?: boolean;
translateHidden?: boolean;
/**
* @deprecated
*/
markAddedTranslationsAsDone?: boolean;
}

export interface UploadTranslationStringsRequest {
Expand Down Expand Up @@ -357,8 +383,10 @@ export namespace TranslationsModel {
directoryIds?: number[];
fileIds?: number[];
skipUntranslatedStrings?: boolean;
exportApprovedOnly?: boolean;
skipUntranslatedFiles?: boolean;
// community
exportApprovedOnly?: boolean;
// enterprise
exportWithMinApprovalsCount?: number;
exportStringsThatPassedWorkflow?: boolean;
}
Expand Down

0 comments on commit 07984eb

Please sign in to comment.