TranslationDomain
Catalog set with independent locale selection and pseudolocalization settings.
A RefCounted object rather than Resource or Entity. A new domain is enabled, empty and not automatically connected to TranslationServer or UI. AddTranslation retains resource references: re-adding the same object is idempotent, while distinct resources of one locale are allowed. GetTranslations returns a separate container holding the same objects; do not dispose returned elements as newly owned resources. Dispose an owned domain after use.
Translate searches for a nonempty message using the override or current server locale, then the server fallback locale, within catalogs registered in this domain. A more specific locale is preferred per message, while a missing entry permits a less specific matching catalog. Equal-score candidate order is unspecified: use nonoverlapping keys rather than AddTranslation ordering. Empty translations count as misses.
On a miss, Translate returns the source key; TranslatePlural chooses source singular only at n==1 and source plural otherwise. Enabled=false bypasses catalogs and automatic pseudolocalization. In SDK 1.0.0 automatic pseudolocalization applies only to Translate: TranslatePlural does not apply it even to a found translation. Explicitly Pseudolocalize the returned text when required.
FindTranslations and HasTranslationForLocale with exact=true compare locale text literally: ru-RU differs from stored ru_RU. exact=false uses CompareLocales and returns all matching catalogs rather than just the best. Domain settings do not automatically recreate existing UI text. Windows headless checks covered lookup, fallback, references, container copies and string transforms; real RTL layout, UI refresh, all languages and equal-score priority were not tested.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
TranslationDomainConstructor
public TranslationDomain();Creates an owned enabled domain without catalogs or a locale override. Automatic pseudolocalization is off, accents/placeholder skipping on, wrappers are square brackets and ratio=0. Registers the domain with neither server nor UI. Dispose after use.
Properties10
EnabledProperty
public bool Enabled { get; set; }Enables Translate/TranslatePlural lookup, default true. false returns the source key or singular/plural at n==1, bypassing catalogs and automatic pseudolocalization. Does not block explicit Pseudolocalize or clear resources.
PseudolocalizationAccentsEnabledProperty
public bool PseudolocalizationAccentsEnabled { get; set; }Replaces ASCII letters using a built-in accent table, default true. Not a language translation; some replacements contain multiple code points. Runs after vowel doubling and before fake bidi/wrapping. Does not automatically refresh UI.
PseudolocalizationDoubleVowelsEnabledProperty
public bool PseudolocalizationDoubleVowelsEnabled { get; set; }Doubles ASCII a/e/i/o/u in both cases, default false. Does not double all vowels of every language. Runs before accents and can skip recognized placeholders. Does not refresh existing labels.
PseudolocalizationEnabledProperty
public bool PseudolocalizationEnabled { get; set; }Automatically transforms the Translate result, default false. Does not affect TranslatePlural in the current implementation. Explicit Pseudolocalize works regardless of this flag. Changing it does not refresh already assigned UI text.
PseudolocalizationExpansionRatioProperty
public float PseudolocalizationExpansionRatio { get; set; }Additional underscore-padding ratio, default 0. Each side gets the integer part of originalLength*ratio/2, so a short string may not grow. Uses pre-transform input length rather than pixel width. The setter does not clamp; supply a finite nonnegative reasonably bounded value.
PseudolocalizationFakeBidiEnabledProperty
public bool PseudolocalizationFakeBidiEnabled { get; set; }Adds U+202E/U+202C controls around text and individual lines, default false; recognized placeholders are placed outside those spans. A diagnostic transform rather than real RTL translation or automatic UI mirroring. Test real-language shaping and layout separately.
PseudolocalizationOverrideEnabledProperty
public bool PseudolocalizationOverrideEnabled { get; set; }Replaces code points with asterisks, default false, except recognized skipped placeholders. Runs before vowel doubling and accents. Helps find strings bypassing localization; not a secret-data masking facility.
PseudolocalizationPrefixProperty
public string PseudolocalizationPrefix { get; set; }Literal text before transformed nonempty content and left padding, default [. Not looked up in catalogs or extended with a locale name. Empty input receives no wrapping.
PseudolocalizationSkipPlaceholdersEnabledProperty
public bool PseudolocalizationSkipPlaceholdersEnabled { get; set; }Preserves recognized two-character placeholders %s, %c, %d, %o, %x, %X and %f during domain transformations. Does not protect C# {0} or a width specifier such as %02d.
PseudolocalizationSuffixProperty
public string PseudolocalizationSuffix { get; set; }Literal text after transformed nonempty content and right padding, default ]. Not looked up in catalogs. Empty input receives no wrapping.
Methods33
AddTranslationvoid
public void AddTranslation(Translation translation);Adds a Translation to this domain. Does not automatically add it to the main game domain or assign a domain to UI objects.
| Name | Type | Default |
|---|---|---|
translation | Translation | — |
translationNon-null Translation with the intended Locale and messages. The example adds separate en and ru resources.
Clearvoid
public void Clear();Removes all domain catalog references. Retains Enabled, locale override and all pseudolocalization settings; clears no messages inside the resources.
FindTranslationsReckfell.Collections.Array<Translation>
public Reckfell.Collections.Array<Translation> FindTranslations(string locale, bool exact);Returns a separate Array<Translation> of all matching resources. exact=true compares locale literally without standardization; false selects every CompareLocales>0 match. Does not sort by specificity, search for a message or add the server fallback locale. Elements are shared resources rather than copies.
| Name | Type | Default |
|---|---|---|
locale | string | — |
exact | bool | — |
localeLocale such as ru_RU. Standardize first for exact=true; SetLocaleOverride normalizes nonempty input and clears the override for empty input.
exacttrue for literal Locale equality; false for any positive CompareLocales match rather than just the best candidate.
Reckfell.Collections.Array<Translation>New container of shared Translation objects; empty when none match.
GetLocaleOverridestring
public string GetLocaleOverride();Reads the domain's explicit locale override. This lets a tool follow editor language without changing global project locale.
stringNonempty override or an empty string to follow TranslationServer locale.
GetPseudolocalizationExpansionRatiofloat
public float GetPseudolocalizationExpansionRatio();Reads PseudolocalizationExpansionRatio. Additional underscore-padding ratio, default 0. Each side gets the integer part of originalLength*ratio/2, so a short string may not grow. Uses pre-transform input length rather than pixel width. The setter does not clamp; supply a finite nonnegative reasonably bounded value.
floatStored PseudolocalizationExpansionRatio value rather than proof of refreshed layout.
GetPseudolocalizationPrefixstring
public string GetPseudolocalizationPrefix();Reads PseudolocalizationPrefix. Literal text before transformed nonempty content and left padding, default [. Not looked up in catalogs or extended with a locale name. Empty input receives no wrapping.
stringStored PseudolocalizationPrefix value rather than proof of refreshed layout.
GetPseudolocalizationSuffixstring
public string GetPseudolocalizationSuffix();Reads PseudolocalizationSuffix. Literal text after transformed nonempty content and right padding, default ]. Not looked up in catalogs. Empty input receives no wrapping.
stringStored PseudolocalizationSuffix value rather than proof of refreshed layout.
GetTranslationObjectTranslation · Deprecated
public Translation GetTranslationObject(string locale);Obsolete SDK method returning one best-matching resource or null; equal-score order is unspecified. Searches for no specific message and promises no fallback-locale resource. Use FindTranslations with explicit exact for a list and Translate/TranslatePlural for lookup. The returned resource is shared.
| Name | Type | Default |
|---|---|---|
locale | string | — |
localeLocale such as ru_RU. Standardize first for exact=true; SetLocaleOverride normalizes nonempty input and clears the override for empty input.
TranslationOne shared resource or null; obsolete API without equal-score selection guarantees.
GetTranslationsReckfell.Collections.Array<Translation>
public Reckfell.Collections.Array<Translation> GetTranslations();Returns a separate Array<Translation> container of all added resources without an ordering guarantee. Clearing the array changes no domain membership; editing an element changes the shared resource. Do not dispose elements as newly created objects.
Reckfell.Collections.Array<Translation>New shared-resource container without sorted-order or priority guarantees.
HasTranslationbool
public bool HasTranslation(Translation translation);Tests membership of the same Translation object rather than matching Locale or contents. An empty catalog can also be registered.
| Name | Type | Default |
|---|---|---|
translation | Translation | — |
translationNon-null Translation object; membership/removal uses object identity.
booltrue only when that object is present.
HasTranslationForLocalebool
public bool HasTranslationForLocale(string locale, bool exact);Tests whether at least one catalog matches the locale. exact=true is literal comparison; false uses CompareLocales>0. Tests neither a message key, catalog population nor fallback.
| Name | Type | Default |
|---|---|---|
locale | string | — |
exact | bool | — |
localeLocale such as ru_RU. Standardize first for exact=true; SetLocaleOverride normalizes nonempty input and clears the override for empty input.
exacttrue for literal Locale equality; false for any positive CompareLocales match rather than just the best candidate.
booltrue for a matching locale even if the needed message is absent.
IsEnabledbool
public bool IsEnabled();Reads Enabled. Enables Translate/TranslatePlural lookup, default true. false returns the source key or singular/plural at n==1, bypassing catalogs and automatic pseudolocalization. Does not block explicit Pseudolocalize or clear resources.
boolStored Enabled value rather than proof of refreshed layout.
IsPseudolocalizationAccentsEnabledbool
public bool IsPseudolocalizationAccentsEnabled();Reads PseudolocalizationAccentsEnabled. Replaces ASCII letters using a built-in accent table, default true. Not a language translation; some replacements contain multiple code points. Runs after vowel doubling and before fake bidi/wrapping. Does not automatically refresh UI.
boolStored PseudolocalizationAccentsEnabled value rather than proof of refreshed layout.
IsPseudolocalizationDoubleVowelsEnabledbool
public bool IsPseudolocalizationDoubleVowelsEnabled();Reads PseudolocalizationDoubleVowelsEnabled. Doubles ASCII a/e/i/o/u in both cases, default false. Does not double all vowels of every language. Runs before accents and can skip recognized placeholders. Does not refresh existing labels.
boolStored PseudolocalizationDoubleVowelsEnabled value rather than proof of refreshed layout.
IsPseudolocalizationEnabledbool
public bool IsPseudolocalizationEnabled();Reads PseudolocalizationEnabled. Automatically transforms the Translate result, default false. Does not affect TranslatePlural in the current implementation. Explicit Pseudolocalize works regardless of this flag. Changing it does not refresh already assigned UI text.
boolStored PseudolocalizationEnabled value rather than proof of refreshed layout.
IsPseudolocalizationFakeBidiEnabledbool
public bool IsPseudolocalizationFakeBidiEnabled();Reads PseudolocalizationFakeBidiEnabled. Adds U+202E/U+202C controls around text and individual lines, default false; recognized placeholders are placed outside those spans. A diagnostic transform rather than real RTL translation or automatic UI mirroring. Test real-language shaping and layout separately.
boolStored PseudolocalizationFakeBidiEnabled value rather than proof of refreshed layout.
IsPseudolocalizationOverrideEnabledbool
public bool IsPseudolocalizationOverrideEnabled();Reads PseudolocalizationOverrideEnabled. Replaces code points with asterisks, default false, except recognized skipped placeholders. Runs before vowel doubling and accents. Helps find strings bypassing localization; not a secret-data masking facility.
boolStored PseudolocalizationOverrideEnabled value rather than proof of refreshed layout.
IsPseudolocalizationSkipPlaceholdersEnabledbool
public bool IsPseudolocalizationSkipPlaceholdersEnabled();Reads PseudolocalizationSkipPlaceholdersEnabled. Preserves two-character %s/%c/%d/%o/%x/%X/%f placeholders during transforms, default true. Does not protect C# {0}, named or extended printf placeholders such as %02d.
boolStored PseudolocalizationSkipPlaceholdersEnabled value rather than proof of refreshed layout.
PseudolocalizeStringName
public StringName Pseudolocalize(StringName message);Explicitly transforms the supplied string using pseudolocalization settings for this domain. Works even when PseudolocalizationEnabled is false. Does not look up a translation; placeholder skipping does not recognize C# composite format {0}.
| Name | Type | Default |
|---|---|---|
message | StringName | — |
messageText to transform; look up the translation first if needed.
StringNameTransformed text with configured wrappers and padding; empty input remains empty.
RemoveTranslationvoid
public void RemoveTranslation(Translation translation);Removes the specific Translation object rather than every catalog of its locale. Repeated removal is a no-op; external resource references remain.
| Name | Type | Default |
|---|---|---|
translation | Translation | — |
translationNon-null Translation object; membership/removal uses object identity.
SetEnabledvoid
public void SetEnabled(bool enabled);Sets Enabled. Enables Translate/TranslatePlural lookup, default true. false returns the source key or singular/plural at n==1, bypassing catalogs and automatic pseudolocalization. Does not block explicit Pseudolocalize or clear resources.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew Enabled value. Not a command to refresh already assigned UI text.
SetLocaleOverridevoid
public void SetLocaleOverride(string locale);Selects this domain's locale, standardizing a nonempty value. Does not change global project locale or promise to recreate every previously computed UI caption.
| Name | Type | Default |
|---|---|---|
locale | string | — |
localeLocale such as ru or en; an empty string clears the override. The addon example supplies GetEditorLanguage on activation.
SetPseudolocalizationAccentsEnabledvoid
public void SetPseudolocalizationAccentsEnabled(bool enabled);Sets PseudolocalizationAccentsEnabled. Replaces ASCII letters using a built-in accent table, default true. Not a language translation; some replacements contain multiple code points. Runs after vowel doubling and before fake bidi/wrapping. Does not automatically refresh UI.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew PseudolocalizationAccentsEnabled value. Not a command to refresh already assigned UI text.
SetPseudolocalizationDoubleVowelsEnabledvoid
public void SetPseudolocalizationDoubleVowelsEnabled(bool enabled);Sets PseudolocalizationDoubleVowelsEnabled. Doubles ASCII a/e/i/o/u in both cases, default false. Does not double all vowels of every language. Runs before accents and can skip recognized placeholders. Does not refresh existing labels.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew PseudolocalizationDoubleVowelsEnabled value. Not a command to refresh already assigned UI text.
SetPseudolocalizationEnabledvoid
public void SetPseudolocalizationEnabled(bool enabled);Sets PseudolocalizationEnabled. Automatically transforms the Translate result, default false. Does not affect TranslatePlural in the current implementation. Explicit Pseudolocalize works regardless of this flag. Changing it does not refresh already assigned UI text.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew PseudolocalizationEnabled value. Not a command to refresh already assigned UI text.
SetPseudolocalizationExpansionRatiovoid
public void SetPseudolocalizationExpansionRatio(float ratio);Sets PseudolocalizationExpansionRatio. Additional underscore-padding ratio, default 0. Each side gets the integer part of originalLength*ratio/2, so a short string may not grow. Uses pre-transform input length rather than pixel width. The setter does not clamp; supply a finite nonnegative reasonably bounded value.
| Name | Type | Default |
|---|---|---|
ratio | float | — |
ratioFinite nonnegative bounded padding ratio such as 0.3; the setter does not clamp it.
SetPseudolocalizationFakeBidiEnabledvoid
public void SetPseudolocalizationFakeBidiEnabled(bool enabled);Sets PseudolocalizationFakeBidiEnabled. Adds U+202E/U+202C controls around text and individual lines, default false; recognized placeholders are placed outside those spans. A diagnostic transform rather than real RTL translation or automatic UI mirroring. Test real-language shaping and layout separately.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew PseudolocalizationFakeBidiEnabled value. Not a command to refresh already assigned UI text.
SetPseudolocalizationOverrideEnabledvoid
public void SetPseudolocalizationOverrideEnabled(bool enabled);Sets PseudolocalizationOverrideEnabled. Replaces code points with asterisks, default false, except recognized skipped placeholders. Runs before vowel doubling and accents. Helps find strings bypassing localization; not a secret-data masking facility.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew PseudolocalizationOverrideEnabled value. Not a command to refresh already assigned UI text.
SetPseudolocalizationPrefixvoid
public void SetPseudolocalizationPrefix(string prefix);Sets PseudolocalizationPrefix. Literal text before transformed nonempty content and left padding, default [. Not looked up in catalogs or extended with a locale name. Empty input receives no wrapping.
| Name | Type | Default |
|---|---|---|
prefix | string | — |
prefixLiteral wrapping text; empty is allowed. Not a translation key.
SetPseudolocalizationSkipPlaceholdersEnabledvoid
public void SetPseudolocalizationSkipPlaceholdersEnabled(bool enabled);Sets PseudolocalizationSkipPlaceholdersEnabled. Preserves two-character %s/%c/%d/%o/%x/%X/%f placeholders during transforms, default true. Does not protect C# {0}, named or extended printf placeholders such as %02d.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew PseudolocalizationSkipPlaceholdersEnabled value. Not a command to refresh already assigned UI text.
SetPseudolocalizationSuffixvoid
public void SetPseudolocalizationSuffix(string suffix);Sets PseudolocalizationSuffix. Literal text after transformed nonempty content and right padding, default ]. Not looked up in catalogs. Empty input receives no wrapping.
| Name | Type | Default |
|---|---|---|
suffix | string | — |
suffixLiteral wrapping text; empty is allowed. Not a translation key.
TranslateStringName
public StringName Translate(StringName message, StringName context = null);Looks up a message using domain override or project locale, then fallback. This is text lookup, not assignment to Label.Text or validation of rendered pixels.
| Name | Type | Default |
|---|---|---|
message | StringName | — |
context | StringName | null |
messageSource message key. Inspect settings becomes Проверить настройки for ru in the example.
contextOptional context distinguishing identical keys with different meanings; empty by default.
StringNameTranslated StringName, or source key when no translation exists. Enabled pseudolocalization additionally transforms the result.
TranslatePluralStringName
public StringName TranslatePlural(StringName message, StringName messagePlural, int n, StringName context = null);Looks up a form in a matching catalog then the server fallback locale, using rules from that Translation. On a miss or Enabled=false returns message only for n==1, otherwise messagePlural. The current implementation applies no pseudolocalization; call Pseudolocalize explicitly when needed. Inserts no count into the text.
| Name | Type | Default |
|---|---|---|
message | StringName | — |
messagePlural | StringName | — |
n | int | — |
context | StringName | null |
messageSource lookup key; for Pseudolocalize, already selected text to transform.
messagePluralPlural source form for fallback at n!=1; not a separate base Translation map key.
nNonnegative count for form selection; source fallback uses singular only at 1. The count is not inserted into text.
contextExact message context; null/default means empty.
StringNameFound form or source singular/plural without automatic pseudolocalization.