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

@KaanOzkan KaanOzkan commented Mar 11, 2019

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.
@rafaelfranca rafaelfranca merged commit 878e980 into rails:master Mar 11, 2019
3 checks passed
# Replace accented chars with their ASCII equivalents.
parameterized_string = transliterate(string)
parameterized_string = transliterate(string, locale)
Copy link
Member

@kaspth kaspth Mar 11, 2019

Shouldn't this be locale: locale?

Copy link
Contributor Author

@KaanOzkan KaanOzkan Mar 11, 2019

🤦‍♂️ Good find!

@KaanOzkan
Copy link
Contributor Author

@KaanOzkan KaanOzkan commented Mar 11, 2019

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

@sharang-d
Copy link
Contributor

@sharang-d sharang-d commented Mar 11, 2019

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

@KaanOzkan
Copy link
Contributor Author

@KaanOzkan KaanOzkan commented Mar 11, 2019

@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 issue 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants