Skip to content
integrate Spree with Globalize3
Ruby JavaScript
Find file
Failed to load latest commit information.
app now using Deface overrides, fully compatible with Spree 0.70 . a vers…
db/migrate
lib Gemfile, Rakefile, gemspec, spec_helper, travis.yml -- everything pre…
spec
.gitignore removed dummy app from repository, as recommended by spree guides
.travis.yml removed dummy app from repository, as recommended by spree guides
Gemfile dummy app generates successfully thanks to hack in a Gemfile. it's tr…
LICENSE initial commit: alive, kicking and working Product and Taxon translat…
README.md corrected link to travis image. [ci skip]
Rakefile Gemfile, Rakefile, gemspec, spec_helper, travis.yml -- everything pre…
Versionfile
globalize_spree.gemspec

README.md

GlobalizeSpree

Localizing model data in Spree using Globalize3.

Build Status

Installation

Add to Gemfile:

gem "globalize_spree", :git => 'git://github.com/tomash/globalize-spree.git'

Also, to be super-sure (I've ran into some trouble before that, needs investigation) add

gem "i18n"
gem "globalize3"

to your application Gemfile as well.

Now run the rake task to copy migrations and run them: rake globalize_spree:install rake db:migrate

Usage

Works OOTB.

Currently globalizes: Product (name, description), Taxon (name).

Basic usage (vanilla Globalize way)

Basically works like Globalize, so

# set the locale or do not to leave default one
I18n.locale = :en
# and you are ready to go
Product.last.name # <= get name for this product for :en locale
Product.last.name = "something" # <= set name for this product for :en locale

Easy Globalize Accessors

For easy editing of translated stuff for predefined locales, it uses code from easy-globalize2-accessors. Inside self.activate of your lib/spree_site.rb put

Product.class_eval do
  globalize_accessors :pl, :en, :de
end

And spree-globalize will replace Product form's "name" field with, respectively, "name_pl", "name_en" and "name_de" fields ("description" following same pattern) in admin panel. Try it!

ToDo

More models.

Contributing

Feel free to use Github issues and/or contact me via Github PM. Pull requests are welcome, provided they include some explanation (and relevant open issue maybe?).

Usual blabber

Copyright (c) 2010 Tomasz "Tomash" Stachewicz, released under the New BSD License

Something went wrong with that request. Please try again.