From 23ad75e11d9097cf984ece440b9c189bde3bb8ac Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 4 Jun 2026 13:02:34 +0200 Subject: [PATCH] Bozza traduzione realtime da selezione alto/dx --- Lux.API/Lux.API.csproj | 2 +- Lux.All.sln | 2 +- Lux.UI/Components/BaseComp.cs | 22 +++++++++---------- Lux.UI/Components/Compo/Admin/VocabMan.razor | 4 +++- .../Components/Compo/Common/CmpHeader.razor | 16 ++++++++++++++ .../Compo/Common/CmpHeader.razor.cs | 19 ++++++++++++++++ Lux.UI/Components/Layout/MainLayout.razor | 17 ++++---------- Lux.UI/Components/Layout/MainLayout.razor.cs | 15 +++++++++++++ Lux.UI/Components/Layout/NavMenu.razor.cs | 5 ----- Lux.UI/Components/Pages/Vocabulary.razor.cs | 6 ++--- Lux.UI/Lux.UI.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 14 files changed, 77 insertions(+), 39 deletions(-) create mode 100644 Lux.UI/Components/Compo/Common/CmpHeader.razor create mode 100644 Lux.UI/Components/Compo/Common/CmpHeader.razor.cs diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 30b2272d..43a52c42 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2606.0412 + 1.1.2606.0413 diff --git a/Lux.All.sln b/Lux.All.sln index c1e91c85..6ceb1c0d 100644 --- a/Lux.All.sln +++ b/Lux.All.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.5.11801.241 oobstable +VisualStudioVersion = 18.5.11801.241 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwCoreLib.Lux.Core", "EgwCoreLib.Lux.Core\EgwCoreLib.Lux.Core.csproj", "{CCE87D58-1E6C-47B3-A28C-65BFCF5F1D0C}" EndProject diff --git a/Lux.UI/Components/BaseComp.cs b/Lux.UI/Components/BaseComp.cs index a093a20c..021cdc3e 100644 --- a/Lux.UI/Components/BaseComp.cs +++ b/Lux.UI/Components/BaseComp.cs @@ -2,6 +2,16 @@ { public abstract class BaseComp : ComponentBase { + #region Public Properties + + /// + /// Lingua corrente (da rivedere con Cascading Parameters + /// + [CascadingParameter(Name = "LangSel")] + public string LangSel { get; set; } = "IT"; + + #endregion Public Properties + #region Protected Properties [Inject] @@ -15,24 +25,14 @@ /// Gestione traduzione interfaccia con lingua corrente /// /// - /// /// protected string Traduci(string lemma) { - return VService.Traduci(lemma, lingua); + return VService.Traduci(lemma, LangSel); } #endregion Protected Methods - #region Private Fields - - /// - /// Lingua corrente (da rivedere con Cascading Parameters - /// - private string lingua = "IT"; - - #endregion Private Fields - #region Private Properties [Inject] diff --git a/Lux.UI/Components/Compo/Admin/VocabMan.razor b/Lux.UI/Components/Compo/Admin/VocabMan.razor index 66b90cc3..8cd027b3 100644 --- a/Lux.UI/Components/Compo/Admin/VocabMan.razor +++ b/Lux.UI/Components/Compo/Admin/VocabMan.razor @@ -46,8 +46,10 @@ { - +
+ +
@item.Lemma diff --git a/Lux.UI/Components/Compo/Common/CmpHeader.razor b/Lux.UI/Components/Compo/Common/CmpHeader.razor new file mode 100644 index 00000000..480a1d90 --- /dev/null +++ b/Lux.UI/Components/Compo/Common/CmpHeader.razor @@ -0,0 +1,16 @@ +
+ +
+
+
+ +
+
+ + diff --git a/Lux.UI/Components/Compo/Common/CmpHeader.razor.cs b/Lux.UI/Components/Compo/Common/CmpHeader.razor.cs new file mode 100644 index 00000000..4d48e791 --- /dev/null +++ b/Lux.UI/Components/Compo/Common/CmpHeader.razor.cs @@ -0,0 +1,19 @@ +namespace Lux.UI.Components.Compo.Common +{ + public partial class CmpHeader + { + [Parameter] + public string CurrLang { get; set; } = null!; + + + + [Parameter] + public EventCallback EC_LangSelected { get; set; } + + private Task SaveLang() + { + return EC_LangSelected.InvokeAsync(CurrLang); + } + + } +} \ No newline at end of file diff --git a/Lux.UI/Components/Layout/MainLayout.razor b/Lux.UI/Components/Layout/MainLayout.razor index 4ae0d026..487ac5d9 100644 --- a/Lux.UI/Components/Layout/MainLayout.razor +++ b/Lux.UI/Components/Layout/MainLayout.razor @@ -7,22 +7,13 @@
- @*About*@ -
-
- About -
-
-
-
- - -
-
+
- @Body + + @Body +
diff --git a/Lux.UI/Components/Layout/MainLayout.razor.cs b/Lux.UI/Components/Layout/MainLayout.razor.cs index 8a02206b..8f6d55cf 100644 --- a/Lux.UI/Components/Layout/MainLayout.razor.cs +++ b/Lux.UI/Components/Layout/MainLayout.razor.cs @@ -20,8 +20,23 @@ namespace Lux.UI.Components.Layout #region Private Fields + private string currLang = "IT"; + private bool navLarge = true; #endregion Private Fields + + #region Private Methods + + /// + /// Imposta LangSel selezionata + /// + /// + private void SetLang(string newLang) + { + currLang = newLang; + } + + #endregion Private Methods } } \ No newline at end of file diff --git a/Lux.UI/Components/Layout/NavMenu.razor.cs b/Lux.UI/Components/Layout/NavMenu.razor.cs index 173e6fa7..0a92cdfb 100644 --- a/Lux.UI/Components/Layout/NavMenu.razor.cs +++ b/Lux.UI/Components/Layout/NavMenu.razor.cs @@ -34,11 +34,6 @@ namespace Lux.UI.Components.Layout #endregion Protected Properties - //private string Traduci(string lemma, string lingua = "IT") - //{ - // return VService.Traduci(lingua, lemma); - //} - #region Protected Methods protected override void OnInitialized() diff --git a/Lux.UI/Components/Pages/Vocabulary.razor.cs b/Lux.UI/Components/Pages/Vocabulary.razor.cs index b1749e3f..ce38b029 100644 --- a/Lux.UI/Components/Pages/Vocabulary.razor.cs +++ b/Lux.UI/Components/Pages/Vocabulary.razor.cs @@ -53,7 +53,7 @@ namespace Lux.UI.Components.Pages { if (currRec != null) { - // genero 1 rec x ogni lingua + // genero 1 rec x ogni LangSel var listNew = ListLingue.Select(x => new VocabolarioModel() { Lingua = x.Lingua, @@ -90,7 +90,7 @@ namespace Lux.UI.Components.Pages private async Task DoCloneLang(string origLang) { mTitle = "Attenzione"; - mMessage = "Sicuro di voler duplicare il vocabolario della lingua selezionata?\n" + + mMessage = "Sicuro di voler duplicare il vocabolario della LangSel selezionata?\n" + $"Sorgente: {origLang}"; mMode = BootstrapModal.ModalMode.Confirm; modalOpt = new(); @@ -99,7 +99,7 @@ namespace Lux.UI.Components.Pages if (!await Modal!.ShowAsync()) return; - // dovrebbe chiedere nuova lingua... + // dovrebbe chiedere nuova LangSel... string destLang = "FR"; // ora duplica... await VService.CloneAsync(origLang, destLang); diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index bdab922d..f3e74af3 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 1.1.2606.0412 + 1.1.2606.0413 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index efad7132..534d8bc9 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 1.1.2606.0412

+

Versione: 1.1.2606.0413


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index d503d4e4..97b94a1a 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2606.0412 +1.1.2606.0413 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index a51961bd..7f7925a6 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2606.0412 + 1.1.2606.0413 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false