localization_generator 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/templates/localization.rb +12 -1
- metadata +1 -1
data/templates/localization.rb
CHANGED
@@ -71,5 +71,16 @@ module <%= class_name %>
|
|
71
71
|
l(@symbol, @arguments)
|
72
72
|
end
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
|
+
# redefinition of ActionMail::Base#render_body, that adds locale suffix to
|
76
|
+
# the template name
|
77
|
+
ActionMailer::Base.module_eval <<-EOL
|
78
|
+
class << self
|
79
|
+
private
|
80
|
+
alias :render_body_old :render_body
|
81
|
+
def render_body(mailer, method_name)
|
82
|
+
ActionView::Base.new(template_path, mailer.body).render_file(method_name + "_#{CONFIG[:default_language]}")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
EOL
|
75
86
|
end
|