app/controllers/faalis/application_controller.rb in faalis-1.0.0.alpha1 vs app/controllers/faalis/application_controller.rb in faalis-1.0.0.alpha2

- old
+ new

@@ -16,18 +16,19 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # ----------------------------------------------------------------------------- class Faalis::ApplicationController < ActionController::Base include FastGettext::Translation + before_filter :set_locale def set_locale - FastGettext.add_text_domain 'faalis', :path => "#{Faalis::Engine.root}/config/locales", :type => :po - # All languages you want to allow - FastGettext.default_available_locales = Faalis::Engine.locales - FastGettext.default_text_domain = 'faalis' + FastGettext.add_text_domain 'faalis', :path => "#{Faalis::Engine.root}/config/locales", :type => :po + # All languages you want to allow + FastGettext.default_available_locales = Faalis::Engine.locales + FastGettext.default_text_domain = 'faalis' - lang = request.env['lang'] || params[:locale] || session[:locale] || I18n.default_locale - FastGettext.set_locale(lang.to_s) - session[:locale] = I18n.locale = :"#{lang}" + lang = request.env['lang'] || params[:locale] || session[:locale] || I18n.default_locale + FastGettext.set_locale(lang.to_s) + session[:locale] = I18n.locale = :"#{lang}" end end