Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions aspnetcore/blazor/globalization-localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -1670,12 +1670,25 @@ To further understand how the Blazor framework processes localization, see the [

To create localization shared resources, adopt the following approach.

* Confirm that the [`Microsoft.Extensions.Localization`](https://www.nuget.org/packages/Microsoft.Extensions.Localization) package is referenced by the project.

[!INCLUDE[](~/includes/package-reference.md)]

* Confirm that the <xref:Microsoft.Extensions.Localization?displayProperty=fullName> namespace is available to the project's Razor components via an entry in the project's `_Imports` file:

```razor
@using Microsoft.Extensions.Localization
```

* Create a dummy class with an arbitrary class name. In the following example:

* The app uses the `BlazorSample` namespace, and localization assets use the `BlazorSample.Localization` namespace.
* The dummy class is named `SharedResource`.
* The class file is placed in a `Localization` folder at the root of the app.

> [!NOTE]
> Don't use an autogenerated designer file (for example, `SharedResources.Designer.cs`). The dummy class is meant to act as the shared resource class. The presence of a designer file results in a namespace collision.

`Localization/SharedResource.cs`:

```csharp
Expand Down
Loading