TextFilterTranslatedResult
Holds the filtered source text and its filtered translations produced by TextService:FilterAndTranslateStringAsync().
| Memory category | Instances |
|---|
Member index 4
Description
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.
History 9
- 731 Change Default of SourceText from to
- 731 Change Default of SourceLanguage from to
- 726 Change Default of SourceText from to
- 726 Change Default of SourceLanguage from to
- 578 Add GetTranslationForLocale
- 576 Add GetTranslations
- 576 Add SourceText
- 576 Add SourceLanguage
- 576 Add TextFilterTranslatedResult
Members 4
GetTranslationForLocale
| Parameters (1) | ||
|---|---|---|
| locale | string | |
| Returns (1) | ||
| 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.
| Thread safety | Unsafe |
|---|
History 1
GetTranslations
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| 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.
| Thread safety | Unsafe |
|---|
History 1
- 576 Add GetTranslations
SourceLanguage
| Type | Default | |
|---|---|---|
| string | ||
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.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | false |
History 3
- 731 Change Default of SourceLanguage from to
- 726 Change Default of SourceLanguage from to
- 576 Add SourceLanguage
SourceText
| Type | Default | |
|---|---|---|
| TextFilterResult | ||
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.
| Thread safety | ReadSafe |
|---|---|
| Category | Data |
| Loaded/Saved | false |
History 3
- 731 Change Default of SourceText from to
- 726 Change Default of SourceText from to
- 576 Add SourceText