Defect #21856
closedI18n backend does not support original i18n Pluralization
0%
Description
Hello, again me.
In our projects (redmines 3.2.0) we are using russian language sometimes. And sometimes we have problems with int plural in words (In our own others projects everything fine).
I know how to fix this, just need to implemet CLDR rules. I figured out how to do it, but yours backend of i18n breaks all my dreams ^^.
So, please, restore i18n logic. There is lot of related issues to #12645 in redmine.org, but you still does not fix this simple miss.
Why this happened:
I18n::Backend::Base which you are include to module Implementation of Redmine::I18n::Backend contains pluralize method only for English language (:one or :other from locales).
How to:
In module Implementation of Redmine::I18n::Backend class need to add this:
include ::I18n::Backend::Pluralization
Original implementation of I18n::Backend
autoload :Base, 'i18n/backend/base' autoload :InterpolationCompiler, 'i18n/backend/interpolation_compiler' autoload :Cache, 'i18n/backend/cache' autoload :Cascade, 'i18n/backend/cascade' autoload :Chain, 'i18n/backend/chain' autoload :Fallbacks, 'i18n/backend/fallbacks' autoload :Flatten, 'i18n/backend/flatten' autoload :Gettext, 'i18n/backend/gettext' autoload :KeyValue, 'i18n/backend/key_value' autoload :Memoize, 'i18n/backend/memoize' autoload :Metadata, 'i18n/backend/metadata' autoload :Pluralization, 'i18n/backend/pluralization' autoload :Simple, 'i18n/backend/simple' autoload :Transliterator, 'i18n/backend/transliterator'
As you can see, there is Pluralization exists.
I18n::Backend::Pluralization contains rails logic for extandable plural for different languages. We can easily place our ru.rb file to config\locales and write some simple logic from CLDR.
Thats all.
Today i just wrote small patch for one of our plugin, but it s stupid, we need general solution.
Thanks in advance.
Files
Related issues
Updated by Toshi MARUYAMA almost 9 years ago
- Status changed from New to Needs feedback
Could you give us patch for Redmine core?
Updated by Vasil Kovalevsky almost 9 years ago
- File 21856.patch 21856.patch added
Ok. Here is patch. As i wrote, only 1 line +
Updated by Toshi MARUYAMA over 8 years ago
- Status changed from Needs feedback to Closed
- Target version set to 3.3.0
- Resolution set to Fixed
Committed in trunk r15281, thanks.
Updated by Go MAEDA almost 3 years ago
- Related to Defect #36396: Custom I18n Pluralization rules are not applied correctly added