Fix traduzioni

This commit is contained in:
Annamaria Sassi
2026-08-14 16:48:47 +02:00
parent 6cb04fd803
commit fe0d52d46f
7 changed files with 45 additions and 19 deletions
+6 -4
View File
@@ -319,8 +319,9 @@ namespace WebWindowComplex
//PendReq.Remove("Profile");
//await EC_PendantAction.InvokeAsync(PendReq);
}
if(Vocabulary != null )
if(Vocabulary != null || Vocabulary.Count == 0 )
{
CurrVocabulary = Vocabulary;
TableCDict = Vocabulary.Where(x => x.Key.Contains("CWTableC_")).ToDictionary(x => x.Key, y => y.Value);
if ((TableCDict == null || TableCDict.Count != 10) && !prevReqTrad)
{
@@ -336,6 +337,8 @@ namespace WebWindowComplex
private Dictionary<string, string> TableCDict = new();
private Dictionary<string, string> CurrVocabulary = new();
private bool reqBool = false;
private bool waitShape = false;
@@ -1010,7 +1013,6 @@ namespace WebWindowComplex
private Task DoReqTraduzione(List<string> lemmaList)
{
Log.Info("Richiesta Traduzione");
return EC_ReqTraduzione.InvokeAsync(lemmaList);
}
@@ -2336,8 +2338,8 @@ namespace WebWindowComplex
private Dictionary<string,string> RestrictDict(List<string> subComp)
{
Dictionary<string,string> dict = new Dictionary<string,string>();
if(Vocabulary != null && Vocabulary.Count > 0)
dict = Vocabulary.Where(x => subComp.Any(sub => x.Key.Contains(sub))).ToDictionary(x => x.Key, y => y.Value);
if(CurrVocabulary != null && CurrVocabulary.Count > 0)
dict = CurrVocabulary.Where(x => subComp.Any(sub => x.Key.Contains(sub))).ToDictionary(x => x.Key, y => y.Value);
return dict;
}