Module: Air18nUi::ControllerFilters
- Defined in:
- lib/air18n_ui/controller_filters.rb
Instance Method Summary collapse
Instance Method Details
#set_contextual_translation ⇒ Object
3 4 5 6 7 8 |
# File 'lib/air18n_ui/controller_filters.rb', line 3 def set_contextual_translation if params[:set_contextual_translation_for_session] session[:contextual_translation] = params[:set_contextual_translation_for_session] == "true" end I18n.contextual_translation = @current_user && @current_user.has_any_role?([:admin, :translator]) && session[:contextual_translation] end |