it icon indicating copy to clipboard operation
it copied to clipboard

Mismatched pluralization lookup when localized string missing

Open JasonBarnabe opened this issue 3 years ago • 0 comments

  • App has multiple locales with a fallback to English.
  • A specific string has pluralization keys (one and other for English).
  • Attempting to render in Serbian locale, which should have one, few, many, and other pluralization keys.
  • Serbian locale is completely missing this translation.

Using the it helper results in I18n::InvalidPluralizationData. This line is calling I18n.backend#pluralize with the English key hash but with the Serbian locale. In this case, because the keys fell back to English, it should be calling it with the English locale.

Using t does not have the issue - string is rendered in English without error.

JasonBarnabe avatar Dec 20 '20 21:12 JasonBarnabe