Skip to content

Commit

Permalink
Don't error out if select2 asks for an unsupported locale
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Nov 14, 2023
1 parent 9ed9a07 commit 2d47f11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 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,7 @@
<script data-hook='admin-custom-translations'>
</script>

<% if I18n.locale != :en %>
<%= javascript_include_tag "solidus_admin/select2_locales/select2_locale_#{I18n.locale}",
data: {turbolinks_track: 'reload'} %>
<% 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) %>
<% end %>

0 comments on commit 2d47f11

Please sign in to comment.