Skip to content

Make compatible with other JVM Locales as for example turkish. #494

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

Closed
wants to merge 14 commits into from

Conversation

janitza-bjag
Copy link

capitalize() without Locale.ENGLISH leads to unexpected chars which are language specific

Checklist

  • Pull requests follows the contribution guide
  • New or modified functionality is covered by tests

Description

capitalize() without Locale.ENGLISH leads to unexpected chars which are language specific
@florensie
Copy link

I'd maybe use Locale.ROOT instead.

capitalize() without Locale.ROOT leads to unexpected chars which are language specific
@janitza-bjag
Copy link
Author

I'd maybe use Locale.ROOT instead.

Seems to be the "better" approach, done

capitalize() without Locale.ROOT leads to unexpected chars which are language specific

Review changes
florensie
florensie previously approved these changes Apr 26, 2021
Copy link
Author

@janitza-bjag janitza-bjag left a comment

Choose a reason for hiding this comment

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

use Locale.ROOT to avoid language specific capitalize effects

vojtapol
vojtapol previously approved these changes Apr 27, 2021
Copy link
Member

@vojtapol vojtapol left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution.

@janitza-bjag
Copy link
Author

Is there anything to do for me?

@oryan-block
Copy link
Collaborator

Looks like capitalize is deprecated now: https://youtrack.jetbrains.com/issue/KT-43023
We should reconsider this approach.

@oryan-block
Copy link
Collaborator

@janitza-bjag lets replace these with "x".replaceFirstChar(Char::titlecase) please.

capitalize() without Locale.ROOT leads to unexpected chars which are language specific

Review changes
@janitza-bjag janitza-bjag dismissed stale reviews from vojtapol and florensie via 9c3c9d4 May 20, 2021 05:17
capitalize() without Locale.ROOT leads to unexpected chars which are language specific

Review changes
Copy link
Author

@janitza-bjag janitza-bjag left a comment

Choose a reason for hiding this comment

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

recommended changes applied

fun `scanner finds field resolver method using capitalize field_name`() {
val resolver = RootResolverInfo(listOf(CapitalizeQuery()), options)

val meta = scanner.findFieldResolver(FieldDefinition("id", TypeName("HullType")), resolver)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets make sure the test will fail on all machines by setting the default locale to Turkish Locale.forLanguageTag("tr-TR") and resetting it back to default at the end.
And add a comment to explain why we do that please.

@oryan-block
Copy link
Collaborator

Closing this since we're unable to push/merge it as it is. Opened #565 with the same commits.

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.

4 participants