Skip to content

fix: make enum conversions locale-independent - #446

Open
pcbeingused33 wants to merge 1 commit into
crowdin:masterfrom
pcbeingused33:fix/c5515-priority-locale
Open

pcbeingused33 wants to merge 1 commit into
crowdin:masterfrom
pcbeingused33:fix/c5515-priority-locale

Conversation

@pcbeingused33

Copy link
Copy Markdown
Contributor

Enum converters used the JVM's default locale when changing the case of API values. With a Turkish default locale, pretranslation requests can send hıgh for Priority.HIGH and aı for Method.AI. Deserializing a response containing an API value such as ai can also fail because Java uppercases it to Aİ, which does not match the enum constant.

Use Locale.ROOT for case conversion across all affected enum converters so request and response values follow the API's spelling regardless of the default locale.

EnumConverterLocaleTest runs under tr-TR and checks the expected API spelling, parsing, and round trips for seven enums. The test failed on master and passed with the fix in an isolated JUnit run compiled for Java 8. The full Gradle build could not start because the Gradle wrapper cache was read-only in the test environment.

AI assistance was used to prepare the patch and regression test.

This branch has not been deployed

No deployments
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.

1 participant