Net.LocalizeMessagesAndErrors 9.0.0

dotnet add package Net.LocalizeMessagesAndErrors --version 9.0.0                
NuGet\Install-Package Net.LocalizeMessagesAndErrors -Version 9.0.0                
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="Net.LocalizeMessagesAndErrors" Version="9.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Net.LocalizeMessagesAndErrors --version 9.0.0                
#r "nuget: Net.LocalizeMessagesAndErrors, 9.0.0"                
#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.
// Install Net.LocalizeMessagesAndErrors as a Cake Addin
#addin nuget:?package=Net.LocalizeMessagesAndErrors&version=9.0.0

// Install Net.LocalizeMessagesAndErrors as a Cake Tool
#tool nuget:?package=Net.LocalizeMessagesAndErrors&version=9.0.0                

Net.LocalizeMessagesAndErrors

This library provides extra code to make it easier to support in different languages in your .NET application (known as localization in .NET). The code in this library wraps the .NET's localization services with a nicer front-end that makes the localization parts easier to code and understand. Its especialy useful if you are creating a library, as the library can be tried straight away without having to set up ASP.NET Core's localization.

This library is an open-source library under the MIT licence and the NuGet package can be found here. The documentation can be found in the GitHub wiki and see ReleaseNotes for details of changes.

List of versions and which .NET framework they support

The versions of this library has changed to make it easier to create a new version when a new release of .NET farmework. Now the first number defines the .NET version, e.g EfCore.TestSupport version 8.?.? only runs on .NET 8.

  • Version 9.?.?: supports NET 9 only (simpler to update to next NET release)
  • Version 8.?.?: supports NET 8 only (simpler to update to next NET release)
  • Version 2.?.?: Supports NET 6, 7 and 8
  • Version 1.0.?: Supports NET 6 and 7

Why I built this library

A user of the of my library AuthPermissions.AspNetCore (shortened to AuthP) wanted support for multiple languages (known as localization) added. I looked at the .NET localization service and here the main issues I had:

  1. Makes your code harder to understand: The .NET's Localization replaces the message string to represent a message, which makes the code harder to understand, e.g. the error message �When using sharding the the hasOwnDb parameter must not be null.� would become a key something like �ShardingHasOwnDb�.
  2. Makes it harder add localization to an existing app: Localization isn�t usually added at the start of a project (see MVP - Minimum Viable Product approach) so you most likely have code with messages built into your code at to start. .NET's Localization requires to remove the messages in your code and put them in the resource files - that's a lot of work.
  3. Missing localized messages doesn't provide a good user experience: If you don't add a localizes message to the resource files, the the .NET localisation shows the key, e.g. �ShardingHasOwnDb�, which isn�t that useful to a user.
  4. Makes a NuGet library hard to use / understand: Using a NuGet library that uses .NET's Localization would force you to set up the localization and it's resource files, which instantly makes the library hard to setup and understand.

It took me some time to design a library called Net.LocalizeMessagesAndErrors that solves issues above (and more). Plus, using the library on my AuthP library (which has hundreds of errors / messages) provides lots feedback on the best design for the library.

You can find list of the improvements that this library provides better handling localization in .NET applications.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Net.LocalizeMessagesAndErrors:

Package Downloads
AuthPermissions.AspNetCore

Provides extra authorization and multi-tenant features to an ASP.NET Core application.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Net.LocalizeMessagesAndErrors:

Repository Stars
JonPSmith/AuthPermissions.AspNetCore
This library provides extra authorization and multi-tenant features to an ASP.NET Core application.
Version Downloads Last updated
9.0.0 240 11/21/2024
8.0.0 8,364 4/10/2024
2.0.0 9,376 11/22/2023
1.0.0 18,700 12/31/2022

- .NET 9 version