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

Compatibility with ActionView's lazy lookup #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tbelliard
Copy link

Translation keys beginning with '.' were taken as is by i18n_viz, not
generating the full key, making it quite useless.

This pull request introduces the use of ActionView's method "scope_key_by_partial", used in the translate method to get the full scope automatically based on the current view.

Please note that this introduces a hard dependency on ActionView. If you wish to become Rails agnostic, a different implementation testing the existence of this method is necessary.

This was tested and implemented on Rails 4. I unfortunately lack time to test it on older versions of Rails.

Translation keys beginning with '.' were taken as is by i18n_viz, not
generating the full key.
@jhilden
Copy link
Contributor

jhilden commented Nov 3, 2014

thanks for the PR. I'm quite fine with a dependency on ActionView, but I would think it makes sense to add it to the gemspec in that case. Could you change your PR accordingly?
Also, it would be great to have a test case for the changed behavior.

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.

2 participants