Table of Contents

Class TlumachHtmlHelperExtensions

Namespace
Tlumach.AspNetCore.Mvc
Assembly
Tlumach.AspNetCore.Mvc.dll

Renders translation units in views without @Html.Raw: @Html.Tlumach(Strings.Home.Intro, Model.Name).

The translation is trusted HTML; values are HTML-encoded, except IHtmlContent values. WebEncodeValues does not affect the output. Values cached on the unit or supplied by OnPlaceholderValueNeeded are used for placeholders without a value; they are shared by all requests.

public static class TlumachHtmlHelperExtensions
Inheritance
TlumachHtmlHelperExtensions
Inherited Members

Methods

Tlumach(IHtmlHelper, BaseTranslationUnit)

Renders the unit in the current culture.

public static IHtmlContent Tlumach(this IHtmlHelper htmlHelper, BaseTranslationUnit unit)

Parameters

htmlHelper IHtmlHelper

The HTML helper of the view.

unit BaseTranslationUnit

The translation unit.

Returns

IHtmlContent

The HTML.

Tlumach(IHtmlHelper, BaseTranslationUnit, IReadOnlyDictionary<string, object?>)

Renders the unit in the current culture with named values.

public static IHtmlContent Tlumach(this IHtmlHelper htmlHelper, BaseTranslationUnit unit, IReadOnlyDictionary<string, object?> values)

Parameters

htmlHelper IHtmlHelper

The HTML helper of the view.

unit BaseTranslationUnit

The translation unit.

values IReadOnlyDictionary<string, object>

The values of the placeholders, by name.

Returns

IHtmlContent

The HTML.

Tlumach(IHtmlHelper, BaseTranslationUnit, params object?[])

Renders the unit in the current culture with positional values.

public static IHtmlContent Tlumach(this IHtmlHelper htmlHelper, BaseTranslationUnit unit, params object?[] arguments)

Parameters

htmlHelper IHtmlHelper

The HTML helper of the view.

unit BaseTranslationUnit

The translation unit.

arguments object[]

The values of the placeholders, by position.

Returns

IHtmlContent

The HTML.