Ramstack.LocaleAlignment 2.0.1

dotnet add package Ramstack.LocaleAlignment --version 2.0.1
                    
NuGet\Install-Package Ramstack.LocaleAlignment -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" 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" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Ramstack.LocaleAlignment" />
                    
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 --version 2.0.1
                    
#r "nuget: Ramstack.LocaleAlignment, 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@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&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Ramstack.LocaleAlignment&version=2.0.1
                    
Install as a Cake Tool

Ramstack.LocaleAlignment

NuGet MIT

A small runtime helper for applying 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 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_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

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
2.0.1 31 1/29/2026
2.0.0 37 1/29/2026