Skip to content

Commit a3822ac

Browse files
authored
[RC1] Blazor WASM respects UI culture setting (#36105)
1 parent f75aa6f commit a3822ac

3 files changed

Lines changed: 24 additions & 4 deletions

File tree

aspnetcore/blazor/globalization-localization.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,12 @@ CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
363363
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");
364364
```
365365

366+
:::moniker range="< aspnetcore-10.0"
367+
366368
> [!NOTE]
367-
> Currently, Blazor WebAssembly apps only load resources based on <xref:System.Globalization.CultureInfo.DefaultThreadCurrentCulture>. For more information, see [Blazor WASM only relies on the current culture (current UI culture isn't respected) (`dotnet/aspnetcore` #56824)](https://github.com/dotnet/aspnetcore/issues/56824).
369+
> In .NET 9 or earlier, standalone Blazor WebAssembly apps load UI globalization resources based on <xref:System.Globalization.CultureInfo.DefaultThreadCurrentCulture?displayProperty=nameWithType>. If you want to additionally load globalization data for your localization culture defined by <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture?displayProperty=nameWithType>, [upgrade the app to .NET 10 or later](xref:migration/index).
370+
371+
:::moniker-end
368372

369373
Use the `CultureExample1` component shown in the [Demonstration component](#demonstration-component) section to study how globalization works. Issue a request with United States English (`en-US`). Switch to Costa Rican Spanish (`es-CR`) in the browser's language settings. Request the webpage again. When the requested language is Costa Rican Spanish, the app's culture remains United States English (`en-US`).
370374

@@ -507,8 +511,12 @@ CultureInfo.DefaultThreadCurrentUICulture = culture;
507511
await host.RunAsync();
508512
```
509513

514+
:::moniker range="< aspnetcore-10.0"
515+
510516
> [!NOTE]
511-
> Currently, Blazor WebAssembly apps only load resources based on <xref:System.Globalization.CultureInfo.DefaultThreadCurrentCulture>. For more information, see [Blazor WASM only relies on the current culture (current UI culture isn't respected) (`dotnet/aspnetcore` #56824)](https://github.com/dotnet/aspnetcore/issues/56824).
517+
> In .NET 9 or earlier, standalone Blazor WebAssembly apps load UI globalization resources based on <xref:System.Globalization.CultureInfo.DefaultThreadCurrentCulture?displayProperty=nameWithType>. If you want to additionally load globalization data for your localization culture defined by <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture?displayProperty=nameWithType>, [upgrade the app to .NET 10 or later](xref:migration/index).
518+
519+
:::moniker-end
512520

513521
The following `CultureSelector` component shows how to perform the following actions:
514522

@@ -1004,8 +1012,16 @@ CultureInfo.DefaultThreadCurrentUICulture = culture;
10041012
await host.RunAsync();
10051013
```
10061014

1015+
:::moniker-end
1016+
1017+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0"
1018+
10071019
> [!NOTE]
1008-
> Currently, Blazor WebAssembly apps only load resources based on <xref:System.Globalization.CultureInfo.DefaultThreadCurrentCulture>. For more information, see [Blazor WASM only relies on the current culture (current UI culture isn't respected) (`dotnet/aspnetcore` #56824)](https://github.com/dotnet/aspnetcore/issues/56824).
1020+
> In .NET 9 or earlier, standalone Blazor WebAssembly apps load UI globalization resources based on <xref:System.Globalization.CultureInfo.DefaultThreadCurrentCulture?displayProperty=nameWithType>. If you want to additionally load globalization data for your localization culture defined by <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture?displayProperty=nameWithType>, [upgrade the app to .NET 10 or later](xref:migration/index).
1021+
1022+
:::moniker-end
1023+
1024+
:::moniker range=">= aspnetcore-8.0"
10091025

10101026
Add the following `CultureSelector` component to the `.Client` project.
10111027

aspnetcore/release-notes/aspnetcore-10.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: wadepickett
44
description: Learn about the new features in ASP.NET Core in .NET 10.
55
ms.author: wpickett
66
ms.custom: mvc
7-
ms.date: 09/09/2025
7+
ms.date: 09/15/2025
88
uid: aspnetcore-10
99
---
1010
# What's new in ASP.NET Core in .NET 10

aspnetcore/release-notes/aspnetcore-10/includes/blazor.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,3 +759,7 @@ public int CounterNotRestoredOnReconnect { get; set; }
759759
```
760760

761761
Call `PersistentComponentState.RegisterOnRestoring` to register a callback for imperatively controlling how state is restored, similar to how <xref:Microsoft.AspNetCore.Components.PersistentComponentState.RegisterOnPersisting%2A?displayProperty=nameWithType> provides full control of how state is persisted.
762+
763+
### Blazor WebAssembly respects the current UI culture setting
764+
765+
In .NET 9 or earlier, standalone Blazor WebAssembly apps load UI globalization resources based on <xref:System.Globalization.CultureInfo.DefaultThreadCurrentCulture?displayProperty=nameWithType>. If you want to additionally load globalization data for your localization culture defined by <xref:System.Globalization.CultureInfo.DefaultThreadCurrentUICulture?displayProperty=nameWithType>, [upgrade the app to .NET 10 or later](xref:migration/index).

0 commit comments

Comments
 (0)