NCXUtilityStandard.Globalization
1.21.2025.5
dotnet add package NCXUtilityStandard.Globalization --version 1.21.2025.5
NuGet\Install-Package NCXUtilityStandard.Globalization -Version 1.21.2025.5
<PackageReference Include="NCXUtilityStandard.Globalization" Version="1.21.2025.5" />
<PackageVersion Include="NCXUtilityStandard.Globalization" Version="1.21.2025.5" />
<PackageReference Include="NCXUtilityStandard.Globalization" />
paket add NCXUtilityStandard.Globalization --version 1.21.2025.5
#r "nuget: NCXUtilityStandard.Globalization, 1.21.2025.5"
#:package NCXUtilityStandard.Globalization@1.21.2025.5
#addin nuget:?package=NCXUtilityStandard.Globalization&version=1.21.2025.5
#tool nuget:?package=NCXUtilityStandard.Globalization&version=1.21.2025.5
NCXUtilityStandard.Globalization
Libreria .NET Standard 2.1 per gestire testi e messaggi localizzati nelle applicazioni NeoCodex.
Funzionalità
- caricamento delle traduzioni da file JSON, database SQL Server o collezioni di oggetti;
- selezione automatica della lingua dalla cultura corrente, con possibilità di impostarla esplicitamente;
- accesso ai testi tramite chiave e cultura;
- formattazione dei testi localizzati con parametri;
- fallback leggibile quando una traduzione non è disponibile;
- generazione di eccezioni localizzate, anche in formato HTML;
- ricaricamento delle traduzioni durante l'esecuzione.
Configurazione
La libreria può leggere le impostazioni dal file ncx-globalization-settings.json nella directory dell'applicazione:
{
"Files": [
"Languages/en.json",
"Languages/it-IT.json"
]
}
Ogni file rappresenta una cultura e contiene un dizionario chiave-valore:
{
"Lbl_Welcome": "Benvenuto",
"Msg_Items": "Sono presenti {0} elementi"
}
In alternativa, LanguageSettings permette di configurare una tabella SQL Server oppure una collezione di oggetti indicando le proprietà che contengono cultura, chiave e testo.
Utilizzo
using NCXUtilityStandard.Globalization;
LanguageHelper.InitLanguages();
LanguageHelper.UserCultureLanguage = "it-IT";
string title = LanguageHelper.GetLanguageValue("Lbl_Welcome");
string message = LanguageHelper.GetLanguageValueFormat("Msg_Items", new object[] { 5 });
È possibile configurare le sorgenti anche direttamente da codice:
LanguageHelper.InitLanguages(settings =>
{
settings.Files = new[]
{
"Languages/en.json",
"Languages/it-IT.json"
};
});
Comportamento delle chiavi mancanti
Se una chiave non è tradotta, viene restituita la chiave stessa. Per le chiavi contenenti un prefisso seguito da _, viene restituita la parte successiva al primo carattere _.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Microsoft.Data.SqlClient (>= 7.0.3)
- NCXUtilityStandard (>= 1.21.2026.5)
- Newtonsoft.Json (>= 13.0.4)
- System.Buffers (>= 4.6.1)
- System.Configuration.ConfigurationManager (>= 10.0.12)
- System.Net.Http.WinHttpHandler (>= 10.0.12)
- System.Security.AccessControl (>= 6.0.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on NCXUtilityStandard.Globalization:
| Package | Downloads |
|---|---|
|
NCXWinFormControlLibrary
Windows Form libraries NeocodeX |
|
|
NCXWinFormControlLibraryCore
WinForm Control Library Core NeocodeX |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.21.2025.5 | 125 | 10/11/2026 |
| 1.21.2025.4 | 103 | 10/11/2026 |
| 1.21.2025.3 | 126 | 9/16/2026 |
| 1.21.2025.2 | 113 | 9/16/2026 |
| 1.21.2025.1 | 286 | 1/25/2025 |
| 1.21.2024.4 | 278 | 10/27/2024 |
| 1.21.2024.3 | 271 | 6/25/2024 |
| 1.21.2024.2 | 310 | 4/6/2024 |
| 1.20.2025.1 | 261 | 1/25/2025 |
| 1.20.2024.1 | 328 | 1/26/2024 |
| 1.20.2023.8 | 392 | 10/15/2023 |
| 1.20.2023.7 | 274 | 5/30/2023 |
| 1.20.0.6 | 1,028 | 11/2/2022 |
| 1.20.0.5 | 502 | 11/2/2022 |
| 1.20.0.4 | 707 | 8/29/2022 |
| 1.20.0.3 | 548 | 8/29/2022 |