Exemplo n.º 1
0
        /// <summary>
        /// 改变一行数据
        /// </summary>
        /// <param name="value"></param>
        public void ChangeLines(LanguageConifgSplit conifgSplitData)
        {
            int langIndex = GetLangIndex(conifgSplitData.EConfigLang);

            for (int i = 0; i < ConfigLineDatas.Count; i++)
            {
                var    myData = ConfigLineDatas[i];
                string myKey  = myData.Values[GetLangIndex(eLanguageEnum.Cn)];
                int    len    = conifgSplitData.ConfigLineDatas.Count;
                for (int l = 0; l < len; l++)
                {
                    var oldData  = conifgSplitData.ConfigLineDatas[l];
                    var otherKey = oldData.Key;
                    if (myKey == otherKey && !string.IsNullOrEmpty(oldData.Value))
                    {
                        myData.Values[langIndex] = oldData.Value;
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 检查翻译后的文字以及配置表的文字是否相同
        /// </summary>
        /// <param name="conifgSplitData">翻译后的文件信息</param>
        public void CheckAndReplaceLines(LanguageConifgSplit conifgSplitData)
        {
            //中文不替换
            if (conifgSplitData.EConfigLang == eLanguageEnum.Cn)
            {
                return;
            }

            int langIndex = GetLangIndex(conifgSplitData.EConfigLang);

            for (int i = 0; i < ConfigLineDatas.Count; i++)
            {
                var    config     = ConfigLineDatas[i];
                string myKey      = config.Values[GetLangIndex(eLanguageEnum.Cn)];
                int    len        = conifgSplitData.ConfigLineDatas.Count;
                bool   translated = false;
                for (int l = 0; l < len; l++)
                {
                    var oldData  = conifgSplitData.ConfigLineDatas[l];
                    var otherKey = oldData.Key;
                    if (myKey == otherKey)
                    {
                        translated = true;
                        if (config.Values[langIndex] != oldData.Value)
                        {
                            config.Values[langIndex] = "";
                        }
                    }
                }

                if (!translated)
                {
                    config.Values[langIndex] = "";
                }
            }
        }