projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
c426e8d
)
Make it easier to test alternative locales
author
Tom Hughes
<tom@compton.nu>
Fri, 26 Oct 2012 20:41:03 +0000
(21:41 +0100)
committer
Tom Hughes
<tom@compton.nu>
Fri, 26 Oct 2012 20:41:03 +0000
(21:41 +0100)
Allow a locale=xx parameter in the URL to select the locale.
app/controllers/application_controller.rb
patch
|
blob
|
history
diff --git
a/app/controllers/application_controller.rb
b/app/controllers/application_controller.rb
index 8f9ae29481b8baeee5517deb1c5e80c6670c9eec..70a635404038efbc04beb0eb8231c85b90db644d 100644
(file)
--- a/
app/controllers/application_controller.rb
+++ b/
app/controllers/application_controller.rb
@@
-278,7
+278,7
@@
class ApplicationController < ActionController::Base
end
end
- I18n.locale = request.compatible_language_from(I18n.available_locales) || I18n.default_locale
+ I18n.locale =
params[:locale] ||
request.compatible_language_from(I18n.available_locales) || I18n.default_locale
response.headers['Content-Language'] = I18n.locale.to_s
end