8000 GitHub - humancopy/spree-change-locale at v0.2.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

humancopy/spree-change-locale

Repository files navigation

##Spree Change Locale

Easy locale change in Spree.

##Install

Add the following to your Gemfile

gem 'spree_change_locale'

Run:

bundle install

##Example

Adds a locale controller and route so then any path can be prepended with the locale.

The extension saves the locale in session[:locale] and redirects back to the requested page, omitting the locale from the path.

Examples:

  • /es/cart => /cart in Spanish
  • /fr/account => /account in French
  • /ru => / in Russian.

Look at examples/_language_bar.html.erb for a simple use in views.

By default the extension will look at config/locales for enabled locales. If none found, it will fall to I18n.available_locales and then to single I18n.default_locale.

You can setup Spree::Config[:enabled_locales] with an array of available locales to force a list of enabled locales. (e.g. Spree::Config.set(:enabled_locales, ['en','es','it']))

Copyright (c) 2011 humancopy.net, released under the New BSD License

About

Enable easy locale change in Spree using a locale controller

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0