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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NCXUtilityStandard.Globalization" Version="1.21.2025.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NCXUtilityStandard.Globalization" Version="1.21.2025.5" />
                    
Directory.Packages.props
<PackageReference Include="NCXUtilityStandard.Globalization" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NCXUtilityStandard.Globalization --version 1.21.2025.5
                    
#r "nuget: NCXUtilityStandard.Globalization, 1.21.2025.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NCXUtilityStandard.Globalization@1.21.2025.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NCXUtilityStandard.Globalization&version=1.21.2025.5
                    
Install as a Cake Addin
#tool nuget:?package=NCXUtilityStandard.Globalization&version=1.21.2025.5
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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