Sha256: 5f1550b0e9a29ab9fe5b3afcf3da6bc3e28bd58c7e0cb07bbc67a248f53a6279

Contents?: true

Size: 377 Bytes

Versions: 5

Compression:

Stored size: 377 Bytes

Contents

class ActionController::Base
  def set_gettext_locale
    requested_locale = params[:locale] || session[:locale] || cookies[:locale] ||  request.env['HTTP_ACCEPT_LANGUAGE']
    locale = FastGettext.set_locale(requested_locale)
    session[:locale] = locale
    I18n.locale = locale # some weird overwriting in action-controller makes this necessary ... see I18nProxy
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gettext_i18n_rails-0.3.4 lib/gettext_i18n_rails/action_controller.rb
gettext_i18n_rails-0.3.3 lib/gettext_i18n_rails/action_controller.rb
gettext_i18n_rails-0.3.2 lib/gettext_i18n_rails/action_controller.rb
gettext_i18n_rails-0.3.1 lib/gettext_i18n_rails/action_controller.rb
gettext_i18n_rails-0.3.0 lib/gettext_i18n_rails/action_controller.rb