Linguini.Bundle
0.8.1
dotnet add package Linguini.Bundle --version 0.8.1
NuGet\Install-Package Linguini.Bundle -Version 0.8.1
<PackageReference Include="Linguini.Bundle" Version="0.8.1" />
paket add Linguini.Bundle --version 0.8.1
#r "nuget: Linguini.Bundle, 0.8.1"
// Install Linguini.Bundle as a Cake Addin #addin nuget:?package=Linguini.Bundle&version=0.8.1 // Install Linguini.Bundle as a Cake Tool #tool nuget:?package=Linguini.Bundle&version=0.8.1
Linguini Bundle
Construct a bundle
Linguini Bundle is the main API for accessing Fluent templates. It takes input, locale and useful localization functions.
First way is to construct is using a fluent/chainable API to create a bundle.
var bundle = LinguiniBuilder.Builder()
.CultureInfo(new CultureInfo("en"))
.AddResource("loc = Localization value")
.AddFunction("idfunc", (args, _) => args[0]);
.UncheckedBuild();
Here we set loc
value for English language and pass an idfunc
that just returns the first argument passed.
By using UncheckedBuild()
we get a guaranteed bundle, but any error will become an Exception. If we used Build()
the result would be a tuple of type (FluentBundle, List<FluentError>)
.
Another way to construct a bundle is to provide a FluentBundleOption
.
var defaultBundle = new FluentBundleOption
{
CultureInfo = new CultureInfo("en"),
Functions =
{
["idfunc"] = (args, _) => args[0]
},
// Note no resource added!
};
var bundle = FluentBundle.FromBundleOptions(defaultBundleOpt);
bundle.AddResource("loc = Localization value", out _);
Both methods are nearly the same, but FluentBundleOption
doesn't provide Resources.
They can be added vie BundleOption
s AddResource
.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Linguini.Shared (>= 0.8.0)
- Linguini.Syntax (>= 0.8.0)
-
net6.0
- Linguini.Shared (>= 0.8.0)
- Linguini.Syntax (>= 0.8.0)
-
net8.0
- Linguini.Shared (>= 0.8.0)
- Linguini.Syntax (>= 0.8.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on Linguini.Bundle:
Repository | Stars |
---|---|
OpenRA/OpenRA
Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux, *BSD and Mac OS X.
|
|
space-wizards/RobustToolbox
Robust multiplayer game engine, used by Space Station 14
|
|
mtkennerly/ludusavi-playnite
Playnite plugin for save backups via Ludusavi
|
Version | Downloads | Last updated |
---|---|---|
0.8.1 | 331,759 | 2/1/2024 |
0.8.0 | 149 | 1/23/2024 |
0.7.0 | 578 | 11/19/2023 |
0.6.1 | 252 | 10/23/2023 |
0.6.0 | 23,991 | 9/13/2023 |
0.5.0 | 18,690 | 6/14/2023 |
0.4.0 | 9,895 | 2/7/2023 |
0.3.2 | 7,504 | 11/19/2022 |
0.3.1 | 18,332 | 9/19/2022 |
0.3.0 | 772 | 5/30/2022 |
0.2.2 | 8,314 | 4/25/2022 |
0.2.1 | 442 | 4/25/2022 |
0.2.0 | 498 | 4/23/2022 |
0.1.4 | 435 | 4/23/2022 |
0.1.3 | 1,014,935 | 2/13/2022 |
0.1.2 | 11,529 | 12/22/2021 |
0.1.1 | 353 | 7/19/2021 |