This is the Internationalization project for Spree Commerce
See the official Internationalization documentation for more details.
Happy translating!
- Add this extension to your Gemfile with this line:
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: 'X-X-stable'
The branch
option is important: it must match the version of Spree you're using.
For example, use 3-0-stable
if you're using Spree 3-0-stable
or any 3.0.x
version.
- Install the gem using Bundler:
bundle install
- Copy & run migrations
bundle exec rails g spree_i18n:install
- Restart your server
If your server was running, restart it so that it can find the assets properly.
We removed support for translating models into a separate Gem.
Please update your Gemfile
if you still need the model translations.
# Gemfile
gem 'spree_globalize', github: 'spree-contrib/spree_globalize', branch: 'master'
WARNING: If you want to keep your model translations, be sure to add the spree_globalize
gem to your Gemfile
before migrating the database. Otherwise you will loose your translations!
bin/rake spree_i18n:upgrade
bin/rake db:migrate
Note: The migration automatically skips the removal of the translations tables. So it's safe to run the migration without data loss. But be sure to have the spree_globalize
gem in your Gemfile
, if you want to keep them.
From vendor/assets/javascripts/spree/backend/all.js
//= require spree/backend/spree_i18n
and from vendor/assets/stylesheets/spree/backend/all.css
*= require spree/backend/spree_i18n
Remove all occurrences of SpreeI18n::Config.supported_locales
from your code.
Copyright (c) 2010-2015 Spree Commerce Inc. and other contributors. released under the New BSD License