diff --git a/aspnetcore/blazor/globalization-localization.md b/aspnetcore/blazor/globalization-localization.md index fed2cced2f2d..8f7d0064d06e 100644 --- a/aspnetcore/blazor/globalization-localization.md +++ b/aspnetcore/blazor/globalization-localization.md @@ -1,10 +1,11 @@ --- title: ASP.NET Core Blazor globalization and localization +ai-usage: ai-assisted author: guardrex description: Learn how to render globalized and localized content to users in different cultures and languages. monikerRange: '>= aspnetcore-3.1' ms.author: wpickett -ms.date: 11/11/2025 +ms.date: 08/26/2026 uid: blazor/globalization-localization --- # ASP.NET Core Blazor globalization and localization @@ -276,6 +277,8 @@ Optionally, add a menu item to the navigation in the `NavMenu` component (`NavMe ## Dynamically set the culture from the `Accept-Language` header +*This section applies to server-side and client-side Blazor apps.* + Add the [`Microsoft.Extensions.Localization` package](https://www.nuget.org/packages/Microsoft.Extensions.Localization) to the app. The [`Accept-Language` header](https://developer.mozilla.org/docs/Web/HTTP/Headers/Accept-Language) is set by the browser and controlled by the user's language preferences in browser settings. In browser settings, a user sets one or more preferred languages in order of preference. The order of preference is used by the browser to set quality values (`q`, 0-1) for each language in the header. The following example specifies United States English, English, and Costa Rican Spanish with a preference for United States English or English: @@ -370,6 +373,18 @@ When the culture is Costa Rican Spanish (`es-CR`), the rendered component uses d ## Statically set the client-side culture +:::moniker range=">= aspnetcore-8.0" + +*This section applies to Blazor WebAssembly apps and Blazor Web App components that adopt the Interactive WebAssembly render mode.* + +:::moniker-end + +:::moniker range="< aspnetcore-8.0" + +*This section applies to Blazor WebAssembly apps.* + +:::moniker-end + :::moniker range=">= aspnetcore-5.0" Set the `BlazorWebAssemblyLoadAllGlobalizationData` property to `true` in the app's project file (`.csproj`): @@ -390,7 +405,7 @@ The Intermediate Language (IL) Linker configuration for client-side rendering st The app's culture can be set in JavaScript when Blazor starts with the `applicationCulture` Blazor start option. The following example configures the app to launch using the United States English (`en-US`) culture. -Prevent Blazor autostart by adding `autostart="false"` to [Blazor's ` @@ -398,7 +413,7 @@ Prevent Blazor autostart by adding `autostart="false"` to [Blazor's `