September 09 2008

Locale Switching Now Disabled by Defaultby railsdog

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.