Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: explicitly lookup for translation overrides in wizard theme #84

Merged
merged 1 commit into from Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions controllers/custom_wizard/wizard.rb
Expand Up @@ -8,6 +8,7 @@ class CustomWizard::WizardController < ::ApplicationController
helper_method :wizard_page_title
helper_method :wizard_theme_ids
helper_method :wizard_theme_lookup
helper_method :wizard_theme_translations_lookup

def wizard
CustomWizard::Wizard.create(params[:wizard_id].underscore, current_user)
Expand All @@ -25,6 +26,10 @@ def wizard_theme_lookup(name)
Theme.lookup_field(wizard_theme_ids, mobile_view? ? :mobile : :desktop, name)
end

def wizard_theme_translations_lookup
Theme.lookup_field(wizard_theme_ids, :translations, I18n.locale)
end

def index
respond_to do |format|
format.json do
Expand Down
2 changes: 1 addition & 1 deletion views/layouts/wizard.html.erb
Expand Up @@ -21,7 +21,7 @@
<%= csrf_meta_tags %>

<%- unless customization_disabled? %>
<%= theme_translations_lookup %>
<%= wizard_theme_translations_lookup %>
<%= raw wizard_theme_lookup("head_tag") %>
<%- end %>

Expand Down