reckfellENGINE

TranslationServer

Manages the game locale and message lookup in registered translations.

On this page
class TranslationServerReckfellSharp

Selects messages from registered Translation resources using the current and fallback locales. Translate returns the source key when no translation is found; key and context must match. TranslatePlural selects a plural form but does not format placeholders.

SetLocale changes the active locale and sends a translation-change notification. Recalculate custom computed text in the notification handler. The method does not persist the player preference. Loading a resource without AddTranslation or project registration does not include it in lookup.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties2

PseudolocalizationEnabledProperty
# PseudolocalizationEnabled
C#
public static bool PseudolocalizationEnabled { get; set; }

Main-domain automatic pseudolocalization state rather than named-domain state. The setter reloads remap resources and sends a translation-change notification even for the same value. Currently transforms Translate but not TranslatePlural. Explicit Pseudolocalize works independently of the flag.

SingletonProperty
# Singleton
C#
public static TranslationServerInstance Singleton { get; }

Borrowed engine-service instance shared by the static API. Normally use static TranslationServer calls. Do not create a replacement or call Free/Dispose on this instance.

Methods35

AddTranslationvoid
# AddTranslation
C#
public static void AddTranslation(Translation translation);

Adds a shared Translation resource to the main domain. Re-adding the same object is idempotent; another object of the same locale is allowed but equal-score priority is unspecified. Sends no notification to refresh existing UI text and adds nothing to named domains.

Parameters
NameTypeDefault
translationTranslation—
translation

Non-null shared Translation resource; registration/removal compares the object rather than just Locale.

Clearvoid
# Clear
C#
public static void Clear();

Clears only the main domain catalog set. Resets neither active locale, pseudolocalization settings nor named domains, and clears no Translation resource contents. A project-global action: remove only your own addon resources/domain for local cleanup.

CompareLocalesint
# CompareLocales
C#
public static int CompareLocales(string localeA, string localeB);

Compares locales: 10 for an exact or normalized equivalent match, a positive score for the same language, and 0 for different languages. This is similarity, not a check that a translation exists.

Parameters
NameTypeDefault
localeAstring—
localeBstring—
localeA

First locale in canonical form, for example ru_RU.

localeB

Second locale to compare, for example ru.

Returns int

Score from 0 to 10; a positive score does not establish resource availability or satisfy every script requirement.

FindTranslationsReckfell.Collections.Array<Translation>
# FindTranslations
C#
public static Reckfell.Collections.Array<Translation> FindTranslations(string locale, bool exact);

Returns a separate Array<Translation> container of matching main-domain catalogs. exact=true compares Locale literally without normalization; false selects all CompareLocales>0 matches. Does not sort by specificity, test for a message or include named domains. Elements are shared resources.

Parameters
NameTypeDefault
localestring—
exactbool—
locale

Locale identifier such as ru_RU. SetLocale and numeric methods require nonempty input; exact searches and numeric methods do not automatically normalize it.

exact

true for literal Locale comparison; false for all positive CompareLocales matches.

Returns Reckfell.Collections.Array<Translation>

New container of all matching shared main-domain catalogs without an order guarantee.

FormatNumberstring
# FormatNumber
C#
public static string FormatNumber(string number, string locale);

Transforms numeric-string characters for the locale numbering system. Looks up locale literally; standardize it first. For supported systems replaces digits, e/E and both period/comma with the separator. Does not format a numeric value, group digits, validate text or apply C# culture formatting. An unmapped numbering system passes input through. For ar, 12.5 becomes ١٢٫٥.

Parameters
NameTypeDefault
numberstring—
localestring—
number

Text rather than a numeric object. The method replaces characters without numeric validation; validate the result separately.

locale

Locale identifier such as ru_RU. SetLocale and numeric methods require nonempty input; exact searches and numeric methods do not automatically normalize it.

Returns string

Character-transformed text or original input for an unmapped key.

GetAllCountriesstring[]
# GetAllCountries
C#
public static string[] GetAllCountries();

Returns a new string[] of built-in country/region codes rather than the current country of the user. Order is unspecified; obtain labels with GetCountryName.

Returns string[]

New identifier array without a sorted-order guarantee; edits no underlying table.

GetAllLanguagesstring[]
# GetAllLanguages
C#
public static string[] GetAllLanguages();

Returns a new string[] of codes from the built-in language table. Independent of loaded catalogs, without sorted-order or project-translation-coverage guarantees. Map codes through GetLanguageName and sort separately for UI.

Returns string[]

New identifier array without a sorted-order guarantee; edits no underlying table.

GetAllScriptsstring[]
# GetAllScripts
C#
public static string[] GetAllScripts();

Returns a new string[] of built-in writing-system codes such as Latn. Neither programming languages nor installed font coverage; order is unspecified.

Returns string[]

New identifier array without a sorted-order guarantee; edits no underlying table.

GetCountryNamestring
# GetCountryName
C#
public static string GetCountryName(string country);

Finds a country/region label by exact table code such as US. Unknown codes pass through; performs no automatic case normalization or active-locale translation of labels.

Parameters
NameTypeDefault
countrystring—
country

Exact built-in table code; unknown input passes through.

Returns string

Table label or original unknown code.

GetLanguageNamestring
# GetLanguageName
C#
public static string GetLanguageName(string language);

Finds a language name by exact table code such as en. Unknown codes pass through unchanged. Names come from a built-in table and are not automatically translated by SetLocale; do not pass full ru_RU where ru is required.

Parameters
NameTypeDefault
languagestring—
language

Exact built-in table code; unknown input passes through.

Returns string

Table label or original unknown code.

GetLoadedLocalesstring[]
# GetLoadedLocales
C#
public static string[] GetLoadedLocales();

Returns the locales of resources registered in the main translation domain. Does not list every engine-known language or verify that every message is translated.

Returns string[]

Array of registered locales, which can be empty. Use GetAllLanguages for the catalog of known language codes.

GetLocalestring
# GetLocale
C#
public static string GetLocale();

Reads the active server locale. Not necessarily the original OS locale, a loaded-language list or an individual Translation Locale/domain override.

Returns string

Active server locale identifier.

GetLocaleNamestring
# GetLocaleName
C#
public static string GetLocaleName(string locale);

Standardizes locale and composes a display name from built-in language, script and country labels when present. A human-readable label rather than a stable identifier or automatically localized UI text.

Parameters
NameTypeDefault
localestring—
locale

Locale identifier such as ru_RU. SetLocale and numeric methods require nonempty input; exact searches and numeric methods do not automatically normalize it.

Returns string

Composed built-in display label rather than a locale key.

GetOrAddDomainTranslationDomain
# GetOrAddDomain
C#
public static TranslationDomain GetOrAddDomain(StringName domain);

Returns an existing named domain or creates an empty one. Use a unique addon name, such as its addons path; multiple owners must coordinate removal.

Parameters
NameTypeDefault
domainStringName—
domain

Domain name. An empty name selects the main project domain, not a new private domain.

Returns TranslationDomain

TranslationDomain for the name. Retrieval alone neither loads dictionaries nor assigns the domain to a Control.

GetPercentSignstring
# GetPercentSign
C#
public static string GetPercentSign(string locale);

Returns a numbering-system percent sign by exact nonempty locale key, or % when unmapped. Does not multiply a value by 100, format a number or choose sign placement.

Parameters
NameTypeDefault
localestring—
locale

Locale identifier such as ru_RU. SetLocale and numeric methods require nonempty input; exact searches and numeric methods do not automatically normalize it.

Returns string

Numbering-system sign or %, without a number.

GetPluralRulesstring
# GetPluralRules
C#
public static string GetPluralRules(string locale);

Looks up rule text by exact table key then parsed language+country and language. Returns empty text on a miss; the English fallback is selected by Translation rather than this method. Validates no catalog form count and inserts no count into text.

Parameters
NameTypeDefault
localestring—
locale

Locale identifier such as ru_RU. SetLocale and numeric methods require nonempty input; exact searches and numeric methods do not automatically normalize it.

Returns string

Gettext rule text or empty text when unavailable.

GetScriptNamestring
# GetScriptName
C#
public static string GetScriptName(string script);

Finds a writing-system name by exact code such as Latn. Unknown values pass through. Neither a C# script name nor a font-support check.

Parameters
NameTypeDefault
scriptstring—
script

Exact built-in table code; unknown input passes through.

Returns string

Table label or original unknown code.

GetToolLocalestring
# GetToolLocale
C#
public static string GetToolLocale();

In editor/project-manager mode of a TOOLS_ENABLED build uses an exact editor-catalog locale match or en. In normal runtime selects a matching main-domain locale or the server fallback. Not a universal way to read editor UI language from any game; editor behavior was source-reviewed only.

Returns string

Selected tool/runtime locale or fallback, depending on process mode.

GetTranslationObjectTranslation · Deprecated
# GetTranslationObject
C#
public static Translation GetTranslationObject(string locale);

Obsolete SDK method returning one best-matching shared main-domain resource or null. Guarantees neither equal-score selection nor the desired message being present. Use FindTranslations with explicit exact for lists and Translate/TranslatePlural for text.

Parameters
NameTypeDefault
localestring—
locale

Locale identifier such as ru_RU. SetLocale and numeric methods require nonempty input; exact searches and numeric methods do not automatically normalize it.

Returns Translation

One shared resource or null; obsolete API.

GetTranslationsReckfell.Collections.Array<Translation>
# GetTranslations
C#
public static Reckfell.Collections.Array<Translation> GetTranslations();

Returns a separate Array<Translation> of all main-domain catalogs without an order guarantee. Container edits change no registration; element edits change the shared resource. Do not dispose elements as newly created resources.

Returns Reckfell.Collections.Array<Translation>

New container of shared main-domain catalogs.

HasDomainbool
# HasDomain
C#
public static bool HasDomain(StringName domain);

Checks domain registration, not availability of a particular language or translated key. The checked private domain disappeared after plugin disablement.

Parameters
NameTypeDefault
domainStringName—
domain

Domain name to inspect; the empty-name main domain always exists.

Returns bool

true for an existing domain. Does not establish that the required dictionary was loaded.

HasTranslationbool
# HasTranslation
C#
public static bool HasTranslation(Translation translation);

Tests registration of the same Translation object in the main domain. Matching Locale or contents is insufficient; the catalog can be empty.

Parameters
NameTypeDefault
translationTranslation—
translation

Non-null shared Translation resource; registration/removal compares the object rather than just Locale.

Returns bool

true when that object is registered in the main domain.

HasTranslationForLocalebool
# HasTranslationForLocale
C#
public static bool HasTranslationForLocale(string locale, bool exact);

Tests main-domain catalog locales: exact=true uses literal equality and false CompareLocales>0. Checks no specific key, fallback or named domain.

Parameters
NameTypeDefault
localestring—
exactbool—
locale

Locale identifier such as ru_RU. SetLocale and numeric methods require nonempty input; exact searches and numeric methods do not automatically normalize it.

exact

true for literal Locale comparison; false for all positive CompareLocales matches.

Returns bool

true for a matching locale regardless of desired-message availability.

IsPseudolocalizationEnabledbool
# IsPseudolocalizationEnabled
C#
public static bool IsPseudolocalizationEnabled();

Reads the main-domain automatic-transformation flag. Checks neither all named domains nor visually refreshed UI.

Returns bool

Current main-domain state rather than a UI-check result.

ParseNumberstring
# ParseNumber
C#
public static string ParseNumber(string number, string locale);

Converts known numbering-system digits, separator and exponent back to an ASCII-digit string. Returns no numeric value and performs no syntax validation: multiple separators can remain. An unmapped locale key passes input through. Does not guarantee exact FormatNumber reversal: exponent case and original comma can be lost.

Parameters
NameTypeDefault
numberstring—
localestring—
number

Text rather than a numeric object. The method replaces characters without numeric validation; validate the result separately.

locale

Locale identifier such as ru_RU. SetLocale and numeric methods require nonempty input; exact searches and numeric methods do not automatically normalize it.

Returns string

Text rather than double/decimal or evidence of numeric validity.

PseudolocalizeStringName
# Pseudolocalize
C#
public static StringName Pseudolocalize(StringName message);

Explicitly transforms the supplied string using pseudolocalization settings for the main domain. Works even when PseudolocalizationEnabled is false. Does not look up a translation; placeholder skipping does not recognize C# composite format {0}.

Parameters
NameTypeDefault
messageStringName—
message

Text to transform; look up the translation first if needed.

Returns StringName

Transformed text with configured wrappers and padding; empty input remains empty.

ReloadPseudolocalizationvoid
# ReloadPseudolocalization
C#
public static void ReloadPseudolocalization();

Reloads transformation parameters from internationalization/pseudolocalization/ for the main domain and sends a translation-change notification. Does not toggle the active state from use_pseudolocalization: set PseudolocalizationEnabled separately. Does not save ProjectSettings to disk.

RemoveDomainvoid
# RemoveDomain
C#
public static void RemoveDomain(StringName domain);

Removes a named domain from the registry. Remove its UI first and act only as the domain owner. Existing references can remain alive; GetOrAddDomain can create a new registration afterward.

Parameters
NameTypeDefault
domainStringName—
domain

Nonempty owned-domain name. Removing the main domain is rejected.

RemoveTranslationvoid
# RemoveTranslation
C#
public static void RemoveTranslation(Translation translation);

Removes the specific object from the main domain rather than all catalogs of that locale. Repeated removal is a no-op. Changes no membership in other domains and sends no translation-change notification.

Parameters
NameTypeDefault
translationTranslation—
translation

Non-null shared Translation resource; registration/removal compares the object rather than just Locale.

SetLocalevoid
# SetLocale
C#
public static void SetLocale(string locale);

Sets a nonempty active locale with normalization. When the normalized value changes, initiates translation-remap resource reload and sends MainLoop.NotificationTranslationChanged to the main loop. Repeating the same value is a no-op. Loads no arbitrary catalogs and persists no player preference. Recalculate custom computed text in the notification handler.

Parameters
NameTypeDefault
localestring—
locale

Locale identifier such as ru_RU. SetLocale and numeric methods require nonempty input; exact searches and numeric methods do not automatically normalize it.

SetPseudolocalizationEnabledvoid
# SetPseudolocalizationEnabled
C#
public static void SetPseudolocalizationEnabled(bool enabled);

Sets main-domain PseudolocalizationEnabled and initiates remap reload plus main-loop notification. Even the same bool sends a notification. Saves no ProjectSettings and enables no TranslatePlural transformation.

Parameters
NameTypeDefault
enabledbool—
enabled

New main-domain bool; repeating the value also triggers notification.

StandardizeLocale2 overloads
# StandardizeLocale · 1/2
C#
public static string StandardizeLocale(string locale);

Normalizes a locale identifier, for example ru-RU to ru_RU. It does not validate catalog availability or universally repair casing and malformed input. This overload does not add default components.

Parameters
NameTypeDefault
localestring—
locale

Locale identifier with canonical casing; separators such as the hyphen in ru-RU are supported.

Returns string

Normalized identifier. The result does not certify a translation exists or that arbitrary original input was valid.

# StandardizeLocale · 2/2
C#
public static string StandardizeLocale(string locale, bool addDefaults = false);

Normalizes a locale identifier, for example ru-RU to ru_RU. It does not validate catalog availability or universally repair casing and malformed input. With addDefaults=true, it may add a script or country for certain ambiguous locales.

Parameters
NameTypeDefault
localestring—
addDefaultsboolfalse
locale

Locale identifier with canonical casing; separators such as the hyphen in ru-RU are supported.

addDefaults

Allow known defaults for an ambiguous locale: for example zh becomes zh_Hans_CN. Does not select a language shipped by the game.

Returns string

Normalized identifier. The result does not certify a translation exists or that arbitrary original input was valid.

TranslateStringName
# Translate
C#
public static StringName Translate(StringName message, StringName context = null);

Performs main-domain lookup using active and fallback locales. Empty values count as misses; returns the source key when needed and applies enabled pseudolocalization. Does not search all named domains.

Parameters
NameTypeDefault
messageStringName—
contextStringNamenull
message

Source lookup key; for Pseudolocalize, selected text to transform.

context

Exact message context; null/default means empty.

Returns StringName

Found text or source key with applicable pseudolocalization.

TranslatePluralStringName
# TranslatePlural
C#
public static StringName TranslatePlural(StringName message, StringName pluralMessage, int n, StringName context = null);

Looks up a main-domain form using active then fallback locale; the chosen Translation supplies rules. On a miss returns message only at n==1, otherwise pluralMessage. Inserts no count and in SDK 1.0.0 applies no automatic pseudolocalization; explicitly Pseudolocalize the result when needed.

Parameters
NameTypeDefault
messageStringName—
pluralMessageStringName—
nint—
contextStringNamenull
message

Source lookup key; for Pseudolocalize, selected text to transform.

pluralMessage

Plural source form for fallback; not a separate Translation map key.

n

Nonnegative count for Translation rules; fallback uses singular only at 1. Not inserted into the result.

context

Exact message context; null/default means empty.

Returns StringName

Found form or source singular/plural without automatic pseudolocalization.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.