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

Relative key not reported as missing when helper method not used #106

Closed
jawa opened this issue Nov 5, 2014 · 4 comments
Closed

Relative key not reported as missing when helper method not used #106

jawa opened this issue Nov 5, 2014 · 4 comments
Milestone

Comments

@jawa
Copy link
Contributor

jawa commented Nov 5, 2014

Hi, not really sure whether this qualifies as an issue or not, but I thought it would be good to let you know about it.

In my view I had mistakenly written I18n.t('.some_key') which i18n-tasks considered used since there was a corresponding key path.to.view.some_key in my translation files. However, it seems like relative keys only works when used with the translate/t helper so when I viewed the page, the translation was missing even though i18n-tasks had reported no missing translations.

Thanks for a very useful tool in managing translations otherwise!
/Jakob

@glebm
Copy link
Owner

glebm commented Nov 5, 2014

Looking at the implementation, the helper seems to have too many responsibilities, relative keys being one of them: https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/translation_helper.rb.

Perhaps this can be accounted for on i18n-tasks side, though it would be difficult with the current implementation. Should be easier once #81 is done.

@jawa
Copy link
Contributor Author

jawa commented Nov 5, 2014

Thanks for the reply, I'll be more careful to make sure I don't run into this again!

@kieranklaassen
Copy link

+1

@glebm glebm added this to the v0.9.0 milestone Aug 8, 2015
glebm added a commit that referenced this issue Aug 8, 2015
@glebm
Copy link
Owner

glebm commented Aug 11, 2015

This is now available in v0.9.0.rc2 (only for .rb files), and will be available in the v0.9.0 release.

@glebm glebm closed this as completed Aug 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants