From 00371f11246567d5d3580cf212fd520c9096a192 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 18 Aug 2026 15:03:22 +0200 Subject: [PATCH] Passato intero vocabolario ai sottocomponenti --- Test.UI/Components/Pages/EditJWD.razor.cs | 5 ++++- WebWindowComplex/Compo/AreaFrame.razor.cs | 12 ++++++------ WebWindowComplex/Compo/CardFill.razor.cs | 12 ++++++------ WebWindowComplex/Compo/CardFrame.razor.cs | 12 ++++++------ WebWindowComplex/Compo/CardTree.razor.cs | 10 +++++----- WebWindowComplex/Data/Lemmi.json | 2 +- WebWindowComplex/TableComp.razor.cs | 11 +++++++++-- WebWindowComplex/WebWindowComplex.csproj | 15 ++++++++++++++- .../WebWindowConfigurator.csproj | 3 ++- 9 files changed, 53 insertions(+), 29 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index c510d92..64f138d 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -328,13 +328,16 @@ namespace Test.UI.Components.Pages { string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Traduzioni", "Traduzione.json"); + Dictionary tempDict = new Dictionary(); if (File.Exists(filePath)) { string jsonText = await File.ReadAllTextAsync(filePath); // Deserializza direttamente nel dizionario - TradVocabulary = JsonConvert.DeserializeObject>(jsonText) ?? new(); + tempDict = JsonConvert.DeserializeObject>(jsonText) ?? new(); } + TradVocabulary = args.Where(chiave => tempDict.ContainsKey(chiave)) + .ToDictionary(chiave => chiave, chiave => tempDict[chiave]); } } diff --git a/WebWindowComplex/Compo/AreaFrame.razor.cs b/WebWindowComplex/Compo/AreaFrame.razor.cs index 281951d..9aaf5d7 100644 --- a/WebWindowComplex/Compo/AreaFrame.razor.cs +++ b/WebWindowComplex/Compo/AreaFrame.razor.cs @@ -52,12 +52,12 @@ namespace WebWindowComplex.Compo protected override async Task OnInitializedAsync() { - Dictionary AFDict = Vocabulary.Where(x => x.Key.Contains("CWAreaF_")).ToDictionary(x => x.Key, y => y.Value); - if (AFDict == null || AFDict.Count != 4) - { - List tradList = new List() { "CWAreaF_AreaFrame", "CWAreaF_AggSash", "CWAreaF_AggSplit", "CWAreaF_AggInglesina"}; - await EC_ReqTraduzione.InvokeAsync(tradList); - } + //Dictionary AFDict = Vocabulary.Where(x => x.Key.Contains("CWAreaF_")).ToDictionary(x => x.Key, y => y.Value); + //if (AFDict == null || AFDict.Count != 4) + //{ + // List tradList = new List() { "CWAreaF_AreaFrame", "CWAreaF_AggSash", "CWAreaF_AggSplit", "CWAreaF_AggInglesina"}; + // await EC_ReqTraduzione.InvokeAsync(tradList); + //} } protected override void OnParametersSet() diff --git a/WebWindowComplex/Compo/CardFill.razor.cs b/WebWindowComplex/Compo/CardFill.razor.cs index 46e7ae9..4f66266 100644 --- a/WebWindowComplex/Compo/CardFill.razor.cs +++ b/WebWindowComplex/Compo/CardFill.razor.cs @@ -55,12 +55,12 @@ namespace WebWindowComplex.Compo #region Protected Properties protected override async Task OnInitializedAsync() { - Dictionary FDict = Vocabulary.Where(x => x.Key.Contains("CWFill_")).ToDictionary(x => x.Key, y => y.Value); - if (FDict == null || FDict.Count != 3) - { - List tradList = new List() { "CWFill_Fill", "CWFill_Glass", "CWFill_Wood"}; - await EC_ReqTraduzione.InvokeAsync(tradList); - } + //Dictionary FDict = Vocabulary.Where(x => x.Key.Contains("CWFill_")).ToDictionary(x => x.Key, y => y.Value); + //if (FDict == null || FDict.Count != 3) + //{ + // List tradList = new List() { "CWFill_Fill", "CWFill_Glass", "CWFill_Wood"}; + // await EC_ReqTraduzione.InvokeAsync(tradList); + //} } protected override void OnParametersSet() diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 16792cd..a8a0034 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -80,12 +80,12 @@ namespace WebWindowComplex.Compo protected override async Task OnInitializedAsync() { - Dictionary fDict = Vocabulary.Where(x => x.Key.Contains("CWFrame_")).ToDictionary(x => x.Key, y => y.Value); - if(fDict == null || fDict.Count != 9) - { - List tradList = new List() { "CWFrame_Frame", "CWFrame_Shape", "CWFrame_Dimension", "CWFrame_Threshold", "CWFrame_Tipology", "CWFrame_BottomRail", "CWFrame_Quantity", "CWFrame_Joints", "CWFrame_Element" }; - await EC_ReqTraduzione.InvokeAsync(tradList); - } + //Dictionary fDict = Vocabulary.Where(x => x.Key.Contains("CWFrame_")).ToDictionary(x => x.Key, y => y.Value); + //if(fDict == null || fDict.Count != 9) + //{ + // List tradList = new List() { "CWFrame_Frame", "CWFrame_Shape", "CWFrame_Dimension", "CWFrame_Threshold", "CWFrame_Tipology", "CWFrame_BottomRail", "CWFrame_Quantity", "CWFrame_Joints", "CWFrame_Element" }; + // await EC_ReqTraduzione.InvokeAsync(tradList); + //} } protected override void OnParametersSet() diff --git a/WebWindowComplex/Compo/CardTree.razor.cs b/WebWindowComplex/Compo/CardTree.razor.cs index 6337a21..586048f 100644 --- a/WebWindowComplex/Compo/CardTree.razor.cs +++ b/WebWindowComplex/Compo/CardTree.razor.cs @@ -128,11 +128,11 @@ namespace WebWindowComplex.Compo protected override async Task OnInitializedAsync() { - if (Vocabulary == null || Vocabulary.Count != 6) - { - List tradList = new List() { "CWTree_Remove", "CWTree_Sash", "CWTree_Split", "CWTree_AddInglesina", "CWTree_AddSash", "CWTree_CopySash"}; - await EC_ReqTraduzione.InvokeAsync(tradList); - } + //if (Vocabulary == null || Vocabulary.Count != 6) + //{ + // List tradList = new List() { "CWTree_Remove", "CWTree_Sash", "CWTree_Split", "CWTree_AddInglesina", "CWTree_AddSash", "CWTree_CopySash" }; + // await EC_ReqTraduzione.InvokeAsync(tradList); + //} } protected override void OnParametersSet() diff --git a/WebWindowComplex/Data/Lemmi.json b/WebWindowComplex/Data/Lemmi.json index 72ff147..aba22cf 100644 --- a/WebWindowComplex/Data/Lemmi.json +++ b/WebWindowComplex/Data/Lemmi.json @@ -8,7 +8,7 @@ "CWFrame_Shape", "CWFrame_Threshold", "CWFrame_Tipology", - "CWFrame_AreaFrame", + "CWAreaF_AreaFrame", "CWAreaF_AggSash", "CWAreaF_AggSplit", "CWAreaF_AggInglesina", diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 8966e3a..56f185c 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -328,7 +328,7 @@ 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); @@ -425,6 +425,8 @@ namespace WebWindowComplex private List m_sashDimEditList = new List(); + private List prevLemmaList = new List(); + #endregion Private Fields #region Private Properties @@ -1022,7 +1024,12 @@ namespace WebWindowComplex private Task DoReqTraduzione(List lemmaList) { Log.Info("Richiesta Traduzione"); - return EC_ReqTraduzione.InvokeAsync(lemmaList); + if(!prevLemmaList.SequenceEqual(lemmaList)) + { + prevLemmaList = lemmaList; + return EC_ReqTraduzione.InvokeAsync(lemmaList); + } + return null; } /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index ee340f9..682e8bc 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.8.1812 + 3.1.8.1815 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -51,3 +51,16 @@ + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index d6e7fa4..eac9f60 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.8.1812 + 3.1.8.1815 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -52,3 +52,4 @@ +