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 keys with mailers do not prepend method name #155

Closed
lowjoel opened this issue Jun 27, 2015 · 4 comments
Closed

Relative keys with mailers do not prepend method name #155

lowjoel opened this issue Jun 27, 2015 · 4 comments
Milestone

Comments

@lowjoel
Copy link

lowjoel commented Jun 27, 2015

Mailers act like controllers (indeed, they inherit from ActionController::Base), but using relative keys in mailers would trigger an untranslated key+unused key error pair because the method names are not factored in.

The immediate fix I see is in lib/i18n/tasks/scanners/pattern_scanner.rb, replace:

    def controller_file?(path)
      /controllers/.match(path)
    end

with

    def controller_file?(path)
      /mailers|controllers/.match(path)
    end
@glebm
Copy link
Owner

glebm commented Jun 27, 2015

Hi, I have just merged @tomoasleep's branch, so this should be resolved on master

@lowjoel
Copy link
Author

lowjoel commented Jun 27, 2015

Thanks @glebm!

@lowjoel lowjoel closed this as completed Jun 27, 2015
@glebm glebm added this to the v0.8.4 milestone Jun 28, 2015
@tomoasleep
Copy link
Contributor

I'm glad that my patch helps :-)

@glebm
Copy link
Owner

glebm commented Aug 1, 2015

@tomoasleep Thanks!

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

No branches or pull requests

3 participants