diff --git a/backend/app/views/spree/admin/shared/_js_locale_data.html.erb b/backend/app/views/spree/admin/shared/_js_locale_data.html.erb index 6727676860e..38a032080d9 100644 --- a/backend/app/views/spree/admin/shared/_js_locale_data.html.erb +++ b/backend/app/views/spree/admin/shared/_js_locale_data.html.erb @@ -33,7 +33,10 @@ -<% 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'} if select2_locale_exists %> <% end %>