public void Load(string language)
        {
            if (!Directory.Exists(Path + language)
                || !File.Exists(Path + language + "/" + language + ".xml"))
            {
                MessageBox.Show("File not found");
                return;
            }
            try
            {
                XmlSerializer deserializer = new XmlSerializer(typeof(LanguageInfo));
                TextReader textReader = new StreamReader(Path + language + "/" + language + ".xml");
                Translation = (LanguageInfo)deserializer.Deserialize(textReader);
                textReader.Close();
                Loaded = true;
                if(File.Exists(Path + language + "/strings.conf"))
                    File.Copy(Path + language + "/strings.conf", "strings.conf", true);
                if (File.Exists(Path + language + "/cards.cdb"))
                    File.Copy(Path + language + "/cards.cdb", "cards.cdb", true);

            }
            catch (Exception)
            {
                MessageBox.Show("Error Laoding " + language);
            }
        }
 public LanguageManager()
 {
     Translation = new LanguageInfo();
 }
Beispiel #3
0
 public LanguageManager()
 {
     Translation = new LanguageInfo();
 }