UnityToolbox
Brief documentation for all existing scripts.
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Pages
Loading...
Searching...
No Matches
UnityToolbox.UI.Localization.Localizer Class Reference

The heart of the Localization system. Every Localization, its serialisation and editing is managed here.

Public Member Functions

void AddLocalization (LocalizationID LocalizationID, Dictionary< LocalizationLanguage, string > Localizations)
 Adds a new Localization to the system.
 
void AddScope (string scopeName)
 Adds a new LocalizationScope to the system.
 
void AddLanguage (string languageName, string languageShortName)
 Adds a new LocalizationLanguage to the system.
 
void RemoveLanguage (LocalizationLanguage language)
 Removes a LocalizationLanguage from the system.
 
void RemoveScope (LocalizationScope scope)
 Removes a LocalizationScope from the system.
 
void RemoveLocalization (LocalizationID LocalizationID)
 Removes a Localization, that is a LocalizationID with all its content, from the system.
 
void EditLocalizationID (LocalizationID oldID, LocalizationID newID)
 Edits an existing LocalizationID by replacing the IDs, but keeping its content.
 
void EditScope (LocalizationScope oldScope, string newScopeName)
 Replaces a LocalizationScope with a new one for all available data.
 
void EditLanguage (LocalizationLanguage oldLanguage, string newLanguageName, string newLanguageShortName)
 Replaces a LocalizationLanguage with a new one for all available data.
 
void EditLocalization (LocalizationID LocalizationID, Dictionary< LocalizationLanguage, string > Localizations)
 Edits a given Localization found by the LocalizationID by replacing the current content with Localizations .
 
void WriteData ()
 Writes the data to disk. For this to work, a valid path within the project must be setup.
 
void Initialize ()
 Initializes the Localizer. This is required due to its dependency on a valid path.
 

Properties

static Localizer Instance [get]
 
Dictionary< LocalizationID, Dictionary< LocalizationLanguage, string > > LocalizationData [get]
 
HashSet< LocalizationLanguageLocalizationLanguages [get]
 
HashSet< LocalizationScopeLocalizationScopes [get]
 
LocalizationScope DefaultScope [get]
 
bool IsInitialized [get]
 

Events

Action< LocalizationScopeScopeEdited
 
Action< LocalizationLanguageLanguageEdited
 
Action< LocalizationIDLocalizationIDEdited
 

Member Function Documentation

◆ AddLanguage()

void UnityToolbox.UI.Localization.Localizer.AddLanguage ( string  languageName,
string  languageShortName 
)
Parameters
languageName
languageShortName
Exceptions
StatusException

References UnityToolbox.UI.Localization.Localizer.Initialize().

◆ AddLocalization()

void UnityToolbox.UI.Localization.Localizer.AddLocalization ( LocalizationID  LocalizationID,
Dictionary< LocalizationLanguage, string >  Localizations 
)
Parameters
LocalizationID
Localizations
Exceptions
StatusException

References UnityToolbox.UI.Localization.Localizer.Initialize(), and UnityToolbox.UI.Localization.LocalizationLanguage.Name.

◆ AddScope()

void UnityToolbox.UI.Localization.Localizer.AddScope ( string  scopeName)

◆ EditLanguage()

void UnityToolbox.UI.Localization.Localizer.EditLanguage ( LocalizationLanguage  oldLanguage,
string  newLanguageName,
string  newLanguageShortName 
)
Parameters
oldLanguage
newLanguageName
newLanguageShortName
Exceptions
StatusException

References UnityToolbox.UI.Localization.Localizer.Initialize().

Referenced by UnityToolbox.UI.Localization.Editor.LocalizationEditLanguageWindow.OnGUI().

◆ EditLocalization()

void UnityToolbox.UI.Localization.Localizer.EditLocalization ( LocalizationID  LocalizationID,
Dictionary< LocalizationLanguage, string >  Localizations 
)

◆ EditLocalizationID()

void UnityToolbox.UI.Localization.Localizer.EditLocalizationID ( LocalizationID  oldID,
LocalizationID  newID 
)
Parameters
oldID
newID
Exceptions
StatusException

References UnityToolbox.UI.Localization.Localizer.Initialize().

Referenced by UnityToolbox.UI.Localization.Editor.LocalizationEditIDWindow.OnGUI().

◆ EditScope()

void UnityToolbox.UI.Localization.Localizer.EditScope ( LocalizationScope  oldScope,
string  newScopeName 
)

◆ Initialize()

◆ RemoveLanguage()

void UnityToolbox.UI.Localization.Localizer.RemoveLanguage ( LocalizationLanguage  language)
Parameters
language
Exceptions
StatusException

References UnityToolbox.UI.Localization.Localizer.Initialize().

◆ RemoveLocalization()

void UnityToolbox.UI.Localization.Localizer.RemoveLocalization ( LocalizationID  LocalizationID)
Parameters
LocalizationID

References UnityToolbox.UI.Localization.Localizer.Initialize().

◆ RemoveScope()

void UnityToolbox.UI.Localization.Localizer.RemoveScope ( LocalizationScope  scope)

◆ WriteData()

Property Documentation

◆ DefaultScope

LocalizationScope UnityToolbox.UI.Localization.Localizer.DefaultScope
get

◆ Instance

◆ IsInitialized

bool UnityToolbox.UI.Localization.Localizer.IsInitialized
get

◆ LocalizationData

Dictionary<LocalizationID, Dictionary<LocalizationLanguage, string> > UnityToolbox.UI.Localization.Localizer.LocalizationData
get

◆ LocalizationLanguages

HashSet<LocalizationLanguage> UnityToolbox.UI.Localization.Localizer.LocalizationLanguages
get

◆ LocalizationScopes

HashSet<LocalizationScope> UnityToolbox.UI.Localization.Localizer.LocalizationScopes
get

Event Documentation

◆ LanguageEdited

Action<LocalizationLanguage> UnityToolbox.UI.Localization.Localizer.LanguageEdited

◆ LocalizationIDEdited

Action<LocalizationID> UnityToolbox.UI.Localization.Localizer.LocalizationIDEdited

◆ ScopeEdited

Action<LocalizationScope> UnityToolbox.UI.Localization.Localizer.ScopeEdited