Class
TextFilterTranslatedResult
NotCreatableNotReplicated
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#
SourceLanguagestring | The language of the original text that was filtered.ReadSafeReadOnlyNotReplicated |
SourceTextTextFilterResult | The 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#
| GetTranslationForLocale | Returns the filtered translation of the source text for the given locale. |
| GetTranslations | Returns 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.
| Name | Type | Default | Description |
|---|---|---|---|
locale | string | The locale identifier of the translation to retrieve. |
Returns
TextFilterResult— The filteredTextFilterResultfor the requested locale, ornilif the result contains no translation for it.
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 filteredTextFilterResult.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild