Ejemplo n.º 1
0
        public void Language_DisplayName_Tests()
        {
            SetLanguage (lang1);

            Assert.AreNotEqual (languageOption.DisplayValue, lang2.DisplayName);
            Assert.AreEqual (languageOption.DisplayValue, lang1.DisplayName);

            Language lang3 = new Language (file: Localizer.LanguageDirectory + "xz.ini");
            Assert.AreEqual (lang3.Localization ["language", "displayname", ""], lang3.DisplayName);
            lang3.DisplayName = "XZ";
            Assert.AreEqual (lang3.Localization ["language", "displayname", ""], lang3.DisplayName);
            Assert.AreEqual (lang3.Localization ["language", "displayname", ""], "XZ");
        }
Ejemplo n.º 2
0
        public void Init()
        {
            lang1 = new Language (file: Localizer.LanguageDirectory + "xx.ini");
            lang1.DisplayName = "XX";
            lang1.Localization ["text", "new game", ""] = "Neues Spiel";

            lang2 = new Language (file: Localizer.LanguageDirectory + "xy.ini");
            lang2.DisplayName = "XY";
            lang2.Localization ["text", "new game", ""] = "New Game";

            languageOption = new LanguageOption (
                section: "language",
                name: "current",
                configFile: Config.Default
            );
        }
Ejemplo n.º 3
0
 public bool Equals(Language other)
 {
     return other != null && Code == other.Code;
 }
Ejemplo n.º 4
0
 public void SetLanguage(Language lang)
 {
     languageOption.Value = lang;
     //Config.Default ["language", "current", "xx"] = code;
 }