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

Add locale option to #parameterize #35571

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

KaanOzkan
Copy link
Contributor

Summary

parameterize is triggering I18n#transliterate. This method already
accepts a locale. It would be cleaner if, similar to other string inflection
methods, parameterize also accepted 'locale' as a parameter.

https://github.com/ruby-i18n/i18n/blob/master/lib/i18n.rb#L268

Parameterize is triggering I18n#transliterate. This method already
accepts a locale. It would be cleaner if similar to other string inflection
methods #parameterize also accepted 'locale' as a parameter.
# Replace accented chars with their ASCII equivalents.
parameterized_string = transliterate(string)
parameterized_string = transliterate(string, locale)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be locale: locale?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️ Good find!

@KaanOzkan
Copy link
Contributor Author

@sharang-d Are you adding it to your PR with tests or should I change it?

@sharang-d
Copy link
Contributor

@KaanOzkan I'm including it in my changes if that's alright :)

@KaanOzkan
Copy link
Contributor Author

@sharang-d Thank you! Please go ahead, I didn't want to change anything without tests again and you already started testing them. Thanks again.

suketa added a commit to suketa/rails_sandbox that referenced this pull request Sep 8, 2019
Add locale option to #parameterize
rails/rails#35571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants