Skip to content

Commit

Permalink
Merge pull request #5584 from solidusio/backport/v4.3/pr-5582
Browse files Browse the repository at this point in the history
[v4.3] Fix the check on select2 translations asset existence
  • Loading branch information
elia committed Jan 5, 2024
2 parents 4daeeff + 7cc413c commit 492f5a6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/app/views/spree/admin/shared/_js_locale_data.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
<script data-hook='admin-custom-translations'>
</script>

<% if I18n.locale != :en && I18n.locale %>
<% select2_locale_path = "solidus_admin/select2_locales/select2_locale_#{I18n.locale}" %>
<%= javascript_include_tag select2_locale_path, data: {turbolinks_track: 'reload'} if Rails.application.assets.find_asset(select2_locale_path) %>
<% select2_locale_path = "solidus_admin/select2_locales/select2_locale_#{I18n.locale}.js" %>
<% if I18n.locale != :en && I18n.locale && (
Rails.application.assets&.find_asset(select2_locale_path) || # compiled on the fly
Rails.application.assets_manifest.assets[select2_locale_path] # precompiled
) %>
<%= javascript_include_tag select2_locale_path, data: {turbolinks_track: 'reload'} %>
<% end %>

0 comments on commit 492f5a6

Please sign in to comment.