Roblox UtilitiesDevlHub Roblox Documentation

Class

TextFilterTranslatedResult

NotCreatableNotReplicated
Inherits
Instance › Object
Memory category
Instances

Holds the filtered source text and its filtered translations produced by TextService:FilterAndTranslateStringAsync().

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#

SourceLanguagestringThe language of the original text that was filtered.ReadSafeReadOnlyNotReplicated
SourceTextTextFilterResultThe filtered form of the original, untranslated text.ReadSafeReadOnlyNotReplicated

SourceLanguage: string#

ReadOnlyNotReplicatedReadSafe

The language string of the original text that was submitted to TextService:FilterAndTranslateStringAsync(). This is the source language that the translations returned by TextFilterTranslatedResult:GetTranslations() were translated from. This property is read-only.

SourceText: TextFilterResult#

ReadOnlyNotReplicatedReadSafe

A TextFilterResult representing the filtered form of the original text that was submitted to TextService:FilterAndTranslateStringAsync(), in its TextFilterTranslatedResult.SourceLanguage. Use the returned TextFilterResult to obtain the correctly filtered string for each recipient before displaying the untranslated text. This property is read-only.

Methods 2#

GetTranslationForLocaleReturns the filtered translation of the source text for the given locale.
GetTranslationsReturns all filtered translations of the source text, keyed by language.

GetTranslationForLocale(locale: string): TextFilterResult#

Returns the filtered TextFilterResult for the translation of the source text into locale, or nil if the result contains no translation for that locale. The locale argument is normalized to its language before lookup, so locale variants that share a language resolve to the same translation.

NameTypeDefaultDescription
localestringThe locale identifier of the translation to retrieve.
Returns

GetTranslations(): Dictionary#

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; use TextFilterTranslatedResult:GetTranslationForLocale() to look up a single locale directly.

Returns
  • Dictionary — A dictionary mapping each translation's language string to its filtered TextFilterResult.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed