Implement internationalization

This commit is contained in:
2013-03-03 14:48:04 +01:00
parent a640255927
commit 27c188773a
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ private
Net::HTTP.post_form(uri, :message => message.to_json) Net::HTTP.post_form(uri, :message => message.to_json)
end end
def set_locale def set_locale
I18n.locale = :nl I18n.locale = (params[:locale].presence || :nl).to_sym
end end
def layout_by_resource def layout_by_resource
+4 -1
View File
@@ -156,7 +156,10 @@ Qwaiter::Application.routes.draw do
# #
#root :to => 'dashboard#home' #root :to => 'dashboard#home'
root :to => 'pages#home' root :to => 'pages#home'
get "/:name" => "pages#show", constraints: {name: /.*/}, as: :page
scope '(/:locale)', constraints: {locale: /nl|be|de|fr|en/}, defaults: { locale: :nl } do
get "/:name" => "pages#show", constraints: {name: /.*/}, as: :page
end
# See how all your routes lay out with "rake routes" # See how all your routes lay out with "rake routes"