Modifica traduzioni

This commit is contained in:
Annamaria Sassi
2026-08-14 14:44:29 +02:00
parent e3e4ddc4e3
commit 953a90fa62
7 changed files with 90 additions and 35 deletions
+13 -10
View File
@@ -161,8 +161,6 @@ namespace WebWindowComplex
protected override async Task OnInitializedAsync()
{
// Ricava il percorso assoluto sul disco del server
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"Data", "Lemmi.json");
if (File.Exists(filePath))
@@ -174,12 +172,6 @@ namespace WebWindowComplex
await EC_ReqTraduzione.InvokeAsync(tradList);
}
}
//if (Vocabulary == null || Vocabulary.Count == 0)
//{
// List<string> tradList = new List<string>() { "ConfWind_MissingParam", "ConfWind_MissingJWD", "ConfWind_ValidError", "ConfWind_ConfigError", "ConfWind_Tree", "ConfWind_General", "ConfWind_Reset", "ConfWind_Save", "ConfWind_Close", "ConfWind_AllFill", "ConfWind_AllGlass", "ConfWind_AllWood" };
// await EC_ReqTraduzione.InvokeAsync(tradList);
//}
}
/// <summary>
@@ -325,12 +317,23 @@ namespace WebWindowComplex
//PendReq.Remove("Profile");
//await EC_PendantAction.InvokeAsync(PendReq);
}
if(Vocabulary != null)
{
TableCDict = Vocabulary.Where(x => x.Key.Contains("CWTableC_")).ToDictionary(x => x.Key, y => y.Value);
if (TableCDict == null || TableCDict.Count != 10)
{
List<string> tradList = new List<string>() { "CWTableC_Reset", "CWTableC_Save", "CWTableC_Close", "CWTableC_MissingParam", "CWTableC_MissingJWD", "CWTableC_ValidError", "CWTableC_ConfigError", "CWTableC_MissingValue", "CWTableC_Tree", "CWTableC_General" };
await EC_ReqTraduzione.InvokeAsync(tradList);
}
}
}
#endregion Protected Methods
#region Private Fields
private Dictionary<string, string> TableCDict = new();
private bool reqBool = false;
private bool waitShape = false;
@@ -2315,9 +2318,9 @@ namespace WebWindowComplex
private string Traduci(string lemma)
{
string ans = lemma;
if (Vocabulary != null && Vocabulary.ContainsKey(lemma))
if (TableCDict != null && TableCDict.ContainsKey(lemma))
{
ans = Vocabulary.GetValueOrDefault(lemma) ?? "";
ans = TableCDict.GetValueOrDefault(lemma) ?? "";
}
return ans;
}