コード例 #1
0
        public static LangFile Parse(string langFilePath)
        {
            LangFile ret = new() { FileName = langFilePath };

            string[] lines = File.ReadAllLines(langFilePath);

            int start = 0;

            if (lines[0].StartsWith("/"))
            {
                ret.header = lines[0];
                start      = 1;
            }

            for (int i = start; i < lines.Length; i++)
            {
                if (string.IsNullOrWhiteSpace(lines[i]))
                {
                    ret.Sections.Add(new StdLine(lines[i]));
                }
                else if (lines[i].TrimStart().StartsWith("#"))
                {
                    ret.Sections.Add(LangSection.Parse(ret, ref i, lines));
                }
            }

            return(ret);
        }
コード例 #2
0
 public IDLineLocalization(LangSection langSection, int id, string value)
 {
     ID          = id;
     LangSection = langSection;
     Value       = value;
 }