0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-09-19 23:31:11 +02:00

Merge branch 'main' into pro-release

Dieser Commit ist enthalten in:
Angus McLeod 2022-07-15 15:14:57 +01:00
Commit c107ee2375

Datei anzeigen

@ -12,6 +12,7 @@ class CustomWizard::WizardController < ::ActionController::Base
before_action :preload_wizard_json before_action :preload_wizard_json
before_action :ensure_plugin_enabled before_action :ensure_plugin_enabled
before_action :ensure_logged_in, only: [:skip] before_action :ensure_logged_in, only: [:skip]
around_action :with_resolved_locale
helper_method :wizard_page_title helper_method :wizard_page_title
helper_method :wizard_theme_id helper_method :wizard_theme_id
@ -115,6 +116,13 @@ class CustomWizard::WizardController < ::ActionController::Base
@preloaded[key] = json.gsub("</", "<\\/") @preloaded[key] = json.gsub("</", "<\\/")
end end
## Simplified version of with_resolved_locale in ApplicationController
def with_resolved_locale
locale = current_user ? current_user.effective_locale : SiteSetting.default_locale
I18n.ensure_all_loaded!
I18n.with_locale(locale) { yield }
end
private private
def ensure_plugin_enabled def ensure_plugin_enabled