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
<PackageReference Include="Ramstack.LocaleAlignment.Generator" Version="2.0.1" />
<PackageVersion Include="Ramstack.LocaleAlignment.Generator" Version="2.0.1" />
<PackageReference Include="Ramstack.LocaleAlignment.Generator" />
paket add Ramstack.LocaleAlignment.Generator --version 2.0.1
#r "nuget: Ramstack.LocaleAlignment.Generator, 2.0.1"
#:package Ramstack.LocaleAlignment.Generator@2.0.1
#addin nuget:?package=Ramstack.LocaleAlignment.Generator&version=2.0.1
#tool nuget:?package=Ramstack.LocaleAlignment.Generator&version=2.0.1
Ramstack.LocaleAlignment.Generator
Utility that applies POSIX locale user overrides to .NET CultureInfo on Unix-like systems.

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_NUMERICLC_MONETARYLC_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.
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 |