Fix traduzioni
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
FillList="FillList"
|
||||
FrameWindow="FrameWindow"
|
||||
BaseUser="BaseUser"
|
||||
Vocabulary="@(RestrictDict(new List<string>(){"CWTree_"}))"
|
||||
Vocabulary="CurrVocabulary"
|
||||
EC_NextStep="NextStepArgs"
|
||||
EC_Remove="RemoveArea"
|
||||
EC_Collapsed="CollapsedRowTree"
|
||||
@@ -136,7 +136,7 @@
|
||||
<CascadingValue Value="FrameWindow" Name="CurrFrameWindow">
|
||||
<CascadingValue Value="SashGroupList" Name="SashGroupList">
|
||||
<CascadingValue Value="SplitList" Name="SplitList">
|
||||
<CascadingValue Value="Vocabulary" Name="Vocabulary">
|
||||
<CascadingValue Value="CurrVocabulary" Name="Vocabulary">
|
||||
<CardFrame EC_ReqResetDict="ReqResetDict"
|
||||
EC_ReqOptionHw="UpdateHwOptionsFrame"
|
||||
EC_ReqElement="UpdateElementFrame"
|
||||
@@ -235,7 +235,7 @@
|
||||
<CardFill CurrIndex="currFillIndex"
|
||||
CurrFill="FillList[currFillIndex]"
|
||||
BaseUser="BaseUser"
|
||||
Vocabulary="Vocabulary"
|
||||
Vocabulary="CurrVocabulary"
|
||||
EC_UpdateFill="UpdatePreviewFill"
|
||||
EC_ReqClose="ReturnTree"
|
||||
EC_ReqTraduzione="DoReqTraduzione">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.8.1415</Version>
|
||||
<Version>3.1.8.1416</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
|
||||
@@ -248,6 +248,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.8.1415</Version>
|
||||
<Version>3.1.8.1416</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -565,6 +565,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user