示例#1
0
 private static void LoadModLocale(string modName)
 {
     foreach (var localeName in GetAllModFiles(modName, "locale/en/"))
     {
         var loaded = ReadModFile(modName, localeName);
         using (var ms = new MemoryStream(loaded))
             FactorioLocalization.Parse(ms);
     }
 }
示例#2
0
        private static void LoadModLocale(string modName, string locale)
        {
            foreach (var localeName in GetAllModFiles(modName, "locale/en/"))
            {
                var loaded = ReadModFile(modName, localeName);
                using (var ms = new MemoryStream(loaded))
                    FactorioLocalization.Parse(ms);
            }

            if (!string.IsNullOrEmpty(locale) && locale != "en")
            {
                foreach (var localeName in GetAllModFiles(modName, "locale/" + locale + "/"))
                {
                    var loaded = ReadModFile(modName, localeName);
                    using (var ms = new MemoryStream(loaded))
                        FactorioLocalization.Parse(ms);
                }
            }
        }