private void SaveButton() { if (GUILayout.Button("Save")) { L10n.CurrentLanguage.SetValues(_localizations); L10n.SaveCurrentLanguage(); } }
/// <summary> /// Initializes localization. /// </summary> private void InitLocalization() { LangCode currentLang = _defaultLanguage; //(LangCode) PlayerPrefs.GetInt(LanguageKey, (int) _defaultLanguage); L10n.LoadLanguage(currentLang); L10n.LanguageLoaded += OnLanguageLoaded; }
private void SetLanguage(LangCode langCode) { // Current language is already set to langCode. Just return. if (CurrentLanguage == langCode) { return; } CurrentLanguage = langCode; EditorPrefs.SetInt(LocalizationKey, (int)CurrentLanguage); _localizations.Clear(); // Load localization file L10n.LoadLanguage(CurrentLanguage); _localizations = L10n.CurrentLanguage.GetValues(); }