-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Labels
BlazorPri2Source - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issueaspnet-core/svcblazor/subsvcdoc-enhancement
Description
Description
[Enter feedback here]
The docs provide an example of supporting two cultures, but many people (based on StackOverflow activity) simply want numeric/date support dynamically without having to specify EVERY culture (of which they might not even know the end user's culture).
Frustratingly, our premium Copilot license in VS continues to suggest that, "options.SupportedCultures = null; // support all cultures" which appears to be both incorrect and misleading.
Therefore the documentation should also document how to dynamically support every culture, e.g.:
app.UseRequestLocalization(options =>
{
var supportedCultures = CultureInfo.GetCultures(CultureTypes.AllCultures)
.Where(cul => !string.IsNullOrEmpty(cul.Name))
.ToArray();
options.DefaultRequestCulture = new RequestCulture("en-GB"); // suggest using your largest audience's culture here
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
});
Page URL
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/globalization-localization.md
Document ID
d6f07538-228e-9f96-680f-6c324caf11d6
Platform Id
bd2a8fe1-da71-2bfb-045d-1b5f49d944a4
Article author
Metadata
- ID: 15e7c51d-1839-1849-813a-23c4d21c64ae
- PlatformId: bd2a8fe1-da71-2bfb-045d-1b5f49d944a4
- Service: aspnet-core
- Sub-service: blazor
Metadata
Metadata
Assignees
Labels
BlazorPri2Source - Docs.msDocs Customer feedback via GitHub IssueDocs Customer feedback via GitHub Issueaspnet-core/svcblazor/subsvcdoc-enhancement
Type
Projects
Status
Done