TranslationApi
extends AbstractApi
in package
Translators can work with entirely untranslated project or you can pre-translate the files to ease the translations process.
Use API to pre-translate files via Machine Translation or Translation Memory, upload your existing translations, and download translations. Pre-translate and build are asynchronous operations and shall be completed with sequence of API methods.
Table of Contents
Methods
- applyPreTranslation() : PreTranslation|null
- Apply Pre-Translation
- buildProject() : TranslationProjectBuild|null
- Build Project Translation
- buildProjectDirectoryTranslation() : TranslationProjectDirectory|null
- Build Project Directory Translation
- buildProjectFileTranslation() : DownloadFile|null
- Build Project File Translation
- deleteProjectBuild() : mixed
- Cancel Build
- downloadProjectBuild() : DownloadFile|null
- Download Project Translations
- exportProjectTranslation() : DownloadFile
- Export Project Translation
- getPreTranslation() : PreTranslation|null
- Pre-Translation Status
- getProjectBuilds() : ModelCollection
- List Project Builds
- getProjectBuildStatus() : TranslationProjectBuild|null
- Check Project Build Status
- uploadTranslations() : array<string|int, mixed>
- Upload Translations
Methods
applyPreTranslation()
Apply Pre-Translation
public
applyPreTranslation(int $projectId, array<string|int, mixed> $params) : PreTranslation|null
Parameters
- $projectId : int
- $params : array<string|int, mixed>
-
string[] $params[languageIds] required
int[] $params[fileIds] required
string $params[method]
int $params[engineId]
string $params[autoApproveOption]
boolean $params[duplicateTranslations] Works only with TM pre-translation method
boolean $params[translateUntranslatedOnly] Works only with TM pre-translation method
boolean $params[translateWithPerfectMatchOnly] Works only with TM pre-translation method
Tags
Return values
PreTranslation|nullbuildProject()
Build Project Translation
public
buildProject(int $projectId[, array<string|int, mixed> $params = [] ]) : TranslationProjectBuild|null
Parameters
- $projectId : int
- $params : array<string|int, mixed> = []
-
integer $params[branchId]
array $params[targetLanguageIds]
bool $params[skipUntranslatedStrings] true value can't be used with skipUntranslatedFiles=true in same request
bool $params[skipUntranslatedFiles] true value can't be used with skipUntranslatedStrings=true in same request
bool $params[exportApprovedOnly]
integer $params[exportWithMinApprovalsCount]
Tags
Return values
TranslationProjectBuild|nullbuildProjectDirectoryTranslation()
Build Project Directory Translation
public
buildProjectDirectoryTranslation(int $projectId, int $directoryId[, array<string|int, mixed> $params = [] ]) : TranslationProjectDirectory|null
Parameters
- $projectId : int
- $directoryId : int
- $params : array<string|int, mixed> = []
-
string[] $params[targetLanguageIds] Leave this field empty to build all target languages
boolean $params[skipUntranslatedStrings] Default: false
boolean $params[skipUntranslatedFiles] Default: false
boolean $params[exportApprovedOnly] Default: false
boolean $params[preserveFolderHierarchy] Default: false
Tags
Return values
TranslationProjectDirectory|nullbuildProjectFileTranslation()
Build Project File Translation
public
buildProjectFileTranslation(int $projectId, int $fileId[, array<string|int, mixed> $params = [] ][, string|null $ifNoneMatch = null ]) : DownloadFile|null
Parameters
- $projectId : int
- $fileId : int
- $params : array<string|int, mixed> = []
- $ifNoneMatch : string|null = null
Tags
Return values
DownloadFile|null —string $params[targetLanguageId]
boolean $params[exportAsXliff]
boolean $params[skipUntranslatedStrings] true value can't be used with skipUntranslatedFiles=true in same request
boolean $params[skipUntranslatedFiles] true value can't be used with skipUntranslatedStrings=true in same request
boolean $params[exportApprovedOnly]
deleteProjectBuild()
Cancel Build
public
deleteProjectBuild(int $projectId, int $buildId) : mixed
Parameters
- $projectId : int
- $buildId : int
Tags
downloadProjectBuild()
Download Project Translations
public
downloadProjectBuild(int $projectId, int $buildId) : DownloadFile|null
Parameters
- $projectId : int
- $buildId : int
Tags
Return values
DownloadFile|nullexportProjectTranslation()
Export Project Translation
public
exportProjectTranslation(int $projectId[, array<string|int, mixed> $params = [] ]) : DownloadFile
Parameters
- $projectId : int
- $params : array<string|int, mixed> = []
-
string $params[targetLanguageId] required
string $params[format]
int[] $params[branchIds] Note: Can't be used with directoryIds or fileIds in same request
int[] $params[directoryIds] Note: Can't be used with branchIds or fileIds in same request
int[] $params[fileIds] Note: Can't be used with branchIds or directoryIds in same request
bool $params[skipUntranslatedStrings] Note: Can't be used with skipUntranslatedFiles in same request
bool $params[skipUntranslatedFiles] Note: Can't be used with skipUntranslatedStrings in same request
bool $params[exportApprovedOnly]
integer $params[exportWithMinApprovalsCount]
Tags
Return values
DownloadFilegetPreTranslation()
Pre-Translation Status
public
getPreTranslation(int $projectId, string $preTranslationId) : PreTranslation|null
Parameters
- $projectId : int
- $preTranslationId : string
Tags
Return values
PreTranslation|nullgetProjectBuilds()
List Project Builds
public
getProjectBuilds(int $projectId[, array<string|int, mixed> $params = [] ]) : ModelCollection
Parameters
- $projectId : int
- $params : array<string|int, mixed> = []
-
integer $params[branchId]
integer $params[limit]
integer $params[offset]
Tags
Return values
ModelCollectiongetProjectBuildStatus()
Check Project Build Status
public
getProjectBuildStatus(int $projectId, int $buildId) : TranslationProjectBuild|null
Parameters
- $projectId : int
- $buildId : int
Tags
Return values
TranslationProjectBuild|nulluploadTranslations()
Upload Translations
public
uploadTranslations(int $projectId, string $languageId, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $projectId : int
- $languageId : string
- $params : array<string|int, mixed>
-
integer $params[storageId] required
integer $params[fileId] required
bool $params[importEqSuggestions]
bool $params[autoApproveImported]