Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Translation.TranslateString

Translates a single string of text.

Component Version macOS Windows Linux Server iOS SDK
Translation 16.0 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "Translation.TranslateString"; SessionID; Text )   More

Parameters

Parameter Description Example
SessionID The translation session. $session
Text The text to translate. "Hello World"

Result

Returns text or error.

Description

Translates a single string of text.
This function translates a single line of text and might display different UI depending on the state of the translation. The required languages for translation don't have to be installed before calling this method.

If the required languages for translation have already downloaded and the source language is clear, this function returns results without showing any UI to the person.

If the source or target language aren't installed, the framework asks the person for permission to download the languages. During the download a progress indicator displays. After it completes, the framework performs the translation.

If the sourceLanguage is empty and the framework can't detect the source language from the content, the framework prompts the person to choose the source language.

This function throws an error if:
  • The person doesn't agree to downloading the languages
  • The person dismisses the progress view during language downloads
  • TranslationSession fails system validation
  • The session doesn't allow requesting downloads and languages aren't installed
  • You already cancelled the session
  • Something goes wrong during translation

If a person dismisses the progress view while the languages download, the system throws a user cancelled error, and the languages continue to download in the background.

Note: This function call can take several minutes while languages download.

Examples

Translate text:

Let([
    session = MBS( "Translation.StartSession"; "de"; "en");
    text = MBS( "Translation.TranslateString"; session; "Hallo Leute");
    r = MBS("Translation.Release"; session)
]; text)

Example result: Hallo Leute

See also

Example Databases

Blog Entries

This function checks for a license.

Created 24th November 2025, last changed 14th December 2025


Translation.TargetLanguage - Translation.Translations