Skip to main content

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.

ReturnsThe set of ISO codes of the multiple languages that are supported for the given source language.
ParameterTypeDescription
sourceLanguageStringThe 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.

Returnstrue if the translation vendor supports the MIME type and false otherwise.
ParameterTypeDescription
mimeTypeStringThe MIME or file type of the document to be translated.
isValidLanguage()

Boolean isValidLanguage()


Description This method validates the source and target languages.

Returnstrue 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.

ReturnsThe CT_ITranslator instance.
ParameterTypeDescription
sourceStringThe ISO code for the source language.
setTargetLanguage(target)

CT_ITranslator setTargetLanguage(String target)


Description This method sets a target language for a translation.

ReturnsThe CT_ITranslator instance.
ParameterTypeDescription
targetStringThe ISO code for the target language.
translate(request)

void translate(CT_Request__c request)


Description This method runs the translation request.

Returnsvoid
ParameterTypeDescription
requestCT_Request__cThe Translation Request (mvn__CT_Request__c) record that stores the translation request.