public interface TranslationService
The (1.0) API legacy translation interface provides functionality for synchronous translation, language detection, and Translation Memory (TM) Updates. This interface is implemented by Translation Connectors to provide connectivity to external MT engines. The Connectors contain the engine specific logic to authenticate against and call their respective MT engines.
The 1.0 synchronous service is implemented in three parts.
Helper methods that make Machine Translation Possible
Translation methods that do the actual translation
Storage and Retrieval methods that store translation with an MT provider and retrieve those translations.
The 2.0 asynchronous service is implemented in 3 parts.
Translation Content that provides objects for translation and supporting that translation
Translation Packaging that provides containers for organizing and delivering objects for translation.
Translation Communication that provides tools for using comments and metadata with the objects and job.
Modifier and Type | Interface and Description |
---|---|
static interface |
TranslationService.TranslationServiceInfo
The Interface TranslationServiceInfo.
|
Modifier and Type | Method and Description |
---|---|
void |
addTranslationJobComment(java.lang.String strTranslationJobID,
Comment comment)
Adds a comment at the translation job level.
|
void |
addTranslationObjectComment(java.lang.String strTranslationJobID,
TranslationObject translationObject,
Comment comment)
Adds a Comment to the Translation Object.
|
java.lang.String |
createTranslationJob(java.lang.String name,
java.lang.String description,
java.lang.String strSourceLanguage,
java.lang.String strTargetLanguage,
java.util.Date dueDate,
TranslationState state,
TranslationMetadata jobMetadata)
Is the core method of TranslationService Class for Asynchronous translation.
|
java.lang.String |
detectLanguage(java.lang.String detectSource,
TranslationConstants.ContentType contentType)
Detects the language of the passed in String (accepts both PLAIN and HTML text).
|
TranslationResult[] |
getAllStoredTranslations(java.lang.String sourceString,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
TranslationConstants.ContentType contentType,
java.lang.String contentCategory,
java.lang.String userId,
int maxTranslations)
Returns all available translation responses for a given string, array will be sorted by rating (best fit first,
in "0").
|
java.lang.String |
getDefaultCategory()
Gets the default category.
|
TranslationScope |
getFinalScope(java.lang.String strTranslationJobID)
Gets the final scope for a Translation Job.
|
java.io.InputStream |
getTranslatedObject(java.lang.String strTranslationJobID,
TranslationObject translationObject)
Gets the translated Object content input stream.
|
CommentCollection<Comment> |
getTranslationJobCommentCollection(java.lang.String strTranslationJobID)
Gets the Translation Job comment collection.
|
TranslationConstants.TranslationStatus |
getTranslationJobStatus(java.lang.String strTranslationJobID)
Gets the Translation Job status.
|
CommentCollection<Comment> |
getTranslationObjectCommentCollection(java.lang.String strTranslationJobID,
TranslationObject translationObject)
Gets the Translation Object comment collection.
|
TranslationConstants.TranslationStatus[] |
getTranslationObjectsStatus(java.lang.String strTranslationJobID,
TranslationObject[] translationObjects)
Gets the status of the translation Object.
|
TranslationConstants.TranslationStatus |
getTranslationObjectStatus(java.lang.String strTranslationJobID,
TranslationObject translationObject)
Gets the translation Object status.
|
TranslationService.TranslationServiceInfo |
getTranslationServiceInfo()
Gets information on a translation service.
|
boolean |
isDirectionSupported(java.lang.String sourceLanguage,
java.lang.String targetLanguage)
Returns true/false whether the current service supports the specified translation direction.
|
void |
setDefaultCategory(java.lang.String defaultCategory)
Sets the default category.
|
void |
storeTranslation(java.lang.String[] originalText,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
java.lang.String[] updatedTranslation,
TranslationConstants.ContentType contentType,
java.lang.String contentCategory,
java.lang.String userId,
int rating,
java.lang.String path)
Updates an array of translations in the Translation Memory engine.
|
void |
storeTranslation(java.lang.String originalText,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
java.lang.String updatedTranslation,
TranslationConstants.ContentType contentType,
java.lang.String contentCategory,
java.lang.String userId,
int rating,
java.lang.String path)
Updates a translation in the Translation Memory engine.
|
java.util.Map<java.lang.String,java.lang.String> |
supportedLanguages()
Returns the full list of supported language codes for this service.
|
TranslationResult[] |
translateArray(java.lang.String[] sourceStringArr,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
TranslationConstants.ContentType contentType,
java.lang.String contentCategory)
Translates all strings in a given String Array and returns the best fit (highest rated) translations.
|
TranslationResult |
translateString(java.lang.String sourceString,
java.lang.String sourceLanguage,
java.lang.String targetLanguage,
TranslationConstants.ContentType contentType,
java.lang.String contentCategory)
Translates a given String and returns the best fit (highest rated) translation.
|
void |
updateDueDate(java.lang.String strTranslationJobID,
java.util.Date date)
Update translation job due-date
|
void |
updateTranslationJobMetadata(java.lang.String strTranslationJobID,
TranslationMetadata jobMetadata,
TranslationConstants.TranslationMethod translationMethod)
Update translation job metadata.
|
TranslationConstants.TranslationStatus |
updateTranslationJobState(java.lang.String strTranslationJobID,
TranslationState state)
Update the Translation Job state.
|
TranslationConstants.TranslationStatus[] |
updateTranslationObjectsState(java.lang.String strTranslationJobID,
TranslationObject[] translationObjects,
TranslationState[] states)
Update the state for an array of translation Objects.
|
TranslationConstants.TranslationStatus |
updateTranslationObjectState(java.lang.String strTranslationJobID,
TranslationObject translationObject,
TranslationState state)
Allows the user to update the state for a unique Translation Object.
|
java.lang.String |
uploadTranslationObject(java.lang.String strTranslationJobID,
TranslationObject translationObject)
Uploads the Translation Object to the Translation Service Provider.
|
java.util.Map<java.lang.String,java.lang.String> supportedLanguages()
Map<String, String>
containing the full list of supported languages and their English names.boolean isDirectionSupported(java.lang.String sourceLanguage, java.lang.String targetLanguage) throws TranslationException
sourceLanguage
- The language code to be translated fromtargetLanguage
- The language code to be translated toTranslationException
- the translation exceptionjava.lang.String detectLanguage(java.lang.String detectSource, TranslationConstants.ContentType contentType) throws TranslationException
detectSource
- The content to determine the language ofcontentType
- The content type of the source (@see TranslationConstants.ContentTypes)TranslationException
- the translation exceptionTranslationResult translateString(java.lang.String sourceString, java.lang.String sourceLanguage, java.lang.String targetLanguage, TranslationConstants.ContentType contentType, java.lang.String contentCategory) throws TranslationException
sourceString
- The string to be translatedsourceLanguage
- (optional) The string representing the FROM language code. This allows a NULL value to be
passed. If NULL, the source language is determined by leveraging the "detectLanguage" function. A
TranslationException with ErrorCode UNKNOWN_LANGUAGE will be thrown if it cannot be determined.targetLanguage
- The string representing the TO language code.contentType
- The content type of the source (@see TranslationConstants.ContentTypes)contentCategory
- (optional) The content category of the source (@see TranslationConstants.Categories)
This will use the default value if NULL or blank is passed.TranslationException
- the translation exceptionTranslationResult[] translateArray(java.lang.String[] sourceStringArr, java.lang.String sourceLanguage, java.lang.String targetLanguage, TranslationConstants.ContentType contentType, java.lang.String contentCategory) throws TranslationException
sourceStringArr
- An Array of Strings to be translatedsourceLanguage
- (optional) The string representing the FROM language code. This allows a NULL value to be
passed. If NULL, the source language is determined by leveraging the "detectLanguage" function. A
TranslationException with ErrorCode UNKNOWN_LANGUAGE will be thrown if it cannot be determined.
NOTE: Only the first array position will be used to determine a NULL or blank FROM value.targetLanguage
- The string representing the TO language code.contentType
- The content type of the source (@see TranslationConstants.ContentTypes)contentCategory
- (optional) The content category of the source (@see TranslationConstants.Categories)
This will use the default value if NULL or blank is passed.TranslationException
- the translation exceptionTranslationResult[] getAllStoredTranslations(java.lang.String sourceString, java.lang.String sourceLanguage, java.lang.String targetLanguage, TranslationConstants.ContentType contentType, java.lang.String contentCategory, java.lang.String userId, int maxTranslations) throws TranslationException
sourceString
- The string to be translatedsourceLanguage
- (optional) The string representing the FROM language code. This allows a NULL value to be
passed. If NULL, the source language is determined by leveraging the "detectLanguage" function. A
TranslationException with ErrorCode UNKNOWN_LANGUAGE will be thrown if it cannot be determined.targetLanguage
- The string representing the TO language code.contentType
- The content type of the source (@see TranslationConstants.ContentTypes)contentCategory
- (optional) The content category of the source (@see TranslationConstants.Categories)
This will use the default value if NULL or blank is passed.userId
- (optional) filters the results specific to a passed in UsermaxTranslations
- (optional) Specifies the maximum number of translation response Strings in array. If not
specified ALL available translations will be returned.TranslationException
- the translation exceptionvoid storeTranslation(java.lang.String originalText, java.lang.String sourceLanguage, java.lang.String targetLanguage, java.lang.String updatedTranslation, TranslationConstants.ContentType contentType, java.lang.String contentCategory, java.lang.String userId, int rating, java.lang.String path) throws TranslationException
originalText
- The string that was originally translated. This can be only one sentence.sourceLanguage
- The string representing the locale that was translated from (source) This accepts all
acceptable locale strings (2 and 5 char versions) Example: en, en_us, en-us, en_UStargetLanguage
- The string representing the locale that was translated to (destination) This accepts all
acceptable locale strings (2 and 5 char versions) Example: en, en_us, en-us, en_USupdatedTranslation
- The string representing the updated text after an editor reviewed and modifiedcontentType
- The content type of the source (@see TranslationConstants.ContentTypes)contentCategory
- (optional) The Content Category @see TranslationConstants.CategoriesuserId
- The user who modified the translationrating
- (optional) A number representing the "quality" rating of the new translation. The scale is from
-n .. +n with 0 being the default setting for translation quality.path
- (optional) Path to the node containing the translated contentTranslationException
- the translation exceptionvoid storeTranslation(java.lang.String[] originalText, java.lang.String sourceLanguage, java.lang.String targetLanguage, java.lang.String[] updatedTranslation, TranslationConstants.ContentType contentType, java.lang.String contentCategory, java.lang.String userId, int rating, java.lang.String path) throws TranslationException
originalText
- An array of the original text that was translatedsourceLanguage
- The string representing the locale that was translated from (source) This accepts all
acceptable locale strings (2 and 5 char versions) Example: en, en_us, en-us, en_UStargetLanguage
- The string representing the locale that was translated to (destination) This accepts all
acceptable locale strings (2 and 5 char versions) Example: en, en_us, en-us, en_USupdatedTranslation
- An array of strings containing the updated translations, this must be in the same
order as the originalText array (originalText[1] is the original text of translated string
updatedTranslation[1]). Thus originalText .length must == updatedTranslation.length or an exception
will be thrown.contentType
- The content type of the source (@see TranslationConstants.ContentTypes)contentCategory
- (optional) The Content Category @see TranslationConstants.CategoriesuserId
- The user who modified the translationrating
- (optional) A number representing the "quality" rating of the new translation. The scale is from
-n .. +n with 0 being the default setting for translation quality.path
- (optional) Path to the node containing the translated contentTranslationException
- the translation exceptionjava.lang.String getDefaultCategory()
void setDefaultCategory(java.lang.String defaultCategory)
defaultCategory
- The string representing the category which will be set as the default. This is the value
the TranslationService will use if no category is specified elsewhere.TranslationService.TranslationServiceInfo getTranslationServiceInfo()
java.lang.String createTranslationJob(java.lang.String name, java.lang.String description, java.lang.String strSourceLanguage, java.lang.String strTargetLanguage, java.util.Date dueDate, TranslationState state, TranslationMetadata jobMetadata) throws TranslationException
name
- of translation jobdescription
- descriptionstrTargetLanguage
- the target language into which a project will be translatedstrSourceLanguage
- source language of the Translation Job.dueDate
- due date when this Translation Job need to be translatedstate
- current state of translation jobjobMetadata
- metadata for translation jobTranslationException
- the translation exceptionvoid updateTranslationJobMetadata(java.lang.String strTranslationJobID, TranslationMetadata jobMetadata, TranslationConstants.TranslationMethod translationMethod) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationjobMetadata
- metadata for translation jobtranslationMethod
- translation MethodTranslationException
- the translation exceptionjava.lang.String uploadTranslationObject(java.lang.String strTranslationJobID, TranslationObject translationObject) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationtranslationObject
- the unique thing to be translatedTranslationException
- the translation exceptionTranslationScope getFinalScope(java.lang.String strTranslationJobID) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationTranslationException
TranslationConstants.TranslationStatus updateTranslationJobState(java.lang.String strTranslationJobID, TranslationState state) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationstate
- the stateTranslationException
- the translation exceptionTranslationConstants.TranslationStatus getTranslationJobStatus(java.lang.String strTranslationJobID) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationTranslationException
- the translation exceptionCommentCollection<Comment> getTranslationJobCommentCollection(java.lang.String strTranslationJobID) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationTranslationException
void addTranslationJobComment(java.lang.String strTranslationJobID, Comment comment) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationcomment,
- Comments attached to the translation Object, a form of Object metadataTranslationException
- the translation exceptionjava.io.InputStream getTranslatedObject(java.lang.String strTranslationJobID, TranslationObject translationObject) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationtranslationObject
- The translation ObjectTranslationException
- the translation exceptionTranslationConstants.TranslationStatus updateTranslationObjectState(java.lang.String strTranslationJobID, TranslationObject translationObject, TranslationState state) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationtranslationObject
- The translation Objectstate
- the stateTranslationException
- the translation exceptionTranslationConstants.TranslationStatus getTranslationObjectStatus(java.lang.String strTranslationJobID, TranslationObject translationObject) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationtranslationObject
- The translation ObjectTranslationException
- the translation exceptionTranslationConstants.TranslationStatus[] updateTranslationObjectsState(java.lang.String strTranslationJobID, TranslationObject[] translationObjects, TranslationState[] states) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationtranslationObjects
- array of translation objectsstates
- the statesTranslationException
- the translation exceptionTranslationConstants.TranslationStatus[] getTranslationObjectsStatus(java.lang.String strTranslationJobID, TranslationObject[] translationObjects) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationtranslationObjects
- array of translation objectsTranslationException
- the translation exceptionCommentCollection<Comment> getTranslationObjectCommentCollection(java.lang.String strTranslationJobID, TranslationObject translationObject) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationtranslationObject
- The translation ObjectTranslationException
void addTranslationObjectComment(java.lang.String strTranslationJobID, TranslationObject translationObject, Comment comment) throws TranslationException
strTranslationJobID
- job id, which was returned on translation job creationtranslationObject
- The translation Objectcomment,
- Comments attached to the translation Object, a form of Object metadataTranslationException
- the translation exceptionvoid updateDueDate(java.lang.String strTranslationJobID, java.util.Date date) throws TranslationException
strTranslationJobID
- Translation Job IDdate
- Due dateTranslationException
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"