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