mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Added Site Setting to change locale.
This commit is contained in:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user