diff --git a/frontend/app/assets/javascripts/spree/frontend.js b/frontend/app/assets/javascripts/spree/frontend.js index 4464d609aa5..3e321eb0069 100644 --- a/frontend/app/assets/javascripts/spree/frontend.js +++ b/frontend/app/assets/javascripts/spree/frontend.js @@ -2,3 +2,4 @@ //= require spree/frontend/checkout //= require spree/frontend/product //= require spree/frontend/cart +//= require spree/frontend/locale_selector diff --git a/frontend/app/assets/javascripts/spree/frontend/locale_selector.js b/frontend/app/assets/javascripts/spree/frontend/locale_selector.js new file mode 100644 index 00000000000..fa48d65e0c6 --- /dev/null +++ b/frontend/app/assets/javascripts/spree/frontend/locale_selector.js @@ -0,0 +1,5 @@ +$(function() { + $('#locale_selector select').change(function() { + this.form.submit(); + }); +}); diff --git a/frontend/app/views/spree/shared/_locale_selector.html.erb b/frontend/app/views/spree/shared/_locale_selector.html.erb new file mode 100644 index 00000000000..2f94c895981 --- /dev/null +++ b/frontend/app/views/spree/shared/_locale_selector.html.erb @@ -0,0 +1,25 @@ +<% available_locales = current_store.available_locales %> +<% if available_locales.many? %> +