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
+7 -2
View File
@@ -52,14 +52,19 @@ namespace WebWindowComplex.Compo
protected override async Task OnInitializedAsync()
{
AreaFDict = Vocabulary.Where(x => x.Key.Contains("CWAreaF_")).ToDictionary(x => x.Key, y => y.Value);
if (AreaFDict == null || AreaFDict.Count != 4)
Dictionary<string, string> AFDict = Vocabulary.Where(x => x.Key.Contains("CWAreaF_")).ToDictionary(x => x.Key, y => y.Value);
if (AFDict == null || AFDict.Count != 4)
{
List<string> tradList = new List<string>() { "CWAreaF_AreaFrame", "CWAreaF_AggSash", "CWAreaF_AggSplit", "CWAreaF_AggInglesina"};
await EC_ReqTraduzione.InvokeAsync(tradList);
}
}
protected override void OnParametersSet()
{
AreaFDict = Vocabulary.Where(x => x.Key.Contains("CWAreaF_")).ToDictionary(x => x.Key, y => y.Value);
}
#endregion Protected Properties
private Dictionary<string, string> AreaFDict = new();
+12 -4
View File
@@ -55,15 +55,23 @@ namespace WebWindowComplex.Compo
#region Protected Properties
protected override async Task OnInitializedAsync()
{
Dictionary<string, string> FillDict = Vocabulary.Where(x => x.Key.Contains("CWFill_")).ToDictionary(x => x.Key, y => y.Value);
if (FillDict == null || FillDict.Count != 3)
Dictionary<string, string> FDict = Vocabulary.Where(x => x.Key.Contains("CWFill_")).ToDictionary(x => x.Key, y => y.Value);
if (FDict == null || FDict.Count != 3)
{
List<string> tradList = new List<string>() { "CWFill_Fill", "CWFill_Glass", "CWFill_Wood"};
await EC_ReqTraduzione.InvokeAsync(tradList);
}
}
protected override void OnParametersSet()
{
FillDict = Vocabulary.Where(x => x.Key.Contains("CWFill_")).ToDictionary(x => x.Key, y => y.Value);
}
#endregion Protected Properties
private Dictionary<string, string> FillDict = new();
#region Private Methods
/// <summary>
@@ -102,9 +110,9 @@ namespace WebWindowComplex.Compo
private string Traduci(string lemma)
{
string ans = lemma;
if (Vocabulary != null && Vocabulary.ContainsKey(lemma))
if (FillDict != null && FillDict.ContainsKey(lemma))
{
ans = Vocabulary.GetValueOrDefault(lemma) ?? "";
ans = FillDict.GetValueOrDefault(lemma) ?? "";
}
return ans;
}
+11 -4
View File
@@ -80,16 +80,23 @@ namespace WebWindowComplex.Compo
protected override async Task OnInitializedAsync()
{
Dictionary<string, string> FrameDict = Vocabulary.Where(x => x.Key.Contains("CWFrame_")).ToDictionary(x => x.Key, y => y.Value);
if(FrameDict == null || FrameDict.Count != 9)
Dictionary<string, string> fDict = Vocabulary.Where(x => x.Key.Contains("CWFrame_")).ToDictionary(x => x.Key, y => y.Value);
if(fDict == null || fDict.Count != 9)
{
List<string> tradList = new List<string>() { "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()
{
FrameDict = Vocabulary.Where(x => x.Key.Contains("CWFrame_")).ToDictionary(x => x.Key, y => y.Value);
}
#endregion Protected Properties
private Dictionary<string, string> FrameDict = new();
#region Private Properties
private string GetImageFrameShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/frame/shape/{fileName}.svg";
private string GetImageJointShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/joint/shape/All/{fileName}.svg";
@@ -421,9 +428,9 @@ namespace WebWindowComplex.Compo
private string Traduci(string lemma)
{
string ans = lemma;
if (Vocabulary != null && Vocabulary.ContainsKey(lemma))
if (FrameDict != null && FrameDict.ContainsKey(lemma))
{
ans = Vocabulary.GetValueOrDefault(lemma) ?? "";
ans = FrameDict.GetValueOrDefault(lemma) ?? "";
}
return ans;
}