no more manual translation + fixed most of the JSON file can't be displayed error

This commit is contained in:
Asval 2019-06-22 15:16:51 +02:00
parent 4274a2ba09
commit 6201d87bba
8 changed files with 41 additions and 55 deletions

View File

@ -88,6 +88,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>DLLs\csharp-wick.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.11.7.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.11.7\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>

View File

@ -277,7 +277,7 @@ namespace FModel
}
private void Button1_Click(object sender, EventArgs e)
{
var aesForms = new Forms.AESManager();
var aesForms = new AESManager();
if (Application.OpenForms[aesForms.Name] == null)
{
aesForms.Show();

View File

@ -6,6 +6,8 @@ using System.Drawing.Drawing2D;
using System.IO;
using System.Windows.Forms;
using System;
using Newtonsoft.Json.Linq;
using FModel.Parser.LocResParser;
namespace FModel
{
@ -160,57 +162,45 @@ namespace FModel
switch (Settings.Default.IconLanguage)
{
case "French":
all = "Terminez CHACUN DES DÉFIS pour gagner la récompense";
any = "Terminez " + count + " DES DÉFIS pour gagner la récompense";
break;
case "German":
all = "Schließe ALLE HERAUSFORDERUNGEN ab, um die Belohnung zu verdienen";
any = "Schließe " + count + " HERAUSFORDERUNGEN ab, um die Belohnung zu verdienen";
break;
case "Italian":
all = "Completa TUTTE LE SFIDE per ottenere l'oggetto in ricompensa";
any = "Completa " + count + " SFIDE QUALSIASI per ottenere l'oggetto ricompensa";
break;
case "Spanish":
case "Spanish (LA)":
all = "Completa TODOS LOS DESAFÍOS para conseguir el objeto de recompensa";
any = "Completa " + count + " DE LOS DESAFÍOS para conseguir el objeto de recompensa";
break;
case "Arabic":
all = "أكمل جميع التحديات لتربح عنصر المكافأة";
any = "أكمل أيًا " + count + " من التحديات للحصول على عنصر المكافأة";
break;
case "Japanese":
all = "全個のチャレンジをクリアして報酬アイテムを獲得する";
any = "いずれか" + count + "個のチャレンジをクリアして、報酬アイテムを獲得する";
break;
case "Korean":
all = "개의 도전을 모두 완료하고 보상 아이템을 얻으세요.";
any = count + "개</>의 도전 완료";
break;
case "Polish":
all = "Ukończ wszystkie wyzwań, by otrzymać tę nagrodę";
any = "Ukończ " + count + " dowolnych wyzwań, by otrzymać tę nagrodę";
break;
case "Portuguese (Brazil)":
all = "Conclua TODOS OS DESAFIOS para receber o item de recompensa";
any = "Conclua " + count + " DESAFIO(S) para receber o item de recompensa";
break;
case "Russian":
all = "Выполните все испытания, чтобы получить награду";
any = "Выполните не менее " + count + " любых испытаний для награды";
break;
case "Turkish":
all = "Ödülü kazanmak için GÖREVI DE tamamla.";
any = "Ödülü kazanmak için herhangi " + count + " GÖREVI tamamla.";
break;
case "Chinese (S)":
all = "完成所有个挑战以赢得奖励物品";
any = "完成任意" + count + "个挑战以赢得奖励物品";
break;
case "Traditional Chinese":
all = "完成所有個挑戰以贏得獎勵物品";
any = "完成任意" + count + "個挑戰以贏得獎勵物品";
foreach (JToken token in SearchResource.jo.FindTokens("AthenaChallengeDetailsEntry")) //no need to check if we need a new SearchResource.jo
{
LocResParser LocResParse = LocResParser.FromJson(token.ToString());
if (LocResParse.CompletionRewardFormatAll != null)
{
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(LocResParse.CompletionRewardFormatAll);
if (doc.DocumentNode.InnerText.Contains(" {0}")) //avoid white space
{
all = doc.DocumentNode.InnerText.Replace(" {0}", string.Empty);
}
else { all = doc.DocumentNode.InnerText.Replace("{0}", string.Empty); }
}
if (LocResParse.CompletionRewardFormat != null)
{
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(LocResParse.CompletionRewardFormat);
if (doc.DocumentNode.InnerText.Contains("{QuestNumber}")) //russian
{
any = doc.DocumentNode.InnerText.Replace("{QuestNumber}", count);
}
else { any = string.Format(doc.DocumentNode.InnerText, count); }
}
}
break;
default:
break;

View File

@ -376,32 +376,20 @@ namespace FModel
switch (Settings.Default.IconLanguage)
{
case "French":
return " secondes";
case "German":
return " Sekunden";
case "Italian":
return " secondi";
case "Spanish":
case "Spanish (LA)":
return " segundos";
case "Arabic":
return " الثواني"; //todo: right to left
case "Japanese":
return " 秒"; //todo: right to left?
case "Korean":
return " 초"; //todo: right to left?
case "Polish":
return " s";
case "Portuguese (Brazil)":
return " segundo(s)";
case "Russian":
return " сек";
case "Turkish":
return " saniye";
case "Chinese (S)":
return " 秒"; //todo: right to left?
case "Traditional Chinese":
return " 秒"; //todo: right to left?
return " " + SearchResource.getTextByKey("6BA53D764BA5CC13E821D2A807A72365", "seconds");
default:
return " seconds";
}

View File

@ -6,7 +6,7 @@ namespace FModel
static class SearchResource
{
private static string parsedJsonToCheck { get; set; }
private static JObject jo { get; set; }
public static JObject jo { get; set; }
private static string oldLanguage = Properties.Settings.Default.IconLanguage;
/// <summary>

View File

@ -8,8 +8,6 @@
namespace FModel.Parser.LocResParser
{
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@ -21,6 +19,12 @@ namespace FModel.Parser.LocResParser
[JsonProperty("WorkerSetBonusTraitPattern")]
public string WorkerSetBonusTraitPattern { get; set; }
[JsonProperty("CompletionRewardFormat_All")]
public string CompletionRewardFormatAll { get; set; }
[JsonProperty("CompletionRewardFormat")]
public string CompletionRewardFormat { get; set; }
}
public partial class LocResParser

Binary file not shown.

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autoupdater.NET.Official" version="1.5.1" targetFramework="net471" />
<package id="HtmlAgilityPack" version="1.11.7" targetFramework="net471" />
<package id="jacobslusser.ScintillaNET" version="3.6.3" targetFramework="net471" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net471" />
<package id="RestSharp" version="106.6.9" targetFramework="net471" />