Spree Commerce

Try It Now

Locale Switching Now Disabled by Default

Posted on September 09, 2008 by Sean Schofield

I’ve gone ahead and disabled locale switching by default. Locale switching refers to the ability of individual users to control the site locale for their specific session. An example of this is the language bar at the top of the demo site which allows users to change languages, etc.

The local switching feature requires a time consuming filter to be run on every request which results in the parsing of the lang files over and over again. This could be improved through caching but since Spree will soon be using the i18n features of Rails 2.2, it didn’t seem like a good idea to invest in that now.

You can still enable cache switching by tweaking the :allow_locale_switching preference. For sites running in a non-english locale, you’ll want to make sure you have the :default_locale preference set to the desired locale. This is a global (application-wide) setting. Please see the wiki for more information on the i18n features of Spree.