Project

General

Profile

Actions

Defect #21856

closed

I18n backend does not support original i18n Pluralization

Added by Vasil Kovalevsky about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
I18n
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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

21856.patch (552 Bytes) 21856.patch Vasil Kovalevsky, 2016-02-24 04:52

Related issues

Related to Redmine - Defect #36396: Custom I18n Pluralization rules are not applied correctlyClosedGo MAEDA

Actions
Actions #1

Updated by Toshi MARUYAMA about 8 years ago

  • Category set to I18n
Actions #2

Updated by Toshi MARUYAMA about 8 years ago

  • Status changed from New to Needs feedback

Could you give us patch for Redmine core?

Actions #3

Updated by Vasil Kovalevsky about 8 years ago

Ok. Here is patch. As i wrote, only 1 line +

Actions #4

Updated by Toshi MARUYAMA about 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.

Actions #5

Updated by Go MAEDA about 2 years ago

  • Related to Defect #36396: Custom I18n Pluralization rules are not applied correctly added
Actions

Also available in: Atom PDF