Ejemplo n.º 1
0
        // 解析每一行
        private void ParseText(string[] lines, string[] linesZh)
        {
            Dictionary <string, LangLine> langLineDict = new Dictionary <string, LangLine>();

            // en
            foreach (string line in lines)
            {
                try
                {
                    LangLine langLine = new LangLine(line);
                    langLineDict.Add(langLine.GetIdWithoutCategory(false), langLine);
                }
                catch (Exception e)
                {
                    System.Console.WriteLine(e.ToString());
                }
            }
            // zh
            foreach (string lineZh in linesZh)
            {
                try
                {
                    LangLine langLineZh = new LangLine(lineZh);
                    string   key        = langLineZh.GetIdWithoutCategory(false);
                    langLineDict[key].UpdateTextZh(langLineZh.text);
                }
                catch (Exception e)
                {
                    System.Console.WriteLine(e.ToString());
                }
            }
            // convert
            langLines = langLineDict.Values.ToArray();
        }
Ejemplo n.º 2
0
        // 添加一项
        private void AddLangLineResult(LangLine langLine)
        {
            string categoryName = langLine.categoryName;
            string id           = langLine.id;
            string text         = langLine.text;
            string textZh       = langLine.textZh;

            dataGridViewResult.Rows.Add(categoryName, id, text, textZh);
        }