Added Site Setting to change locale.

This commit is contained in:
Robin Ward
2013-02-28 14:31:39 -05:00
parent e37c7f1e1d
commit 628927a79f
23 changed files with 640 additions and 97 deletions

View File

@@ -21,6 +21,7 @@ class ApplicationController < ActionController::Base
before_filter :store_incoming_links
before_filter :preload_json
before_filter :check_xhr
before_filter :set_locale
rescue_from Exception do |exception|
unless [ ActiveRecord::RecordNotFound, ActionController::RoutingError,
@@ -77,6 +78,11 @@ class ApplicationController < ActionController::Base
render file: 'public/403', formats: [:html], layout: false, status: 403
end
def set_locale
I18n.locale = SiteSetting.default_locale
end
def store_preloaded(key, json)
@preloaded ||= {}
# I dislike that there is a gsub as opposed to a gsub!