Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

I18n: translation helpers missing from ActionController::Base

#1008

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 http://github.com/rails/rails/tr...

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?

Reported by Sven Fuchs · September 9th, 2008 @ 10:28 PM

State: committed
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. DHH
    DHH
    • State changed from new to committed

    I think this makes fine sense. Committed.

    September 10th, 2008 @ 06:40 AM

  2. Sven Fuchs