# Actionmailer and local i18n

**URL:** <https://www.ruby-forum.com/t/actionmailer-and-local-i18n/172659>\
**Category:** Rails\
**Created:** [July 24, 2009, 7:33pm UTC](https://www.ruby-forum.com/t/actionmailer-and-local-i18n/172659 "2009-07-24T19:33:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arvias](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@arvias](https://www.ruby-forum.com/u/arvias)\
**Post date:** [July 24, 2009, 7:33pm UTC](https://www.ruby-forum.com/t/actionmailer-and-local-i18n/172659/1 "2009-07-24T19:33:20Z")

</div>

Hi,

When sending mails often enough they are sent to another party than  
the current logged in user (like when commenting on a blog), and that  
user can have another default i18n.

It would be nice to be able to specify a local I18n for ActionMailer.

There is a plugin that does this:  
[http://github.com/Bertg/i18n\_action\_mailer](http://github.com/Bertg/i18n_action_mailer)

In my case it doesn’t work because apparently it conflicts with the  
translator plugin, from what I can tell they both overwrite the  
translate method.

How do you handle these situations?

–  
R.

---

<div class="post-metadata">

**Author:** ![arvias](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@arvias](https://www.ruby-forum.com/u/arvias)\
**Post date:** [July 24, 2009, 11:35pm UTC](https://www.ruby-forum.com/t/actionmailer-and-local-i18n/172659/2 "2009-07-24T23:35:40Z")

</div>

Not pretty, but couldn’t you patch i18n\_action\_mailer to work with  
translator?

module I18nActionMailer  
module InstanceMethods  
def translate(key, options={})  
Translator.translate\_with\_scope([self.mailer\_name,  
self.action\_name], key, options.merge(:locale =\> self.locale))  
end  
end  
end

Cheers,  
Nicholas
