コード例 #1
0
 private void SaveButton()
 {
     if (GUILayout.Button("Save"))
     {
         L10n.CurrentLanguage.SetValues(_localizations);
         L10n.SaveCurrentLanguage();
     }
 }
コード例 #2
0
        /// <summary>
        /// Initializes localization.
        /// </summary>
        private void InitLocalization()
        {
            LangCode currentLang = _defaultLanguage;

            //(LangCode) PlayerPrefs.GetInt(LanguageKey, (int) _defaultLanguage);
            L10n.LoadLanguage(currentLang);
            L10n.LanguageLoaded += OnLanguageLoaded;
        }
コード例 #3
0
        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();
        }