private void LoadFromFile_Keyed(FileInfo file) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); try { foreach (KeyValuePair <string, string> item in DirectXmlLoaderSimple.ValuesFromXmlFile(file)) { if (this.keyedReplacements.ContainsKey(item.Key) || dictionary.ContainsKey(item.Key)) { Log.Warning("Duplicate code-linked translation key: " + item.Key + " in language " + this.folderName); } else { dictionary.Add(item.Key, item.Value); } } } catch (Exception ex) { Log.Warning("Exception loading from translation file " + file + ": " + ex); dictionary.Clear(); } foreach (KeyValuePair <string, string> item2 in dictionary) { this.keyedReplacements.Add(item2.Key, item2.Value); } }
private void LoadFromFile_Keyed(FileInfo file) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); try { foreach (KeyValuePair <string, string> current in DirectXmlLoaderSimple.ValuesFromXmlFile(file)) { if (this.keyedReplacements.ContainsKey(current.Key) || dictionary.ContainsKey(current.Key)) { Log.Warning("Duplicate code-linked translation key: " + current.Key + " in language " + this.folderName); } else { dictionary.Add(current.Key, current.Value); } } } catch (Exception ex) { Log.Warning(string.Concat(new object[] { "Exception loading from translation file ", file, ": ", ex })); dictionary.Clear(); } foreach (KeyValuePair <string, string> current2 in dictionary) { this.keyedReplacements.Add(current2.Key, current2.Value); } }
private void LoadFromFile_Keyed(FileInfo file) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); Dictionary <string, int> dictionary2 = new Dictionary <string, int>(); try { foreach (DirectXmlLoaderSimple.XmlKeyValuePair current in DirectXmlLoaderSimple.ValuesFromXmlFile(file)) { if (this.keyedReplacements.ContainsKey(current.key) || dictionary.ContainsKey(current.key)) { this.loadErrors.Add("Duplicate keyed translation key: " + current.key + " in language " + this.folderName); } else { dictionary.Add(current.key, current.value); dictionary2.Add(current.key, current.lineNumber); } } } catch (Exception ex) { this.loadErrors.Add(string.Concat(new object[] { "Exception loading from translation file ", file, ": ", ex })); dictionary.Clear(); dictionary2.Clear(); this.anyKeyedReplacementsXmlParseError = true; this.lastKeyedReplacementsXmlParseErrorInFile = file.Name; } foreach (KeyValuePair <string, string> current2 in dictionary) { string text = current2.Value; LoadedLanguage.KeyedReplacement keyedReplacement = new LoadedLanguage.KeyedReplacement(); if (text == "TODO") { keyedReplacement.isPlaceholder = true; text = string.Empty; } keyedReplacement.key = current2.Key; keyedReplacement.value = text; keyedReplacement.fileSource = file.Name; keyedReplacement.fileSourceLine = dictionary2[current2.Key]; keyedReplacement.fileSourceFullPath = file.FullName; this.keyedReplacements.Add(current2.Key, keyedReplacement); } }
private void LoadFromFile_Keyed(VirtualFile file) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); Dictionary <string, int> dictionary2 = new Dictionary <string, int>(); try { foreach (DirectXmlLoaderSimple.XmlKeyValuePair item in DirectXmlLoaderSimple.ValuesFromXmlFile(file)) { if (keyedReplacements.ContainsKey(item.key) || dictionary.ContainsKey(item.key)) { loadErrors.Add("Duplicate keyed translation key: " + item.key + " in language " + folderName); } else { dictionary.Add(item.key, item.value); dictionary2.Add(item.key, item.lineNumber); } } } catch (Exception ex) { loadErrors.Add("Exception loading from translation file " + file + ": " + ex); dictionary.Clear(); dictionary2.Clear(); anyKeyedReplacementsXmlParseError = true; lastKeyedReplacementsXmlParseErrorInFile = file.Name; } foreach (KeyValuePair <string, string> item2 in dictionary) { string text = item2.Value; KeyedReplacement keyedReplacement = new KeyedReplacement(); if (text == "TODO") { keyedReplacement.isPlaceholder = true; text = ""; } keyedReplacement.key = item2.Key; keyedReplacement.value = text; keyedReplacement.fileSource = file.Name; keyedReplacement.fileSourceLine = dictionary2[item2.Key]; keyedReplacement.fileSourceFullPath = file.FullPath; keyedReplacements.Add(item2.Key, keyedReplacement); } }
private void LoadFromFile_Keyed(FileInfo file) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); Dictionary <string, int> dictionary2 = new Dictionary <string, int>(); try { foreach (DirectXmlLoaderSimple.XmlKeyValuePair xmlKeyValuePair in DirectXmlLoaderSimple.ValuesFromXmlFile(file)) { if (this.keyedReplacements.ContainsKey(xmlKeyValuePair.key) || dictionary.ContainsKey(xmlKeyValuePair.key)) { this.loadErrors.Add("Duplicate keyed translation key: " + xmlKeyValuePair.key + " in language " + this.folderName); } else { dictionary.Add(xmlKeyValuePair.key, xmlKeyValuePair.value); dictionary2.Add(xmlKeyValuePair.key, xmlKeyValuePair.lineNumber); } } } catch (Exception ex) { this.loadErrors.Add(string.Concat(new object[] { "Exception loading from translation file ", file, ": ", ex })); dictionary.Clear(); } foreach (KeyValuePair <string, string> keyValuePair in dictionary) { this.keyedReplacements.Add(keyValuePair.Key, keyValuePair.Value); this.keyedReplacementsFileSource.Add(keyValuePair.Key, new Pair <string, int>(file.Name, dictionary2[keyValuePair.Key])); } }