Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Enables locale-based translations of all user-facing product data using Globalize3

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 db
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 Versionfile
Octocat-spinner-32 spree_product_translations.gemspec
README.md

Spree Product Translations

Makes product details, properties, prototypes, taxonomies and option types translatable by bridging the Globalize3 gem.

Installation and configuration

In your Gemfile, add:

gem 'spree_product_translations'

Then install the gem:

bundle install

Then copy the migrations to your spree application:

rake spree_product_translations:install

Finally migrate your database:

rake db:migrate

If you have pre-existing data, you'll need to run this rake task:

rake spree:extensions:product_translations:globalize_legacy_data

it will copy the original data over to the new translation tables. Globalize3 doesn't default to the original model table for the default locale like v1 used to.

How to use it

To edit the content in a specific language, simply change the locale on the language nav, and edit on the admin as usual.

Translated fields

Product

  • name
  • description
  • meta_description
  • meta_keywords

Property

  • presentation

Prototype

  • name

Taxonomy

  • name

Taxon

  • name
  • description

OptionType

  • presentation

OptionValue

  • presentation

Fallbacks for empty translations

If you have translations in your database (by using the spree-simple_product_translations extension for example) with empty translations (being a blank string instead of nil) you might want to add this configuration option to an initializer in your app:

Spree::Config.set :fallbacks_for_empty_translations => true

It will then use fallbacks for empty strings too.

Running tests

The tests are not updated since the original fork of the spree 0.11 compatible version. They will pretty sure fail. Feel free to fork the project and create a pull request with tests.

Test information by oliverbarnes

You might need to comment out the rspec gem requirement under config/environments/test.rb - for some reason, even with both the rspec gem and plugin installed, I would keep getting an annoying missing gem error.

Spree is officially making a choice for Test::Unit anyway, so this shouldn't create a problem.

(not that I don't like Rspec, I actually prefer it in other projects.)

Feature requests and patches welcome

If you see anything you need missing, or if you have a useful patch, feel free to submit them on the Issues section of the github project.

Something went wrong with that request. Please try again.