Skip to content

spree-contrib/spree_globalize

Repository files navigation

⚠️ Deprecation notice ⚠️

Since Spree 4.6 this extension is deprecated and not needed. Support for translations is now available in Spree core.

Spree Globalize

Build Status Code Climate

This is the globalization project extracted from spree_i18n for Spree Commerce version 3.1+.

For previous Spree versions you can just use spree_i18n.

See the official Internationalization documentation for more details.

Happy translating!


Installation

Add the following to your Gemfile:

gem 'spree_i18n', '~> 5.0'
gem 'spree_globalize', github: 'spree-contrib/spree_globalize'

Run bundle install

You can use the generator to install migrations and append spree_globalize assets to your app spree manifest file.

rails g spree_globalize:install

This will insert these lines into your spree manifest files:

vendor/assets/javascripts/spree/backend/all.js
//= require spree/backend/spree_globalize

Model Translations

This feature uses the Globalize gem to localize model data. So far the following models are translatable:

Product, Promotion, OptionType, Taxonomy, Taxon, Property, Store and ShippingMethod.

Start your server and you should see a TRANSLATIONS link or a flag icon on each admin section that supports this feature.

Every record needs to have a translation. If by any chance you remove spree_globalize from your Gemfile, add some records and then add spree_globalize gem back you might get errors like undefined method for nilClass because Globalize will try fetch translations that do not exist.


Contributing

See corresponding guidelines


Copyright (c) 2010-2021 Spree Commerce Inc. and other contributors. released under the New BSD License

About

Adds support for model translations (multi-language stores) using Globalize gem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published