Dela via


MvcLocalizationMvcCoreBuilderExtensions.AddMvcLocalization Method

Definition

Overloads

AddMvcLocalization(IMvcCoreBuilder)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcCoreBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, Action<MvcDataAnnotationsLocalizationOptions>)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

Adds MVC view and data annotations localization services to the application.

AddMvcLocalization(IMvcCoreBuilder)

Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs

Adds MVC view and data annotations localization services to the application.

public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder);
static member AddMvcLocalization : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcLocalization (builder As IMvcCoreBuilder) As IMvcCoreBuilder

Parameters

Returns

The IMvcCoreBuilder.

Remarks

Adding localization also adds support for views via AddViews(IMvcCoreBuilder) and the Razor view engine via AddRazorViewEngine(IMvcCoreBuilder).

Applies to

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat)

Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs

Adds MVC view and data annotations localization services to the application.

public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat format);
static member AddMvcLocalization : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder * Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcLocalization (builder As IMvcCoreBuilder, format As LanguageViewLocationExpanderFormat) As IMvcCoreBuilder

Parameters

format
LanguageViewLocationExpanderFormat

The view format for localized views.

Returns

The IMvcCoreBuilder.

Remarks

Adding localization also adds support for views via AddViews(IMvcCoreBuilder) and the Razor view engine via AddRazorViewEngine(IMvcCoreBuilder).

Applies to

AddMvcLocalization(IMvcCoreBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs

Adds MVC view and data annotations localization services to the application.

public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions> dataAnnotationsLocalizationOptionsSetupAction);
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions>? dataAnnotationsLocalizationOptionsSetupAction);
static member AddMvcLocalization : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder * Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions> -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcLocalization (builder As IMvcCoreBuilder, dataAnnotationsLocalizationOptionsSetupAction As Action(Of MvcDataAnnotationsLocalizationOptions)) As IMvcCoreBuilder

Parameters

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

An action to configure the MvcDataAnnotationsLocalizationOptions.

Returns

The IMvcCoreBuilder.

Remarks

Adding localization also adds support for views via AddViews(IMvcCoreBuilder) and the Razor view engine via AddRazorViewEngine(IMvcCoreBuilder).

Applies to

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>)

Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs

Adds MVC view and data annotations localization services to the application.

public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.Extensions.Localization.LocalizationOptions> localizationOptionsSetupAction);
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.Extensions.Localization.LocalizationOptions>? localizationOptionsSetupAction);
static member AddMvcLocalization : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder * Action<Microsoft.Extensions.Localization.LocalizationOptions> -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcLocalization (builder As IMvcCoreBuilder, localizationOptionsSetupAction As Action(Of LocalizationOptions)) As IMvcCoreBuilder

Parameters

localizationOptionsSetupAction
Action<LocalizationOptions>

An action to configure the LocalizationOptions.

Returns

The IMvcCoreBuilder.

Remarks

Adding localization also adds support for views via AddViews(IMvcCoreBuilder) and the Razor view engine via AddRazorViewEngine(IMvcCoreBuilder).

Applies to

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs

Adds MVC view and data annotations localization services to the application.

public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat format, Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions> dataAnnotationsLocalizationOptionsSetupAction);
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat format, Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions>? dataAnnotationsLocalizationOptionsSetupAction);
static member AddMvcLocalization : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder * Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat * Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions> -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcLocalization (builder As IMvcCoreBuilder, format As LanguageViewLocationExpanderFormat, dataAnnotationsLocalizationOptionsSetupAction As Action(Of MvcDataAnnotationsLocalizationOptions)) As IMvcCoreBuilder

Parameters

format
LanguageViewLocationExpanderFormat

The view format for localized views.

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

An action to configure the MvcDataAnnotationsLocalizationOptions.

Returns

The IMvcCoreBuilder.

Remarks

Adding localization also adds support for views via AddViews(IMvcCoreBuilder) and the Razor view engine via AddRazorViewEngine(IMvcCoreBuilder).

Applies to

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat)

Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs

Adds MVC view and data annotations localization services to the application.

public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.Extensions.Localization.LocalizationOptions> localizationOptionsSetupAction, Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat format);
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.Extensions.Localization.LocalizationOptions>? localizationOptionsSetupAction, Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat format);
static member AddMvcLocalization : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder * Action<Microsoft.Extensions.Localization.LocalizationOptions> * Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcLocalization (builder As IMvcCoreBuilder, localizationOptionsSetupAction As Action(Of LocalizationOptions), format As LanguageViewLocationExpanderFormat) As IMvcCoreBuilder

Parameters

localizationOptionsSetupAction
Action<LocalizationOptions>

An action to configure the LocalizationOptions.

format
LanguageViewLocationExpanderFormat

The view format for localized views.

Returns

The IMvcCoreBuilder.

Remarks

Adding localization also adds support for views via AddViews(IMvcCoreBuilder) and the Razor view engine via AddRazorViewEngine(IMvcCoreBuilder).

Applies to

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, Action<MvcDataAnnotationsLocalizationOptions>)

Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs

Adds MVC view and data annotations localization services to the application.

public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.Extensions.Localization.LocalizationOptions> localizationOptionsSetupAction, Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions> dataAnnotationsLocalizationOptionsSetupAction);
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.Extensions.Localization.LocalizationOptions>? localizationOptionsSetupAction, Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions>? dataAnnotationsLocalizationOptionsSetupAction);
static member AddMvcLocalization : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder * Action<Microsoft.Extensions.Localization.LocalizationOptions> * Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions> -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcLocalization (builder As IMvcCoreBuilder, localizationOptionsSetupAction As Action(Of LocalizationOptions), dataAnnotationsLocalizationOptionsSetupAction As Action(Of MvcDataAnnotationsLocalizationOptions)) As IMvcCoreBuilder

Parameters

localizationOptionsSetupAction
Action<LocalizationOptions>

An action to configure the LocalizationOptions.

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

An action to configure the MvcDataAnnotationsLocalizationOptions.

Returns

The IMvcCoreBuilder.

Remarks

Adding localization also adds support for views via AddViews(IMvcCoreBuilder) and the Razor view engine via AddRazorViewEngine(IMvcCoreBuilder).

Applies to

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs
Source:
MvcLocalizationMvcCoreBuilderExtensions.cs

Adds MVC view and data annotations localization services to the application.

public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.Extensions.Localization.LocalizationOptions> localizationOptionsSetupAction, Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat format, Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions> dataAnnotationsLocalizationOptionsSetupAction);
public static Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder builder, Action<Microsoft.Extensions.Localization.LocalizationOptions>? localizationOptionsSetupAction, Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat format, Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions>? dataAnnotationsLocalizationOptionsSetupAction);
static member AddMvcLocalization : Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder * Action<Microsoft.Extensions.Localization.LocalizationOptions> * Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat * Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions> -> Microsoft.Extensions.DependencyInjection.IMvcCoreBuilder
<Extension()>
Public Function AddMvcLocalization (builder As IMvcCoreBuilder, localizationOptionsSetupAction As Action(Of LocalizationOptions), format As LanguageViewLocationExpanderFormat, dataAnnotationsLocalizationOptionsSetupAction As Action(Of MvcDataAnnotationsLocalizationOptions)) As IMvcCoreBuilder

Parameters

localizationOptionsSetupAction
Action<LocalizationOptions>

An action to configure the LocalizationOptions. Can be null.

format
LanguageViewLocationExpanderFormat

The view format for localized views.

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

An action to configure the MvcDataAnnotationsLocalizationOptions. Can be null.

Returns

The IMvcCoreBuilder.

Remarks

Adding localization also adds support for views via AddViews(IMvcCoreBuilder) and the Razor view engine via AddRazorViewEngine(IMvcCoreBuilder).

Applies to