Skip to content

Commit

Permalink
Support different type of translations file
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyuvn committed Jan 14, 2015
1 parent e244cae commit dff9f07
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Grabacr07.KanColleWrapper/Translations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,10 @@ public void AddTranslation(Object RawData, TranslationType Type)
{
foreach (XElement el in FoundTranslation)
{
el.Element("JP-Name").Value = QuestData.api_title;
el.Element("JP-Detail").Value = QuestData.api_detail;
if (el.Element("JP-Name") == null) el.Add(new XElement("JP-Name", QuestData.api_title));
else el.Element("JP-Name").Value = QuestData.api_title;
if (el.Element("JP-Detail") == null) el.Add(new XElement("JP-Detail", QuestData.api_detail));
else el.Element("JP-Detail").Value = QuestData.api_detail;
}
}
else
Expand All @@ -531,7 +533,8 @@ public void AddTranslation(Object RawData, TranslationType Type)
{
if (!Int32.TryParse(el.Element("ID").Value, out n))
{
el.Element("JP-Name").Value = QuestData.api_title;
if (el.Element("JP-Name") == null) el.Add(new XElement("JP-Name", QuestData.api_title));
else el.Element("JP-Name").Value = QuestData.api_title;
need_add = false;
}
}
Expand All @@ -544,7 +547,8 @@ public void AddTranslation(Object RawData, TranslationType Type)
{
if (!Int32.TryParse(el.Element("ID").Value, out n))
{
el.Element("JP-Detail").Value = QuestData.api_detail;
if (el.Element("JP-Detail") == null) el.Add(new XElement("JP-Detail", QuestData.api_detail));
else el.Element("JP-Detail").Value = QuestData.api_detail;
need_add = false;
}
}
Expand Down Expand Up @@ -588,8 +592,10 @@ public void AddTranslation(Object RawData, TranslationType Type)
{
foreach (XElement el in FoundTranslationExpedition)
{
el.Element("JP-Name").Value = ExpeditionData.api_name;
el.Element("JP-Detail").Value = ExpeditionData.api_details;
if (el.Element("JP-Name") == null) el.Add(new XElement("JP-Name", ExpeditionData.api_name));
else el.Element("JP-Name").Value = ExpeditionData.api_name;
if (el.Element("JP-Detail") == null) el.Add(new XElement("JP-Detail", ExpeditionData.api_details));
else el.Element("JP-Detail").Value = ExpeditionData.api_details;
}

}
Expand Down

0 comments on commit dff9f07

Please sign in to comment.