Ramstack.LocaleAlignment
2.0.1
dotnet add package Ramstack.LocaleAlignment --version 2.0.1
NuGet\Install-Package Ramstack.LocaleAlignment -Version 2.0.1
<PackageReference Include="Ramstack.LocaleAlignment" Version="2.0.1" />
<PackageVersion Include="Ramstack.LocaleAlignment" Version="2.0.1" />
<PackageReference Include="Ramstack.LocaleAlignment" />
paket add Ramstack.LocaleAlignment --version 2.0.1
#r "nuget: Ramstack.LocaleAlignment, 2.0.1"
#:package Ramstack.LocaleAlignment@2.0.1
#addin nuget:?package=Ramstack.LocaleAlignment&version=2.0.1
#tool nuget:?package=Ramstack.LocaleAlignment&version=2.0.1
Ramstack.LocaleAlignment
A small runtime helper for applying 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 provides a small runtime API that explicitly aligns
.NET culture settings with POSIX locale category overrides.
When invoked at application startup, it:
- Detects whether the application is running on a Unix-like 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
Call the alignment method as early as possible during application startup:
LocaleAlignment.Apply();
This package requires an explicit call. If you prefer automatic initialization via source generation, see Ramstack.LocaleAlignment.Generator.
No additional configuration or code changes are required.
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.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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. |
-
net6.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.