<aside>
SimpleT Detect Language provides automatic language identification for Salesforce Flows and Apex code. It returns confidence scores and ranked language results to support content routing, workflow triggering, and multilingual processing.
</aside>
Use these guides to prepare your org before using SimpleT Detect Language:
Detection Engine
"ST Google Translate Default" – Google Cloud Translation."ST DeepL Default" – DeepL language detection."ST AWS Default" – Amazon Comprehend."ST AI Default" – AI-powered detection.List of Source Texts
["Hello, how are you today?"][{!email1Text}, {!email2Text}, {!email3Text}][{!$Record.Description}, {!$Record.Comments__c}]Each detection result includes details for each submitted text:
detectionResults[0].detected_lan[0].Languages[0].LanguageCode // primary language
detectionResults[0].detected_lan[0].Languages[0].Score // confidence score
detectionResults[0].detected_lan[0].TextIndex // which input text
Detection often returns several possible languages ranked by confidence:
Primary (highest confidence): {!detectionResults[0].detected_lan[0].Languages[0]}
Secondary: {!detectionResults[0].detected_lan[0].Languages[1]}
Tertiary: {!detectionResults[0].detected_lan[0].Languages[2]}
To use the ST_DetectLanguageInvocable class and its method, create a list of ST_DetectLanguageWrapper items with the required data.
For details on
ST_DetectLanguageWrapper, see the class section below.
// Create a list of text values whose language you want to detect.
List<String> texts = new List<String>();
// Add texts to the list.
texts.add('Hello');
texts.add('Help');
// Create the wrapper that holds all data for the language detection callout.
simpleT.ST_DetectLanguageWrapper stDetectLanguageWrapper =
new simpleT.ST_DetectLanguageWrapper();
// Add the prepared list of texts to the wrapper.
stDetectLanguageWrapper.texts = texts;
// Select the engine for language detection.
stDetectLanguageWrapper.engine = 'ST Google Translate Default';
// Invocable methods require a list of wrappers.
List<simpleT.ST_DetectLanguageWrapper> detectLanguageWrappers =
new List<simpleT.ST_DetectLanguageWrapper>();
detectLanguageWrappers.add(stDetectLanguageWrapper);
// Call the invocable method and pass the list of wrappers.
List<ST_DetectLanguageResponseWrapper> resultWrappers =
ST_DetectLanguageInvocable.stDetectLanguages(detectLanguageWrappers);

List<ST_DetectLanguageWrapper> parameter (see the wrapper section below).
ST_DetectLanguageResponseWrapper.Detected_lan items, each with a languageCode and score.
Scenario: Automatically route support tickets based on the customer's language.
Flow setup
ticketText = {!$Record.Description}.Scenario: Group survey responses by language.
responseText = {!$Record.Comments__c}.Scenario: Identify the language of incoming emails for appropriate auto-responses.
Scenario: Automatically classify uploaded documents by language.