Repair code block links (#9030)
parent
fc719ac941
commit
13b70b1485
|
@ -201,9 +201,9 @@ Each language and culture combination (other than the default language) requires
|
|||
|
||||
### Configure localization
|
||||
|
||||
Localization is configured in the `ConfigureServices` method:
|
||||
Localization is configured in the `Startup.ConfigureServices` method:
|
||||
|
||||
[!code-csharp[](localization/sample/Localization/Program.cs?name=snippet1)]
|
||||
[!code-csharp[](localization/sample/Localization/Startup.cs?name=snippet1)]
|
||||
|
||||
* `AddLocalization` Adds the localization services to the services container. The code above also sets the resources path to "Resources".
|
||||
|
||||
|
@ -213,9 +213,9 @@ Localization is configured in the `ConfigureServices` method:
|
|||
|
||||
### Localization middleware
|
||||
|
||||
The current culture on a request is set in the localization [Middleware](xref:fundamentals/middleware/index). The localization middleware is enabled in the `Configure` method. The localization middleware must be configured before any middleware which might check the request culture (for example, `app.UseMvcWithDefaultRoute()`).
|
||||
The current culture on a request is set in the localization [Middleware](xref:fundamentals/middleware/index). The localization middleware is enabled in the `Startup.Configure` method. The localization middleware must be configured before any middleware which might check the request culture (for example, `app.UseMvcWithDefaultRoute()`).
|
||||
|
||||
[!code-csharp[](localization/sample/Localization/Program.cs?name=snippet2)]
|
||||
[!code-csharp[](localization/sample/Localization/Startup.cs?name=snippet2)]
|
||||
|
||||
`UseRequestLocalization` initializes a `RequestLocalizationOptions` object. On every request the list of `RequestCultureProvider` in the `RequestLocalizationOptions` is enumerated and the first provider that can successfully determine the request culture is used. The default providers come from the `RequestLocalizationOptions` class:
|
||||
|
||||
|
|
Loading…
Reference in New Issue