Share via


RequestLocalizationOptions Class

Definition

Specifies options for the RequestLocalizationMiddleware.

public ref class RequestLocalizationOptions
public class RequestLocalizationOptions
type RequestLocalizationOptions = class
Public Class RequestLocalizationOptions
Inheritance
RequestLocalizationOptions

Constructors

RequestLocalizationOptions()

Creates a new RequestLocalizationOptions with default values.

Properties

ApplyCurrentCultureToResponseHeaders

Gets or sets a value that determines if CurrentUICulture is applied to the response Content-Language header.

CultureInfoUseUserOverride

Configures UseUserOverride. Defaults to true.

DefaultRequestCulture

Gets or sets the default culture to use for requests when a supported culture could not be determined by one of the configured IRequestCultureProviders. Defaults to CurrentCulture and CurrentUICulture.

FallBackToParentCultures

Gets or sets a value indicating whether to set a request culture to an parent culture in the case the culture determined by the configured IRequestCultureProviders is not in the SupportedCultures list but a parent culture is. Defaults to true;

FallBackToParentUICultures

Gets or sets a value indicating whether to set a request UI culture to a parent culture in the case the UI culture determined by the configured IRequestCultureProviders is not in the SupportedUICultures list but a parent culture is. Defaults to true;

RequestCultureProviders

An ordered list of providers used to determine a request's culture information. The first provider that returns a non-null result for a given request will be used. Defaults to the following:

  1. QueryStringRequestCultureProvider
  2. CookieRequestCultureProvider
  3. AcceptLanguageHeaderRequestCultureProvider
SupportedCultures

The cultures supported by the application. The RequestLocalizationMiddleware will only set the current request culture to an entry in this list. Defaults to CurrentCulture.

SupportedUICultures

The UI cultures supported by the application. The RequestLocalizationMiddleware will only set the current request culture to an entry in this list. Defaults to CurrentUICulture.

Methods

AddSupportedCultures(String[])

Adds the set of the supported cultures by the application.

AddSupportedUICultures(String[])

Adds the set of the supported UI cultures by the application.

SetDefaultCulture(String)

Set the default culture which is used by the application when a supported culture could not be determined by one of the configured IRequestCultureProviders.

Extension Methods

AddInitialRequestCultureProvider(RequestLocalizationOptions, RequestCultureProvider)

Adds a new RequestCultureProvider to the RequestCultureProviders.

Applies to