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.​ApplicationBuilderExtensions
Assembly: Microsoft.AspNetCore.Localization
Inheritance: object → ApplicationBuilderExtensions
Extension methods for adding the <see cref="T:Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware" /> to an application.
Methods
public static
IApplicationBuilder
UseRequestLocalization​(IApplicationBuilder app)
Adds the <see cref="T:Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware" /> to automatically set culture information for
requests based on information provided by the client.
Returns The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" /> .
app
The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" /> .
public static
IApplicationBuilder
UseRequestLocalization​(IApplicationBuilder app,
RequestLocalizationOptions options)
Adds the <see cref="T:Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware" /> to automatically set culture information for
requests based on information provided by the client.
Returns The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" /> .
app
The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" /> .
options
The <see cref="T:Microsoft.AspNetCore.Builder.RequestLocalizationOptions" /> to configure the middleware with.
public static
IApplicationBuilder
UseRequestLocalization​(IApplicationBuilder app,
System.​Action<​RequestLocalizationOptions> optionsAction)
Adds the <see cref="T:Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware" /> to automatically set culture information for
requests based on information provided by the client.
Returns The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" /> .
app
The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" /> .
optionsAction
A callback that configures the <see cref="T:Microsoft.AspNetCore.Builder.RequestLocalizationOptions" /> .
Remarks
This will going to instantiate a new <see cref="T:Microsoft.AspNetCore.Builder.RequestLocalizationOptions" /> that doesn't come from the services.
public static
IApplicationBuilder
UseRequestLocalization​(IApplicationBuilder app,
string[] cultures)
Adds the <see cref="T:Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware" /> to automatically set culture information for
requests based on information provided by the client.
Returns The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" /> .
app
The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" /> .
cultures
The culture names to be added by the application, which is represents both supported cultures and UI cultures.
Remarks
Note that the first culture is the default culture name.
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