Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​AspNetCore.​Builder.​RequestLocalizationOptions
Assembly: Microsoft.AspNetCore.Localization
Inheritance: object → RequestLocalizationOptions
Specifies options for the <see cref="T:Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware" /> .
Properties
public
bool
CultureInfoUseUserOverride
Configures <see cref="P:System.Globalization.CultureInfo.UseUserOverride" /> . Defaults to <c>true</c> .
DefaultRequestCulture
Gets or sets the default culture to use for requests when a supported culture could not be determined by
one of the configured <see cref="T:Microsoft.AspNetCore.Localization.IRequestCultureProvider" /> s.
Defaults to <see cref="P:System.Globalization.CultureInfo.CurrentCulture" /> and <see cref="P:System.Globalization.CultureInfo.CurrentUICulture" /> .
public
bool
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 <see cref="T:Microsoft.AspNetCore.Localization.IRequestCultureProvider" /> s is not in the
<see cref="P:Microsoft.AspNetCore.Builder.RequestLocalizationOptions.SupportedCultures" /> list but a parent culture is.
Defaults to <c>true</c> ;
Remarks Note that the parent culture check is done using only the culture name.
public
bool
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 <see cref="T:Microsoft.AspNetCore.Localization.IRequestCultureProvider" /> s is not in the
<see cref="P:Microsoft.AspNetCore.Builder.RequestLocalizationOptions.SupportedUICultures" /> list but a parent culture is.
Defaults to <c>true</c> ;
Remarks Note that the parent culture check is done using ony the culture name.
public
bool
ApplyCurrentCultureToResponseHeaders
Gets or sets a value that determines if <see cref="P:System.Globalization.CultureInfo.CurrentUICulture" /> is applied to the response <c>Content-Language</c> header.
public
System.​Collections.​Generic.​IList<​System.​Globalization.​CultureInfo>
SupportedCultures
The cultures supported by the application. The <see cref="T:Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware" /> will only set
the current request culture to an entry in this list.
Defaults to <see cref="P:System.Globalization.CultureInfo.CurrentCulture" /> .
public
System.​Collections.​Generic.​IList<​System.​Globalization.​CultureInfo>
SupportedUICultures
The UI cultures supported by the application. The <see cref="T:Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware" /> will only set
the current request culture to an entry in this list.
Defaults to <see cref="P:System.Globalization.CultureInfo.CurrentUICulture" /> .
public
System.​Collections.​Generic.​IList<​Localization.​IRequestCultureProvider>
RequestCultureProviders
An ordered list of providers used to determine a request's culture information. The first provider that
returns a non- <c>null</c> result for a given request will be used.
Defaults to the following:
<list type="number">
<item>
<description>
<see cref="T:Microsoft.AspNetCore.Localization.QueryStringRequestCultureProvider" />
</description>
</item>
<item>
<description>
<see cref="T:Microsoft.AspNetCore.Localization.CookieRequestCultureProvider" />
</description>
</item>
<item>
<description>
<see cref="T:Microsoft.AspNetCore.Localization.AcceptLanguageHeaderRequestCultureProvider" />
</description>
</item>
</list>
Methods
public
RequestLocalizationOptions
AddSupportedCultures​(string[] cultures)
Adds the set of the supported cultures by the application.
Returns The <see cref="T:Microsoft.AspNetCore.Builder.RequestLocalizationOptions" /> .
cultures
The cultures to be added.
public
RequestLocalizationOptions
AddSupportedUICultures​(string[] uiCultures)
Adds the set of the supported UI cultures by the application.
Returns The <see cref="T:Microsoft.AspNetCore.Builder.RequestLocalizationOptions" /> .
uiCultures
The UI cultures to be added.
public
RequestLocalizationOptions
SetDefaultCulture​(string defaultCulture)
Set the default culture which is used by the application when a supported culture could not be determined by
one of the configured <see cref="T:Microsoft.AspNetCore.Localization.IRequestCultureProvider" /> s.
Returns The <see cref="T:Microsoft.AspNetCore.Builder.RequestLocalizationOptions" /> .
defaultCulture
The default culture to be set.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object