class MAGES::LocalizationModule¶
Overview¶
The base Localization module. More…
class LocalizationModule: public MAGES::HubModule { public: // classes templateclass SerializedEntry; // properties List Languages; UnityEvent LanguageChanged; // methods void AddTextEntry(string token); void AddAudioEntry(string token); string ResolveText(string key); AudioClip ResolveAudio(string key); void SetLanguage(string language, bool invokeCallbacks = true); string GetCurrentLanguage(); List<SerializedEntry > GetTextEntries(); List<SerializedEntry > GetAudioEntries(); }; // direct descendants class MAGESLocalization; class StubLocalization;
Inherited Members¶
public: // properties int Version; // methods void Startup(); void Shutdown(); virtual void UpdateModule(UpdatePhase updatePhase);
Detailed Documentation¶
The base Localization module.
Properties¶
ListLanguages
Gets the languages available in the module.
UnityEvent LanguageChanged
Gets the language changed event.
Methods¶
void AddTextEntry(string token)
Adds a new text entry to the localization system.
Parameters:
token |
The token to translate. |
void AddAudioEntry(string token)
Adds a new audio entry to the localization system.
Parameters:
token |
The key of the audio clip to swap. |
string ResolveText(string key)
Resolve the key of a text.
Parameters:
key |
The key. |
Returns:
The resolved text.
AudioClip ResolveAudio(string key)
Resolve the key of a text.
Parameters:
key |
The key. |
Returns:
The resolved text.
void SetLanguage(string language, bool invokeCallbacks = true)
Sets the language of the system.
Parameters:
language |
The language to use. |
invokeCallbacks |
Whether to invoke the language changed callbacks. |
string GetCurrentLanguage()
Returns the current language.
Returns:
The currently selected language.
List<SerializedEntry> GetTextEntries()
Returns the text entries list that contain the key and the translations.
Returns:
The text entries list that contains the key and the translations.
List<SerializedEntry> GetAudioEntries()
Returns the audio entries list that contain the key and the translations.
Returns:
The audio entries list that contains the key and the translated audioclip.