MessageFormat
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.
Install
dotnet add package MessageFormat --version 0.1.3
Install-Package MessageFormat -Version 0.1.3
<PackageReference Include="MessageFormat" Version="0.1.3" />
Frameworks
No framework metadata available.
Dependencies
No declared dependencies.
Adoption guide
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.
No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.
How to read this guidance
Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.
Useful next steps
Move from package metadata to a concrete selection or review workflow.