Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
Merge branch 'main' into pro-release
Dieser Commit ist enthalten in:
Commit
c107ee2375
1 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
|
@ -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
|
||||||
|
|
Laden …
In neuem Issue referenzieren