Apex classes
This page provides information about the globally exposed Apex classes in that you can reference and use.
Translator Interface
The Translator (CT_ITranslator) global Apex interface exposes the
methods for configuring the data and/or content translation service for
the integrated language translation
feature. The translation service is also known as a
vendor.
global interface CT_ITranslator
Method(s)
getSupportedLanguages(sourceLanguage)
Set<String> getSupportedLanguages(String sourceLanguage)
Description This method defines the set of languages that are supported by the translation vendor.
| Returns | The set of ISO codes of the multiple languages that are supported for the given source language. |
|---|
| Parameter | Type | Description |
|---|---|---|
| sourceLanguage | String | The ISO code of the source language. |
isSupportedMimeType(mimeType)
Boolean isSupportedMimeType(String mimeType)
Description This method checks if the translation vendor supports a given file type and therefore if the translation vendor can translate a given document.
| Returns | true if the translation vendor supports the MIME type and false otherwise. |
|---|
| Parameter | Type | Description |
|---|---|---|
| mimeType | String | The MIME or file type of the document to be translated. |
isValidLanguage()
Boolean isValidLanguage()
Description This method validates the source and target languages.
| Returns | true if the languages are valid and false otherwise. |
|---|
setSourceLanguage(source)
CT_ITranslator setSourceLanguage(String source)
Description This method sets a source language for a translation.
| Returns | The CT_ITranslator instance. |
|---|
| Parameter | Type | Description |
|---|---|---|
| source | String | The ISO code for the source language. |
setTargetLanguage(target)
CT_ITranslator setTargetLanguage(String target)
Description This method sets a target language for a translation.
| Returns | The CT_ITranslator instance. |
|---|
| Parameter | Type | Description |
|---|---|---|
| target | String | The ISO code for the target language. |
translate(request)
void translate(CT_Request__c request)
Description This method runs the translation request.
| Returns | void |
|---|
| Parameter | Type | Description |
|---|---|---|
| request | CT_Request__c | The Translation Request (mvn__CT_Request__c) record that stores the translation request. |