Skip to content

Conversation

@fevziomurtekin
Copy link
Contributor

@fevziomurtekin fevziomurtekin commented Nov 24, 2024

PR's key points

When using toLowerCase on the ANDROID_STRINGS string, the Turkish locale caused it to convert as androıd_strıngs (with a dotless “ı”). To prevent this issue, the string conversion was modified to explicitly specify a locale (e.g., Locale.ENGLISH), ensuring consistent behavior across different locales.

To more information => https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.text/lowercase.html

How to review this PR?

Related Issues (delete if this does not apply)

Definition of Done

  • Changes summary added to CHANGELOG.md
  • Documentation added to README.md (if a new feature is added)
  • Tests added (if new code is added)
  • There is no outcommented or debug code left
@fevziomurtekin fevziomurtekin changed the title Replace with to prevent locale-specific issues (e.g., Turkish) Replace toLowerCase with lowercase to prevent locale-specific issues (e.g., Turkish) Nov 24, 2024
Copy link
Contributor

@adriangl adriangl left a comment

Choose a reason for hiding this comment

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

Hi! First of all, thanks a lot for the contribution!

Taking a look to the code it looks good to me! The idea is to use the default lowercase implementation so no language-specific conversion is performed, right? I've seen that it relies on Locale.ROOT if you don't specify a Locale

@fevziomurtekin
Copy link
Contributor Author

Hey! Thank you for your feedback and for reviewing the code! 😊

Yes, by using Locale.ROOT with the lowercase method, we can handle such cases effectively. This ensures language-neutral behavior, avoiding issues like the Turkish-specific conversion of ‘I’ to ‘i. It provides a reliable way to perform lowercase transformations without being affected by the system’s default locale or specific language rules.

@adriangl adriangl merged commit fe04ccb into hyperdevs-team:master Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants