Skip to content

Only enable tests that require an English locale when the locale is English #46211

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: 3.4.x
Choose a base branch
from

Conversation

nosan
Copy link
Contributor

@nosan nosan commented Jun 25, 2025

@nosan nosan changed the base branch from main to 3.4.x June 25, 2025 20:44
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 25, 2025

private ConditionEvaluationResult evaluate(EnabledOnLocale annotation) {
Locale locale = Locale.getDefault();
String language = locale.getLanguage();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As an alternative, System.getProperty("user.language") can be used, but as far as I remember, Locale.getDefault() returns the same value.

Introduce @EnabledOnLocale annotation to enable or disable tests
based on the system's default locale.

Signed-off-by: Dmytro Nosan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants