This project is archived and is in readonly mode.

#1008 ✓committed
Sven Fuchs

I18n: translation helpers missing from ActionController::Base

Reported by Sven Fuchs | September 9th, 2008 @ 10:28 PM | in 2.x

The TranslationHelper included in ActionView is only included to views (if helper :all is present) but a similar functionality is missing in ActionController instances.

The TranslationHelper is not suited for being used in ActionController as it catches TranslationMissing exceptions and wraps the message into a span element so that it can be (e.g.) easily highlighted in views. See

After a brief chat with lifo I've added a module ActionController::Translation which is just included right into ActionController::Base.

See the attached patch.

I'm not completely sure about this approach as now both translation helper modules behave slightly differently: in the view the message about a missing translation would be wrapped into a span, while it's just returned as is in the ActionController.

Any opinions?

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket