Skip to content

Handling CultureInfo.InvariantCulture in RequestLocalizationMiddleware #58844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cloudlucky
Copy link

@cloudlucky cloudlucky commented Nov 8, 2024

Handling CultureInfo.InvariantCulture in RequestLocalizationMiddleware

Handle CultureInfo.InvariantCulture if it's supported by the option

Description

If we add CultureInfo.InvariantCulture as a supported culture the code rejecting it and defaulted to the default configured culture.
It's happening since version 8.

Fixes #58843

Test project: https://github.com/cloudlucky/RequestLocalizationMiddlewareCultureInvariant

@ghost ghost added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares label Nov 8, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 8, 2024
@adityamandaleeka
Copy link
Member

Thanks @cloudlucky. I posted a comment in the issue (#58843). Let's use the issue to discuss what should be done about this.

@cloudlucky
Copy link
Author

@dotnet-policy-service agree

@cloudlucky cloudlucky closed this Nov 14, 2024
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Nov 14, 2024
@cloudlucky
Copy link
Author

@dotnet-policy-service agree

Copy link
Contributor

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Nov 21, 2024
@danmoseley danmoseley requested a review from Copilot February 14, 2025 04:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/Middleware/Localization/test/UnitTests/RequestLocalizationMiddlewareTest.cs:28

  • The test case with an empty string as the parent culture might be incorrect. Please verify if this is intended or if it should be a specific culture.
[InlineData("zh-Hans-CN", "")]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares community-contribution Indicates that the PR has been added by a community member pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RequestLocalizationMiddleware does not handle CultureInfo.InvariantCulture since version 8
4 participants