You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should return "2 minutes" but instead returns "I18n::InvalidPluralizationData: translation data nil can not be used with :count => 2. key 'other' is missing."
The 0.9.3 update included the commit "Fix issue with disabled subtrees and pluralization for KeyValue backend" which updates the file lib/i18n/backend/base.rb
The error is caused by the move of the lines 43-47 to after line 36. The lines are
The problem is that with chained backends, the initial backend may not have the translation, in which case an exception is thrown and the chaining skips to the next backend to find the translation. Now the order of the statements is changed, and if the translation is not found, then entry == nil and the call to pluralize will fail in a fatal way. In the 0.9.1 code, this couldn't happen as the test for nil happened before the call to pluralize.
The text was updated successfully, but these errors were encountered:
Upgrading from 0.9.1 to 0.9.3 when using a chained backend causes an exception in translations
I have a Rails application with the following configuration for I18n.
The following expression fails under 0.9.3
It should return "2 minutes" but instead returns "I18n::InvalidPluralizationData: translation data nil can not be used with :count => 2. key 'other' is missing."
The 0.9.3 update included the commit "Fix issue with disabled subtrees and pluralization for KeyValue backend" which updates the file lib/i18n/backend/base.rb
The error is caused by the move of the lines 43-47 to after line 36. The lines are
These are moved in front of
The problem is that with chained backends, the initial backend may not have the translation, in which case an exception is thrown and the chaining skips to the next backend to find the translation. Now the order of the statements is changed, and if the translation is not found, then entry == nil and the call to pluralize will fail in a fatal way. In the 0.9.1 code, this couldn't happen as the test for nil happened before the call to pluralize.
The text was updated successfully, but these errors were encountered: