Mirror of space-wizards/Linguini
Find a file
Ygg01 b3c05c2f31
Merge pull request #2 from space-wizards/21-09-15-fix-version-warn
Make PluralRules.Generator.csproj use stable Microsoft.CodeAnalysis.CSharp
2021-09-15 16:11:41 +02:00
.github/workflows Fix Github Actions 2021-07-20 17:49:10 +02:00
Linguini.Bundle Fix issue with strings not being properlly escaped 2021-07-22 00:53:03 +02:00
Linguini.Bundle.Test Fix issue with strings not being properlly escaped 2021-07-22 00:53:03 +02:00
Linguini.Shared Fix issue with strings not being properlly escaped 2021-07-22 00:53:03 +02:00
Linguini.Syntax Update version on Nuget 2021-07-19 19:58:56 +02:00
Linguini.Syntax.Tests Fix Github Actions 2021-07-20 17:49:10 +02:00
PluralRules.Generator Make PluralRules.Generator.csproj use stable Microsoft.CodeAnalysis.CSharp 2021-09-15 16:05:55 +02:00
PluralRules.Test Fix nits and improve test coverage 2021-05-17 00:16:38 +02:00
.gitattributes Add ftl now as binary files 2021-07-20 05:05:30 +02:00
.gitignore Revert PluralRules.Generator to netstandard2.0 2021-06-13 16:46:54 +02:00
LICENSE-APACHE Add Licenses 2021-03-19 09:04:37 +01:00
LICENSE-MIT Add Licenses 2021-03-19 09:04:37 +01:00
Linguini.sln Remove unused project 2021-05-16 13:38:08 +02:00
README.md Add README.md and a method for easier usage 2021-07-20 18:38:59 +02:00
THIRD-PARTY LICENSES Add Third Party LICENSES 2021-07-29 21:00:53 +02:00

.NET

Linguini

Linguini is a C# implementation of Project Fluent, a localization system for natural-sounding translations with features like:

Asymmetric Localization

Natural-sounding translations with genders and grammatical cases only when necessary. Expressiveness is not limited by the grammar of the source language.

Progressive Enhancement

Translations are isolated; locale-specific logic doesn't leak to other locales. Authors can iteratively improve translations without impact on other languages.

Modular

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.

Performant

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.

How to get?

To install the Fluent Bundle type in your console:

dotnet add package Linguini.Bundle

You can also follow other NuGet installation instructions.

How to use?

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.

Licenses

Linguini Bundle and associated projects are licensed under Apache and MIT licenses. Consult the LICENSE-MIT and LICENSE-APACHE for more detail.