Namespace NoSuchStudio.Localization
Classes
AssetMapComponentLocalizer<LT, CT, AT, LAD>
Base class for component localizers that have a map from language to an asset value.
BaseTranslationSource
Base class for classes that provide translations for phrases. The translations could be serialized in the scene or come from a File (FileTranslationSource) or from other places.
ComponentLocalizer<LT, CT>
Base class for components that localize other components.
CultureUtil
Contains helper methods for handling locales and languages.
FileTranslationSource
Base class for translation sources that are backed by a file. This class reads the translations from the backing file and registers them with LocalizationService.
LocaleDatabase
Class for managing locales. This class loads the locales from a backing json file, validates the locales and provides utility methods for handling locales. Each LocaleDatabase can be loaded only once. To load another json, create a new instance.
LocaleDatabase.NormalizedLocaleNameComparer
LocalizationService
Is responsible for connecting translation sources and localized components together. This service acts as a central hub. Essentially implementing a publisher-consumer pattern. Translation sources publish their translations to the service. Localized components read the corresponding values from the service.
LocalizationSettings
LocalizationUtils
Utility methods for handling locales and common localization patterns.
LocalizedAssetData<T>
To be used with AssetMapComponentLocalizer<LT, CT, AT, LAD>.
PhrasedComponentLocalizer<LT, CT>
Base class for component localizers that depend on a phrase. UI texts are a good example. Override UpdatePhrasedComponent() instead of UpdateComponent() when inheriting this class. phrase property indicates the phrase to translate. _translation field is the translated phrase in current language. Use it when updating the component.
PhrasedWithVariablesComponentLocalizer<LT, CT>
The base class for localized components that have a phrase and also use variable substitution. Override UpdateVariabledComponent() when inheriting from this class. _text field is the _translation with its variables replaced. Use it when updating the component.
Structs
Locale
A Locale is a language or a language plus a region. To learn more read the related documentation page from For example:
- en-US is the locale for the version of English language that is spoken in the United States (US).
- en-GB is the locale for the version of English language that is spoken in the United Kingdom (UK).
TranslationEntry
Interfaces
ILocalizationServiceComponent
Interface for all classes that use LocalizationService.
ITranslationSource
Interface for all classes that act as translation sources for LocalizationService.