Share via


ViewLocalizer Class

Definition

An IViewLocalizer implementation that derives the resource location from the executing view's file path.

public ref class ViewLocalizer : Microsoft::AspNetCore::Mvc::Localization::IViewLocalizer, Microsoft::AspNetCore::Mvc::ViewFeatures::IViewContextAware
public class ViewLocalizer : Microsoft.AspNetCore.Mvc.Localization.IViewLocalizer, Microsoft.AspNetCore.Mvc.ViewFeatures.IViewContextAware
type ViewLocalizer = class
    interface IViewLocalizer
    interface IHtmlLocalizer
    interface IViewContextAware
type ViewLocalizer = class
    interface IHtmlLocalizer
    interface IViewLocalizer
    interface IViewContextAware
Public Class ViewLocalizer
Implements IViewContextAware, IViewLocalizer
Inheritance
ViewLocalizer
Implements

Constructors

ViewLocalizer(IHtmlLocalizerFactory, IHostingEnvironment)

Creates a new ViewLocalizer.

ViewLocalizer(IHtmlLocalizerFactory, IWebHostEnvironment)

Creates a new ViewLocalizer.

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

Contextualize(ViewContext)

Apply the specified ViewContext.

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.

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