共用方式為


MvcLocalizationMvcBuilderExtensions.AddMvcLocalization 方法

定義

多載

AddMvcLocalization(IMvcBuilder)

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

AddMvcLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat)

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

AddMvcLocalization(IMvcBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>)

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

AddMvcLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat)

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

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

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

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

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

AddMvcLocalization(IMvcBuilder)

來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

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

參數

傳回

IMvcBuilder

備註

新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。

適用於

AddMvcLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat)

來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

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

參數

format
LanguageViewLocationExpanderFormat

當地語系化檢視的檢視格式。

傳回

IMvcBuilder

備註

新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。

適用於

AddMvcLocalization(IMvcBuilder, Action<MvcDataAnnotationsLocalizationOptions>)

來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

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

參數

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

設定 的 MvcDataAnnotationsLocalizationOptions 動作。

傳回

IMvcBuilder

備註

新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。

適用於

AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>)

來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

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

參數

localizationOptionsSetupAction
Action<LocalizationOptions>

設定 的 LocalizationOptions 動作。

傳回

IMvcBuilder

備註

新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。

適用於

AddMvcLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)

來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

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

參數

format
LanguageViewLocationExpanderFormat

當地語系化檢視的檢視格式。

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

設定 的 MvcDataAnnotationsLocalizationOptions 動作。

傳回

IMvcBuilder

備註

新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。

適用於

AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat)

來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

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

參數

localizationOptionsSetupAction
Action<LocalizationOptions>

設定 的 LocalizationOptions 動作。

format
LanguageViewLocationExpanderFormat

當地語系化檢視的檢視格式。

傳回

IMvcBuilder

備註

新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。

適用於

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

來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

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

參數

localizationOptionsSetupAction
Action<LocalizationOptions>

設定 的 LocalizationOptions 動作。

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

設定 的 MvcDataAnnotationsLocalizationOptions 動作。

傳回

IMvcBuilder

備註

新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。

適用於

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

來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs
來源:
MvcLocalizationMvcBuilderExtensions.cs

將 MVC 檢視和資料批註當地語系化服務新增至應用程式。

public static Microsoft.Extensions.DependencyInjection.IMvcBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcBuilder 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.IMvcBuilder AddMvcLocalization (this Microsoft.Extensions.DependencyInjection.IMvcBuilder 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.IMvcBuilder * Action<Microsoft.Extensions.Localization.LocalizationOptions> * Microsoft.AspNetCore.Mvc.Razor.LanguageViewLocationExpanderFormat * Action<Microsoft.AspNetCore.Mvc.DataAnnotations.MvcDataAnnotationsLocalizationOptions> -> Microsoft.Extensions.DependencyInjection.IMvcBuilder
<Extension()>
Public Function AddMvcLocalization (builder As IMvcBuilder, localizationOptionsSetupAction As Action(Of LocalizationOptions), format As LanguageViewLocationExpanderFormat, dataAnnotationsLocalizationOptionsSetupAction As Action(Of MvcDataAnnotationsLocalizationOptions)) As IMvcBuilder

參數

localizationOptionsSetupAction
Action<LocalizationOptions>

設定 的 LocalizationOptions 動作。 可以是 null

format
LanguageViewLocationExpanderFormat

當地語系化檢視的檢視格式。

dataAnnotationsLocalizationOptionsSetupAction
Action<MvcDataAnnotationsLocalizationOptions>

設定 的 MvcDataAnnotationsLocalizationOptions 動作。 可以是 null

傳回

IMvcBuilder

備註

新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。

適用於