AlliedBits.Tlumach.HandlebarsNet
2.1.2
dotnet add package AlliedBits.Tlumach.HandlebarsNet --version 2.1.2
NuGet\Install-Package AlliedBits.Tlumach.HandlebarsNet -Version 2.1.2
<PackageReference Include="AlliedBits.Tlumach.HandlebarsNet" Version="2.1.2" />
<PackageVersion Include="AlliedBits.Tlumach.HandlebarsNet" Version="2.1.2" />
<PackageReference Include="AlliedBits.Tlumach.HandlebarsNet" />
paket add AlliedBits.Tlumach.HandlebarsNet --version 2.1.2
#r "nuget: AlliedBits.Tlumach.HandlebarsNet, 2.1.2"
#:package AlliedBits.Tlumach.HandlebarsNet@2.1.2
#addin nuget:?package=AlliedBits.Tlumach.HandlebarsNet&version=2.1.2
#tool nuget:?package=AlliedBits.Tlumach.HandlebarsNet&version=2.1.2
AlliedBits.Tlumach.HandlebarsNet lets Handlebars.Net templates use translations of Tlumach.NET, e.g. to render localized emails, reports, and documents.
handlebars.RegisterTlumach(Strings.TranslationManager)registers thetandt_htmlhelpers.{{t "Email.Greeting" name=customer.Name}}returns a translation with its placeholders filled: hash arguments for named placeholders, positional values for{0}, and ICUpluralandselect. A translation unit passed in the model can be used instead of a key.- The culture comes from the
culture=argument, then from the@culturedata of the render (template(model, new { culture })), then from the translation manager, so emails for many users can be rendered concurrently, each in its own language. tis escaped in{{ }}and not in{{{ }}}, as any Handlebars value.t_htmltreats the translation as trusted HTML and always encodes the values it inserts, like a Handlebars helper that returns aSafeString:{{t_html ...}}and{{{t_html ...}}}render the same. Use it directly, not as a(t_html ...)subexpression, which an outer{{ }}would escape.- A missing key returns the key by default, or an empty string, or throws, or is handled by a callback.
Requires Handlebars.Net 2.1 or a later 2.x version and .NET 9 or later. Indexed {0} placeholders need the DotNet text processing mode of the configuration and ICU plural and select need Arb, so one configuration uses one of them. Handlebars.Net compiles templates at run time and is not suitable for NativeAOT. See the "Template Engines" topic in the documentation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AlliedBits.Tlumach (= 2.1.2)
- Handlebars.Net (>= 2.1.0 && < 3.0.0)
-
net9.0
- AlliedBits.Tlumach (= 2.1.2)
- Handlebars.Net (>= 2.1.0 && < 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.