Search code examples
ruby-on-railsbrowserlocalespreepreference

Rails SpreeCommerce - Does not detect browser language settings


my SpreeCommerce Shop (2.4, spree_i18n 2.4 ist installed) does not detect the browser language preferences. Just the default language will be displayed.

Language configurations are set on the SpreeCommerce admin page ( Supported Locales and Available Locales).

Any advice would be great.


Solution

  • You need to add some logic to your application to set the Rails.locale to one of the locales which you support based upon the request Accept-Language passed in.

    This functionality isn't supported directly by spree-i18n, but designed to be implemented by your application.