MessageFormat 0.1.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package MessageFormat --version 0.1.3
                    
NuGet\Install-Package MessageFormat -Version 0.1.3
                    
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="MessageFormat" Version="0.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MessageFormat" Version="0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="MessageFormat" />
                    
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 MessageFormat --version 0.1.3
                    
#r "nuget: MessageFormat, 0.1.3"
                    
#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 MessageFormat@0.1.3
                    
#: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=MessageFormat&version=0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=MessageFormat&version=0.1.3
                    
Install as a Cake Tool

PHP has it. Java has it. Even JavaScript has it. It's time .NET joined in with support for the ICU Message Format.

How would you format "He found 1 result in 4 categories", or "She found 3 results in 1 category" without bloating your code with a billion if-statements? And when you have to translate it, then what?

How about something like:

var pattern = @"{Gender, select,
 male {He}
 female {She}
 other {They}
} found {ResultCount, plural,
  zero {no results}
  one {one result}
  other {# results}
} in {CategoryCount, plural,
  zero {0 categories}
  one {one category}
  other {# categories}
}.";

var mf = new MessageFormatter();
var result = mf.FormatMessage(pattern, new {
 Gender = "male",
 ResultsCount = 3,
 CategoriesCount = 1
});

Check the README for more information.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on MessageFormat:

Package Downloads
BioEngine.Core

Package Description

Shinya.Core

Shinya.Framework

Tp.I18n

Public interfaces for Targetprocess internationalization

I18Next.Net.ICU

Package Description

Microsoft.UI.Reactor

Functional, declarative UI framework for WinUI 3.

GitHub repositories (6)

Showing the top 6 popular GitHub repositories that depend on MessageFormat:

Repository Stars
files-community/Files
A modern file manager that helps users organize their files and folders.
Devolutions/UniGetUI
UniGetUI: The Graphical Interface for your package managers. Could be terribly described as a package manager manager to manage your package managers
microsoft/microsoft-ui-reactor
Reactor is an experimental set of extensions to WinUI
hpavlo/Rememory
Rememory | Clipboard Manager
Anthonyy232/Nagi
Rediscover your local music collection with Nagi, a music player focused on speed, simplicity, and privacy. Nagi is built with C# and WinUI 3 to offer a clean, native Fluent experience. It's beautiful, efficient, and respects your privacy.
5cover/WinClean
Windows optimization and debloating utility.
Version Downloads Last Updated
8.0.0 97,599 2/23/2026
7.1.3 219,231 3/3/2025
7.1.2 87,101 10/14/2024
7.1.1 8,886 9/28/2024
7.1.0 275,955 10/11/2023
7.0.0 20,361 8/22/2023
6.0.2 50,969 1/1/2023
6.0.1 925 12/23/2022
6.0.0 126,002 1/15/2022
5.0.1 69,550 4/27/2021
5.0.0 6,362 4/26/2021
4.0.0 115,237 12/5/2020
3.0.1 2,009,485 7/11/2018
3.0.0 2,239 7/10/2018
2.1.0 70,186 3/19/2018
2.0.1 23,578 6/27/2017
2.0.0 32,893 4/26/2017
1.1.0 8,180 1/12/2017
1.0.2 89,682 10/1/2015
0.1.3 2,036 12/6/2014
Loading failed