Linguini is a C# implementation of Project Fluent, a localization system for natural-sounding translations with features like:
Natural-sounding translations with genders and grammatical cases only when necessary. Expressiveness is not limited by the grammar of the source language.
Translations are isolated; locale-specific logic doesn't leak to other locales. Authors can iteratively improve translations without impact on other languages.
Linguini is highly modular. You only can use the parts you need. Need just parsing? Get Linguni.Syntax. Need only Plural Rules data? Get PluralRules.Generator and connect to XML CLDR Plural rules data.
Linguini uses a zero-copy parser to parse the resources. While at the moment there are no benchmarks, it is used by RobustToolbox as as a localization framework.
To install the Fluent Bundle type in your console:
dotnet add package Linguini.Bundle
You can also follow other NuGet installation instructions.
For a 2 minute tour of Linguini add this to your C# code:
var bundler = LinguiniBuilder.Builder()
.CultureInfo(new CultureInfo("en"))
.AddResource("hello-user = Hello, { $username }!")
.SetUseIsolating(false)
.UncheckedBuild();
var props = new Dictionary<string, IFluentType>()
{
{"username", (FluentString)"Test"}
};
var message = bundler.GetAttrMessage("hello-user", props);
Assert.AreEqual("Hello, Test!", message);For more details see Fluent syntax guide.
Linguini Bundle and associated projects are licensed under Apache and MIT licenses. Consult the LICENSE-MIT and LICENSE-APACHE for more detail.