Läs på engelska

Dela via


HtmlLocalizer Class

Definition

An IHtmlLocalizer that uses the provided IStringLocalizer to do HTML-aware localization of content.

C#
public class HtmlLocalizer : Microsoft.AspNetCore.Mvc.Localization.IHtmlLocalizer
Inheritance
HtmlLocalizer
Implements

Constructors

Properties

Item[String, Object[]]

Gets the string resource with the given name and formatted with the supplied arguments. The arguments will be HTML encoded.

Item[String]

Gets the string resource with the given name.

Methods

GetAllStrings(Boolean)

Gets all string resources.

GetString(String, Object[])

Gets the string resource with the given name and formatted with the supplied arguments.

GetString(String)

Gets the string resource with the given name.

ToHtmlString(LocalizedString, Object[])

Creates a new LocalizedHtmlString for a LocalizedString.

ToHtmlString(LocalizedString)

Creates a new LocalizedHtmlString for a LocalizedString.

WithCulture(CultureInfo)
Obsolete.

Creates a new IHtmlLocalizer for a specific CultureInfo.

Extension Methods

GetAllStrings(IHtmlLocalizer)

Gets all string resources including those for parent cultures.

GetHtml(IHtmlLocalizer, String, Object[])

Gets the LocalizedHtmlString resource for a specific name.

GetHtml(IHtmlLocalizer, String)

Gets the LocalizedHtmlString resource for a specific name.

Applies to

Produkt Versioner
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0