MvcLocalizationMvcCoreBuilderExtensions.AddMvcLocalization 方法

定义

重载

AddMvcLocalization(IMvcCoreBuilder)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat)

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

AddMvcLocalization(IMvcCoreBuilder)

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

参数

返回

IMvcCoreBuilder

注解

添加本地化还会通过 AddViews(IMvcCoreBuilder) 添加对视图的支持,并通过 添加对 Razor 视图引擎的支持 AddRazorViewEngine(IMvcCoreBuilder)

适用于

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat)

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

参数

format
LanguageViewLocationExpanderFormat

本地化视图的视图格式。

返回

IMvcCoreBuilder

注解

添加本地化还会通过 AddViews(IMvcCoreBuilder) 添加对视图的支持,并通过 添加对 Razor 视图引擎的支持 AddRazorViewEngine(IMvcCoreBuilder)

适用于

AddMvcLocalization(IMvcCoreBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

参数

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

用于配置 的操作 MvcDataAnnotationsLocalizationOptions

返回

IMvcCoreBuilder

注解

添加本地化还会通过 AddViews(IMvcCoreBuilder) 添加对视图的支持,并通过 添加对 Razor 视图引擎的支持 AddRazorViewEngine(IMvcCoreBuilder)

适用于

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>)

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

参数

localizationOptionsSetupAction
Action<LocalizationOptions>

用于配置 的操作 LocalizationOptions

返回

IMvcCoreBuilder

注解

添加本地化还会通过 AddViews(IMvcCoreBuilder) 添加对视图的支持,并通过 添加对 Razor 视图引擎的支持 AddRazorViewEngine(IMvcCoreBuilder)

适用于

AddMvcLocalization(IMvcCoreBuilder, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

参数

format
LanguageViewLocationExpanderFormat

本地化视图的视图格式。

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

用于配置 的操作 MvcDataAnnotationsLocalizationOptions

返回

IMvcCoreBuilder

注解

添加本地化还会通过 AddViews(IMvcCoreBuilder) 添加对视图的支持,并通过 添加对 Razor 视图引擎的支持 AddRazorViewEngine(IMvcCoreBuilder)

适用于

AddMvcLocalization(IMvcCoreBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat)

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

参数

localizationOptionsSetupAction
Action<LocalizationOptions>

用于配置 的操作 LocalizationOptions

format
LanguageViewLocationExpanderFormat

本地化视图的视图格式。

返回

IMvcCoreBuilder

注解

添加本地化还会通过 AddViews(IMvcCoreBuilder) 添加对视图的支持,并通过 添加对 Razor 视图引擎的支持 AddRazorViewEngine(IMvcCoreBuilder)

适用于

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

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

参数

localizationOptionsSetupAction
Action<LocalizationOptions>

用于配置 的操作 LocalizationOptions

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

用于配置 的操作 MvcDataAnnotationsLocalizationOptions

返回

IMvcCoreBuilder

注解

添加本地化还会通过 AddViews(IMvcCoreBuilder) 添加对视图的支持,并通过 添加对 Razor 视图引擎的支持 AddRazorViewEngine(IMvcCoreBuilder)

适用于

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

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

将 MVC 视图和数据注释本地化服务添加到应用程序。

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

参数

localizationOptionsSetupAction
Action<LocalizationOptions>

用于配置 的操作 LocalizationOptions。 可以为 null

format
LanguageViewLocationExpanderFormat

本地化视图的视图格式。

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

用于配置 的操作 MvcDataAnnotationsLocalizationOptions。 可以为 null

返回

IMvcCoreBuilder

注解

添加本地化还会通过 AddViews(IMvcCoreBuilder) 添加对视图的支持,并通过 添加对 Razor 视图引擎的支持 AddRazorViewEngine(IMvcCoreBuilder)

适用于