A small library for aligning .NET culture settings with POSIX locale user overrides on Unix-like systems.
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:
This repository contains two packages:
A small runtime library that explicitly applies POSIX locale category overrides to .NET CultureInfo.
It is intended to be called manually during application startup and can be used from any .NET language (C#, F#, Nemerle, etc.).
A dependency-free Roslyn source generator that enables automatic locale alignment at application startup.
The generator injects the equivalent of a LocaleAlignment.Apply() call directly into the compiled output,
without introducing any runtime dependency or requiring any configuration.
| Version | |
|---|---|
| .NET | 6, 7, 8, 9, 10 |
Bug reports and contributions are welcome.
This package is released as open source under the MIT License.
See the LICENSE file for more details.
