Ramstack.LocaleAlignment.Generator 2.0.1

dotnet add package Ramstack.LocaleAlignment.Generator --version 2.0.1
                    
NuGet\Install-Package Ramstack.LocaleAlignment.Generator -Version 2.0.1
                    
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="Ramstack.LocaleAlignment.Generator" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ramstack.LocaleAlignment.Generator" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Ramstack.LocaleAlignment.Generator" />
                    
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 Ramstack.LocaleAlignment.Generator --version 2.0.1
                    
#r "nuget: Ramstack.LocaleAlignment.Generator, 2.0.1"
                    
#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 Ramstack.LocaleAlignment.Generator@2.0.1
                    
#: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=Ramstack.LocaleAlignment.Generator&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Ramstack.LocaleAlignment.Generator&version=2.0.1
                    
Install as a Cake Tool

Ramstack.LocaleAlignment.Generator

NuGet MIT

Utility that applies POSIX locale user overrides to .NET CultureInfo on Unix-like systems.

screenshot

Problem

On Unix-like systems, .NET determines the process culture using only a subset of locale-related environment variables (LC_ALL, LC_MESSAGES, LANG).

Category-specific overrides such as LC_NUMERIC, LC_TIME, and LC_MONETARY are not applied during CultureInfo initialization.

This behavior is documented and discussed in the .NET runtime repository:

What this package does

Ramstack.LocaleAlignment.Generator provides a source generator that injects a module initializer into your application.

At startup, it:

  • Detects whether the application is running on a non-Windows platform
  • Applies the following environment variables to CultureInfo:
    • LC_NUMERIC
    • LC_MONETARY
    • LC_TIME
  • Updates the current and default thread cultures
  • Respects .NET globalization invariant mode

Has no effect on Windows platforms.

Usage

Add the package to your project:

dotnet add package Ramstack.LocaleAlignment.Generator

No additional configuration or code changes are required.

The generated initializer runs automatically at module load time.

Supported versions

Version
.NET 6, 7, 8, 9, 10

Contributions

Bug reports and contributions are welcome.

License

This package is released as open source under the MIT License.<br /> See the LICENSE file for more details.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 40 1/29/2026