MvcLocalizationMvcCoreBuilderExtensions.AddMvcLocalization Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddMvcLocalization(IMvcCoreBuilder)
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
- builder
- IMvcCoreBuilder
The IMvcCoreBuilder.
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)
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
- builder
- IMvcCoreBuilder
The IMvcCoreBuilder.
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>)
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
- builder
- IMvcCoreBuilder
The IMvcCoreBuilder.
- 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>)
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
- builder
- IMvcCoreBuilder
The IMvcCoreBuilder.
- 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>)
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
- builder
- IMvcCoreBuilder
The IMvcCoreBuilder.
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)
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
- builder
- IMvcCoreBuilder
The IMvcCoreBuilder.
- localizationOptionsSetupAction
- Action<LocalizationOptions>
An action to configure the LocalizationOptions.
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>)
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
- builder
- IMvcCoreBuilder
The IMvcCoreBuilder.
- 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>)
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
- builder
- IMvcCoreBuilder
The IMvcCoreBuilder.
- localizationOptionsSetupAction
- Action<LocalizationOptions>
An action to configure
the LocalizationOptions. Can be null
.
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).