Class · inherits Instance
TextFilterTranslatedResult
Holds the filtered source text and its filtered translations produced by
TextService.FilterAndTranslateStringAsync.
About TextFilterTranslatedResult
A TextFilterTranslatedResult is the object returned by
TextService.FilterAndTranslateStringAsync. It bundles the filtered
source text together with filtered translations of that text into each
requested target locale.
Read TextFilterTranslatedResult.SourceText and
TextFilterTranslatedResult.SourceLanguage for the filtered original
text and its language, call
TextFilterTranslatedResult.GetTranslationForLocale to retrieve the
filtered translation for a single locale, or call
TextFilterTranslatedResult.GetTranslations to retrieve all of them
at once.
Instances of this class cannot be created, parented, or replicated; they are
only produced by the engine as the return value of the filtering call. That
call, TextService.FilterAndTranslateStringAsync, is deprecated, so
new work should filter and translate chat through TextChatService
instead.
Properties 2
SourceLanguage
: stringReadOnlyNotReplicatedThe language of the original text that was filtered.The language string of the original text that was submitted to
TextService.FilterAndTranslateStringAsync. This is the source language that the translations returned byTextFilterTranslatedResult.GetTranslationswere translated from. This property is read-only.SourceText
: TextFilterResultReadOnlyNotReplicatedThe filtered form of the original, untranslated text.A
TextFilterResultrepresenting the filtered form of the original text that was submitted toTextService.FilterAndTranslateStringAsync, in itsTextFilterTranslatedResult.SourceLanguage. Use the returnedTextFilterResultto obtain the correctly filtered string for each recipient before displaying the untranslated text. This property is read-only.
Methods 2
GetTranslationForLocale
(locale: string) → TextFilterResultReturns the filtered translation of the source text for the given locale.Returns the filtered
TextFilterResultfor the translation of the source text intolocale, ornilif the result contains no translation for that locale. Thelocaleargument is normalized to its language before lookup, so locale variants that share a language resolve to the same translation.GetTranslations
() → DictionaryReturns all filtered translations of the source text, keyed by language.Returns a dictionary that maps each translation's language string to its filtered
TextFilterResult. The keys are the languages that the source text was translated into for the requested target locales; useTextFilterTranslatedResult.GetTranslationForLocaleto look up a single locale directly.
TextFilterTranslatedResult also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.