MessageFormat 0.1.2
See the version list below for details.
dotnet add package MessageFormat --version 0.1.2
NuGet\Install-Package MessageFormat -Version 0.1.2
<PackageReference Include="MessageFormat" Version="0.1.2" />
paket add MessageFormat --version 0.1.2
#r "nuget: MessageFormat, 0.1.2"
// Install MessageFormat as a Cake Addin
#addin nuget:?package=MessageFormat&version=0.1.2
// Install MessageFormat as a Cake Tool
#tool nuget:?package=MessageFormat&version=0.1.2
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.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
GitHub repositories (4)
Showing the top 4 popular GitHub repositories that depend on MessageFormat:
Repository | Stars |
---|---|
microsoft/devhome
The new Dev Home experience for Windows!
|
|
revenz/FileFlows
FileFlows is a file processing application that can execute actions against a file in a tree flow structure.
|
|
microsoft/devhomegithubextension
Dev Home GitHub Extension
|
|
5cover/WinClean
Windows optimization and debloating utility.
|
0.1.2: Hoping NuGet picks up the DLL this time.