Skip to content
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

Use invariant locale when capitalizing Gradle task names #1644

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

cketti
Copy link
Contributor

@cketti cketti commented Sep 28, 2024

What I have done and why

When copying the badging code from this project, we noticed during code review that the String.capitalized() extension function uses the default locale. However, it is undesirable for the user's locale to be used when capitalizing (English) Gradle task names. It mostly works fine, but will e.g. capitalize install to İnstall (dotted i) when Locale.getDefault() returns the Turkish locale.

This PR changes the code to use the invariant locale instead.

History

Capitalization for badging task names was added in #1009. The code used an (internal) extension function from Gradle that also contained this bug.

When the Gradle function was deprecated, the functionality was included in this repository via #1547.

The deprecated function in Gradle has since been fixed and is identical to the one in this PR.

Copy link
Collaborator

@dturner dturner left a comment

Choose a reason for hiding this comment

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

Thanks for spotting and fixing this.

Also thanks for the super clear PR description!

@dturner dturner merged commit cf0ee7c into android:main Sep 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants