MvcLocalizationMvcBuilderExtensions.AddMvcLocalization 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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)
將 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
參數
- builder
- IMvcBuilder
傳回
備註
新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。
適用於
AddMvcLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat)
將 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
參數
- builder
- IMvcBuilder
當地語系化檢視的檢視格式。
傳回
備註
新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。
適用於
AddMvcLocalization(IMvcBuilder, Action<MvcDataAnnotationsLocalizationOptions>)
將 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
參數
- builder
- IMvcBuilder
- dataAnnotationsLocalizationOptionsSetupAction
- Action<MvcDataAnnotationsLocalizationOptions>
傳回
備註
新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。
適用於
AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>)
將 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
參數
- builder
- IMvcBuilder
- localizationOptionsSetupAction
- Action<LocalizationOptions>
設定 的 LocalizationOptions 動作。
傳回
備註
新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。
適用於
AddMvcLocalization(IMvcBuilder, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)
將 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
參數
- builder
- IMvcBuilder
當地語系化檢視的檢視格式。
- dataAnnotationsLocalizationOptionsSetupAction
- Action<MvcDataAnnotationsLocalizationOptions>
傳回
備註
新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。
適用於
AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat)
將 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
參數
- builder
- IMvcBuilder
- localizationOptionsSetupAction
- Action<LocalizationOptions>
設定 的 LocalizationOptions 動作。
當地語系化檢視的檢視格式。
傳回
備註
新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。
適用於
AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>, Action<MvcDataAnnotationsLocalizationOptions>)
將 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
參數
- builder
- IMvcBuilder
- localizationOptionsSetupAction
- Action<LocalizationOptions>
設定 的 LocalizationOptions 動作。
- dataAnnotationsLocalizationOptionsSetupAction
- Action<MvcDataAnnotationsLocalizationOptions>
傳回
備註
新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。
適用於
AddMvcLocalization(IMvcBuilder, Action<LocalizationOptions>, LanguageViewLocationExpanderFormat, Action<MvcDataAnnotationsLocalizationOptions>)
將 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
參數
- builder
- IMvcBuilder
- localizationOptionsSetupAction
- Action<LocalizationOptions>
設定 的 LocalizationOptions 動作。
可以是 null
。
當地語系化檢視的檢視格式。
- dataAnnotationsLocalizationOptionsSetupAction
- Action<MvcDataAnnotationsLocalizationOptions>
設定 的 MvcDataAnnotationsLocalizationOptions 動作。 可以是 null
。
傳回
備註
新增當地語系化也會透過 新增檢視 AddViews(IMvcCoreBuilder) 的支援,以及透過 AddRazorViewEngine(IMvcCoreBuilder) 的 Razor 檢視引擎。