-
Notifications
You must be signed in to change notification settings - Fork 19
Scripting Reference
H. Ibrahim Penekli edited this page Feb 2, 2018
·
5 revisions
// To get localization settings:
LocalizationSettings localizationSettings = LocalizationSettings.Instance;
// You can get available languages as:
List<SystemLanguage> availableLanguages = localizationSettings.AvailableLanguages;
// To access Google auth file:
TextAsset authFile = localizationSettings.GoogleAuthenticationFile;// You can get current language:
SystemLanguage currentLanguage = Localization.Instance.CurrentLanguage;
// or you can set current language:
Localization.Instance.CurrentLanguage = SystemLanguage.English;
// or set by system language:
Localization.Instance.SetSystemLanguage();
// or set by default language defined in LocalizationSettings (first item is the default language):
Localization.Instance.SetDefaultLanguage();
// Register application locale changed event:
Localization.Instance.LocaleChanged += (object sender, LocaleChangedEventArgs e) =>
{
Debug.Log("Application locale has changed from " + e.PreviousLanguage + " to " + e.CurrentLanguage);
};