Modifica per traduzioni
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
using System.Text.Json;
|
||||
using System.Reflection;
|
||||
using WebWindowComplex.Compo;
|
||||
using WebWindowComplex.DTO;
|
||||
using WebWindowComplex.Json;
|
||||
@@ -161,23 +160,29 @@ namespace WebWindowComplex
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"Data", "Lemmi.json");
|
||||
|
||||
if (File.Exists(filePath))
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
string? resourceName = assembly.GetManifestResourceNames()
|
||||
.FirstOrDefault(r => r.EndsWith("Lemmi.json", StringComparison.OrdinalIgnoreCase));
|
||||
using Stream? stream = assembly.GetManifestResourceStream(resourceName);
|
||||
if (stream == null)
|
||||
{
|
||||
string jsonText = await File.ReadAllTextAsync(filePath);
|
||||
List<string>? tradList = JsonConvert.DeserializeObject<List<string>>(jsonText);
|
||||
if(tradList != null)
|
||||
Log.Info("File Json non trovato");
|
||||
}
|
||||
else
|
||||
{
|
||||
using StreamReader reader = new StreamReader(stream);
|
||||
string jsonContent = await reader.ReadToEndAsync();
|
||||
|
||||
List<string>? tradList = JsonConvert.DeserializeObject<List<string>>(jsonContent);
|
||||
|
||||
if (tradList != null)
|
||||
{
|
||||
Log.Info("Richiesta Traduzione");
|
||||
prevReqTrad = true;
|
||||
await EC_ReqTraduzione.InvokeAsync(tradList);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Info("File Json non trovato");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.8.1811</Version>
|
||||
<Version>3.1.8.1812</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
|
||||
@@ -14,13 +14,13 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="Data\Lemmi.json" />
|
||||
<Content Include="Data\Lemmi.json">
|
||||
<EmbeddedResource Include="Data\Lemmi.json">
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>content\Data</PackagePath>
|
||||
<PackageCopyToOutput>true</PackageCopyToOutput>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -46,3 +46,8 @@
|
||||
</Project>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.8.1811</Version>
|
||||
<Version>3.1.8.1812</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -38,3 +38,17 @@
|
||||
</Project>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user