Search code examples
ruby-on-railsinternationalizationspree

i18n InvalidPluralizationData error in Spree


I'm using Spree. When I use empty content I get the following error:

I18n::InvalidPluralizationData in Spree/checkout#update_registration

Showing /home/itsnikolay/.rvm/gems/ruby-1.9.3-p194@rails3/gems/spree_core-1.1.0/app/views/spree/shared/_error_messages.html.erb where line #3 raised:

translation data {:one=>"1 ошибка не позволяет сохранить запись в базе", :other=>"%{count} ошибок не позволяют сохранить запись в базе", :many=>"%{count} ошибок не позволяют сохранить запись в базе"} can not be used with :count => 2

Extracted source (around line #3):

1: <% if target && target.errors.any? %>
2:   <div id="errorExplanation" class="errorExplanation" data-hook>
3:     <h2><%= t(:errors_prohibited_this_record_from_being_saved, :count => target.errors.count) %>:</h2>
4:     <p><%= t(:there_were_problems_with_the_following_fields) %>:</p>
5:      <ul>
6:      <% target.errors.full_messages.each do |msg| %>

More details on pictures:

Offer as guest

I18n::InvalidPluralizationData in Spree/checkout#update_registration

But my Gemfile contians gems:

gem 'spree_i18n', :git => 'git://github.com/spree/spree_i18n.git'
gem 'russian'

And /config/localest/ru.yml has lines:

errors_prohibited_this_record_from_being_saved:
    one: "1 ошибка не позволяет сохранить запись в базе"
    other: "%{count} ошибок не позволяют сохранить запись в базе"

Solution

  • I think this is related to the following issue: https://github.com/spree/spree_i18n/pull/88

    Can you see if this: A) resolves your issue, and B) validate the Russian (assuming it's your native language)