Skip to content
Newer
Older
100644 114 lines (78 sloc) 3.34 KB
d356e72 @sbounmy update readme travis link
sbounmy authored
1 # SpreeMultiLingual [![Build Status](https://secure.travis-ci.org/sbounmy/spree_multi_lingual.png?branch=master)](http://travis-ci.org/sbounmy/spree_multi_lingual)
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
2
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
3 SpreeMultiLingual is originally a proof of concept for what could become a multi-lingual Spree plugin.
b8b02de initial commit
Jean-Philippe Boily authored
4
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
5 Since then integration tests and features have been added.
f8fe557 some README and .gemspec modifications. Moved some files
jipiboily authored
6
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
7 ## Requirements
8 - Spree 1.0.X
9 - Rails 3.1.X
10
11
12 ## Installation
13 Add gem to your Gemfile:
14
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
15 ```ruby
57a2236 @sbounmy update readme
sbounmy authored
16 gem "spree_multi_lingual", :git => "git@github.com:jipiboily/spree_multi_lingual.git"
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
17 ```
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
18
19 Run Bundler
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
20
21 ```ruby
22 bundle install
23 ```
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
24
25 Add an initializer file and set SpreeMultiLingual.languages to an array containing the languages you support.
26
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
27 ```ruby
28 # config/initializers/spree_multi_lingual.rb
29 SpreeMultiLingual.languages = ["fr", "en", "es"] # Add your own locales here
30 ```
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
31
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
32 For the moment, enable locale fallbacks for I18n (makes lookups for any locale fall back to the I18n.default_locale when a translation can not be found)
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
33
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
34 ```ruby
35 # config/application.rb
ffc020c @sbounmy typo
sbounmy authored
36 config.I18n.fallbacks = true
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
37 ```
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
38
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
39 Run spree_multi_lingual install:
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
40
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
41 ```ruby
42 rails g spree_multi_lingual:install
43 ```
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
44
a134146 @sbounmy add browser detection + there is no need to set locale to visit
sbounmy authored
45 If you want to use browser language detection using rack-contrib Locale :
46
47 ```ruby
48 # config.ru
49 require 'rack'
50 require 'rack/contrib'
51
52 use Rack::Locale
53
54 require ::File.expand_path('../config/environment', __FILE__)
55 run MyRailsApp::Application
56 ```
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
57
58 ## Use
59 On views where there is translated fields, there should be a dropdown to switch currently edited locale.
60
39471d0 @sbounmy added screenshot to how to edit taxons
sbounmy authored
61 Products:
62 http://dl.dropbox.com/u/6210261/spree_multi_lingual.swf
63
64 Taxons:
4a4ec41 @sbounmy removed test output
sbounmy authored
65 /!\ Using the taxonomy tree you can only edit another locale taxons name, to do so click on the links next to "Edit Taxonomy" to show the taxonomy for a given locale.
66 If you want to create taxons using the taxonomy tree, please only use the default locale for the moment.
67
68 To edit taxons permalink please do as following:
39471d0 @sbounmy added screenshot to how to edit taxons
sbounmy authored
69 ![Taxon](http://i44.tinypic.com/dqir20.png)
4a4ec41 @sbounmy removed test output
sbounmy authored
70 ![TaxonEdit](http://i40.tinypic.com/v78lmt.png)
39471d0 @sbounmy added screenshot to how to edit taxons
sbounmy authored
71
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
72 ### What is translated?
73
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
74 For now :
75 - products : name, permalink, description, meta description and meta keywords.
76 - taxonomies : name.
77 - taxons : name, permalink and description.
f8fe557 some README and .gemspec modifications. Moved some files
jipiboily authored
78
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
79 # WARNING
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
80 there is no fallback of default language for now unless you speficy I18n.fallbacks as previously stated.
2fa21bb Globalize3 working.
Jean-Philippe Boily authored
81
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
82 ## Notes
2fa21bb Globalize3 working.
Jean-Philippe Boily authored
83
18edb24 added two fields, but in the first mig. You can't add fields with glo…
jipiboily authored
84 It uses Globalize3, easy_globalize3_accessors and routing-filter. Thanks to [Tomash](https://github.com/tomash) that told me about those two awesome gems: easy_globalize3_accessors and routing-filter.
b8b02de initial commit
Jean-Philippe Boily authored
85
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
86 SpreeMultiLingual depends on a fork of routing-filter because it supports :exclude option in routes, used for /admin. I hope it this feature can me merged into the original repo.
b8b02de initial commit
Jean-Philippe Boily authored
87
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
88 ## TODO
b8b02de initial commit
Jean-Philippe Boily authored
89
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
90 1. Make taxons multi languages editable from the taxonomy tree
91 2. Dynamically show taxon full permalink depending on dropdown language selected : Taxons#edit
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
92 2. Travis-CI
347effb @sbounmy update readme
sbounmy authored
93 3. Add things to translate:
837d5a2 added install informations and cleared old JS
Jean-Philippe Boily authored
94 - Option types
95 - Option values
96 - Properties
97 - Alt text on images
347effb @sbounmy update readme
sbounmy authored
98 4. Dropdown or something to change locale
99 5. Fallback
100 6. Rake task for store that already have users
b8b02de initial commit
Jean-Philippe Boily authored
101
87849ce added contributors in README, thanks!
jipiboily authored
102 ## Contributors
103
104 Special thanks to sbounmy for the amount of contributions he did. Thanks to Radar for merging spree_localize.
105
73d7bbf @sbounmy fixed bug when editing parent taxons permalink
sbounmy authored
106 ## Testing
b8b02de initial commit
Jean-Philippe Boily authored
107
108 Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
109
110 $ bundle
111 $ bundle exec rake test app
112 $ bundle exec rspec spec
113
18edb24 added two fields, but in the first mig. You can't add fields with glo…
jipiboily authored
114 Copyright (c) 2012 Jean-Philippe Boily, released under the New BSD License
Something went wrong with that request. Please try again.