ApricotFramework.Intl.AspNetCore 0.1.0

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

ApricotFramework.Intl

NuGet NuGet CI License

Message localization for .NET. Look a message up by id for a locale and substitute named placeholders into it, over translation sources you supply.

ApricotFramework.Intl is the zero-dependency core. ApricotFramework.Intl.AspNetCore adds dependency-injection wiring, request-based locale resolution, JSON translation sources, and an IStringLocalizer bridge so Razor and DataAnnotations localize from the same files.

Install

dotnet add package ApricotFramework.Intl

For ASP.NET Core applications, install the integration package instead — it brings the core with it:

dotnet add package ApricotFramework.Intl.AspNetCore

Usage

// Program.cs
using ApricotFramework.Intl.AspNetCore;

builder.Services.AddIntlCore(builder.Configuration);
builder.Services.AddJsonTranslationSource("en-US", () => File.OpenRead("Translations/all.en.json"));
builder.Services.AddJsonTranslationSource("hy-AM", () => File.OpenRead("Translations/all.hy.json"));
// anywhere IIntlService is injected
var hello = intl.Format("messages.hello");
var welcome = intl.Format("messages.welcome", new Dictionary<string, object?> { ["name"] = "Apricot" });
var explicitLocale = intl.Format("messages.hello", "hy-AM");

Registration order does not matter, as long as everything is registered before the container is built.

Locale names are matched case-insensitively, and a locale with no entry is retried without its last subtag before the fallback locale is tried — so hy-AM resolves against hy if that is what you registered, and a matching language always beats the fallback language. See the documentation for the full resolution order.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

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
0.1.0 158 8/12/2026