jipiboily / spree_multi_lingual

Spree multi-lingual is a plugin to make multi locale store with Spree possible
BSD 3-Clause "New" or "Revised" License
49 stars 56 forks source link

Globalize3 0.3.0 #40

Closed alepore closed 10 years ago

alepore commented 11 years ago

Current globalize3 version is 0.3.0 (also on master git), can we update the gemspec?

sbounmy commented 11 years ago

would love to but I had a dependency issue with easy_globalize3_accessors, I've submited a rubygems bump version : https://github.com/paneq/easy_globalize3_accessors/issues/8

shivanibhanwal commented 11 years ago

We are also running in to same issue if we add globalize3 latest version as suggested in the README If we use the older version of the Globalize and install the gem. Then it gets install successfully but generator does not work

rails g spree_multi_lingual:install

/user/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /usr/local in PATH, mode 040777 /user/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /usr/local in PATH, mode 040777 /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/dsl/loader.rb:28:ininstance_eval': (eval):1: syntax error, unexpected tIDENTIFIER, expecting $end (SyntaxError) ...ink_part do')" closing_selector 'code[erb-silent]:contains("... ... ^ from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/dsl/loader.rb:28:in block in load' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/dsl/loader.rb:17:inopen' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/dsl/loader.rb:17:in load' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/environment.rb:66:inblock (2 levels) in enumerate_and_load' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/environment.rb:65:in glob' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/environment.rb:65:inblock in enumerate_and_load' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/environment.rb:55:in each' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/environment.rb:55:inenumerate_and_load' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/environment.rb:49:in load_overrides' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/environment.rb:31:inblock in load_all' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/environment.rb:29:in each' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/environment.rb:29:inload_all' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/deface-0.9.1/lib/deface/railtie.rb:12:in activate' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:429:in_run4022773406353556480prepare4496421495578417831callbacks' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in __run_callback' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in_run_prepare_callbacks' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in run_callbacks' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:74:inprepare!' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:48:in prepare!' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/application/finisher.rb:47:inblock in module:Finisher' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/initializable.rb:30:in instance_exec' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/initializable.rb:30:inrun' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/initializable.rb:55:in block in run_initializers' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/initializable.rb:54:ineach' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/initializable.rb:54:in run_initializers' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/application.rb:136:ininitialize!' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in method_missing' from /Volumes/dream2/theshop-1.3/thebabystore/config/environment.rb:5:in<top (required)>' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/polyglot-0.3.3/lib/polyglot.rb:63:in require' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/polyglot-0.3.3/lib/polyglot.rb:63:inrequire' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in block in require' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:inload_dependency' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in require' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/application.rb:103:inrequire_environment!' from /user/.rvm/gems/ruby-1.9.3-p374@shop-1.3/gems/railties-3.2.13/lib/rails/commands.rb:25:in <top (required)>' from script/rails:6:inrequire' from script/rails:6:in <main>'

ettomatic commented 11 years ago

Hi @shivanibhanwal, I'm getting the same error and I'm using globalize 3.0 (after hacking a little spree_multi_lingual gemspec and gemfile) so I don't think globalize is the cause of our issue.. So we should probably open a new isse for this. Btw it seems caused by an error in deface dsl here:

https://github.com/jipiboily/spree_multi_lingual/blob/master/app/overrides/spree/admin/taxons/_form/replace_permalink_part_by_permalink.html.erb.deface

I'm pretty new with deface so no real solution here... I couldn't find any example of deface dsl used to replace a do end block. Just to test it (not sure of the consequences!) I've removed the closing_selector

  <!-- replace "code[erb-silent]:contains('f.field_container :permalink do')"  -->

and the generator worked succesfully till the end!

I've no time now (and deface experience!) to check what kind of effect (say error) this change will produce in admin. Tomorrow I'll post some updates if someone with better experiences on this will give us a better solution ;-)

shivanibhanwal commented 11 years ago

Thanks alot @ettomatic I will try this out and will check for deface and update if I get something.

lucamonfredo commented 11 years ago

@ettomatic, unfortunately that trick will trigger syntax errors when parsed in the view.

After some hacking with the code I found that maybe this has something to do with the deface library (using deface 0.9.1 here), because if I rewrite https://github.com/jipiboily/spree_multi_lingual/blob/master/app/overrides/spree/admin/taxons/_form/replace_permalink_part_by_permalink.html.erb.deface this way (one line per instruction):

<!--
    replace "code[erb-loud]:contains('f.field_container :permalink_part do')"
    closing_selector "code[erb-silent]:contains('end')"
-->

<%= f.field_container :permalink do %>
  <%= f.label :permalink, t(:permalink) %><span class="required">*</span><br />
  <%= "#{@taxon.permalink_prefix}/" %><%= f.text_field :permalink, :value => @taxon.permalink_name %>
<% end %>

...everything goes on smoothly. Could you please confirm this?

mraaroncruz commented 11 years ago

Was just trying to fix it in my fork via @lmonfredo's recommendation. Sorry for stomping on your issue. There are a couple other minor changes in my branch or I would make a pull request. https://github.com/pferdefleisch/spree_multi_lingual/tree/40-deface-bug-fix

mraaroncruz commented 11 years ago

Forget I said or did anything. My branch breaks being able to view translations in store :(

Using deface 1.0.0.rc1 from #41 fixed my issues.