Пример #1
0
 public static void SetLanguage(string name)
 {
     if (name == null)
     {
         if (Current != DefaultLanguage)
         {
             Current = DefaultLanguage;
             OnLanguageChange.Invoke();
         }
     }
     if (name == DefaultLanguageName)
     {
         if (Current == null || Current != DefaultLanguage)
         {
             Current = DefaultLanguage;
             OnLanguageChange.Invoke();
         }
     }
     else
     {
         if (Current == null || Current.Name != name)
         {
             Current = LanguageIO.LoadLanguage(name);
             OnLanguageChange.Invoke();
         }
     }
 }
Пример #2
0
    public void LanguageClicked(string lang)
    {
        // Get base definition.
        LanguageDefinition def = LanguageDefinition.Core;

        // Generate definitions...
        DefinitionGenerator.GenerateDefinitions(def.Data);

        // Load language
        Language loaded = LanguageIO.LoadLanguage(lang);

        CurrentLang.LangChange(loaded);
        CurrentLang.SavePressed();
        CurrentLang.SpawnAll(def, loaded);
    }