page_entries_info error #339

Closed
rderoldan1 opened this Issue Sep 24, 2013 · 4 comments

Projects

None yet

2 participants

@rderoldan1

My app was working great, but this week I'm getting this error in page_entries_info method, can someone help me

translation data {:zero=>"No hay %{model}", :one=>"Mostrando 1 %{model}", :other=>"Mostrando %{count} %{model}"} can not be used with :count => 48
  i18n (0.6.1) lib/i18n/backend/pluralization.rb:35:in `pluralize'
-------------------------------
Backtrace:
-------------------------------

  i18n (0.6.1) lib/i18n/backend/pluralization.rb:35:in `pluralize'
  i18n (0.6.1) lib/i18n/backend/base.rb:40:in `translate'
  i18n (0.6.1) lib/i18n/backend/fallbacks.rb:38:in `translate'
  i18n (0.6.1) lib/i18n.rb:156:in `block in translate'
  i18n (0.6.1) lib/i18n.rb:152:in `catch'
  i18n (0.6.1) lib/i18n.rb:152:in `translate'
  i18n (0.6.1) lib/i18n/backend/base.rb:114:in `block in resolve'
  i18n (0.6.1) lib/i18n/backend/base.rb:111:in `catch'
  i18n (0.6.1) lib/i18n/backend/base.rb:111:in `resolve'
  i18n (0.6.1) lib/i18n/backend/base.rb:98:in `block in default'
  i18n (0.6.1) lib/i18n/backend/base.rb:97:in `each'
  i18n (0.6.1) lib/i18n/backend/base.rb:97:in `default'
  i18n (0.6.1) lib/i18n/backend/base.rb:34:in `translate'
  i18n (0.6.1) lib/i18n/backend/fallbacks.rb:44:in `block (2 levels) in translate'
  i18n (0.6.1) lib/i18n/backend/fallbacks.rb:43:in `catch'
  i18n (0.6.1) lib/i18n/backend/fallbacks.rb:43:in `block in translate'
  i18n (0.6.1) lib/i18n/backend/fallbacks.rb:42:in `each'
  i18n (0.6.1) lib/i18n/backend/fallbacks.rb:42:in `translate'
  i18n (0.6.1) lib/i18n.rb:156:in `block in translate'
  i18n (0.6.1) lib/i18n.rb:152:in `catch'
  i18n (0.6.1) lib/i18n.rb:152:in `translate'
  actionpack (3.2.13) lib/action_view/helpers/translation_helper.rb:55:in `translate'
  will_paginate (3.0.4) lib/will_paginate/view_helpers/action_view.rb:83:in `will_paginate_translate'
  will_paginate (3.0.4) lib/will_paginate/view_helpers.rb:139:in `page_entries_info'
  will_paginate (3.0.4) lib/will_paginate/view_helpers/action_view.rb:40:in `page_entries_info'
Owner
mislav commented Sep 27, 2013

I can't reproduce this. Can you upgrade i18n to latest 0.6.x and try again?

Now I fixed it, but I don't understand why, the error only appeared when :count was greater than 1, after a search in stack overflow, I fount that in some cases it search for :many key instead of :other, so I create the key and duplicate the message.

too_long:
    one: es demasiado largo (máximo 1 caracter)
    other: es demasiado largo (máximo %{count} caracteres)
    many: es demasiado largo (máximo %{count} caracteres)
too_short:
    one: es demasiado corto (mínimo 1 caracter)
    other: es demasiado corto (mínimo %{count} caracteres)
    many: es demasiado corto (mínimo %{count} caracteres)
wrong_length:
    one: longitud errónea (debe ser de 1 caracter)
    other: longitud errónea (debe ser de %{count} caracteres)
    many: es demasiado corto (mínimo %{count} caracteres)

I'm confused why some day it was broken after work for a year.

Owner
mislav commented Sep 27, 2013

Some locales have complex pluralization logic with more forms than ":one" and ":other". You seem to be using such a locale, since adding ":many" fixed it for you.

Closing this since it seems like a bug with your locale settings and pluralization rules and not will_paginate.

@mislav mislav closed this Sep 27, 2013

Yes, thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment