プロジェクト

全般

プロフィール

Vote #77130

完了

I18n backend does not support original i18n Pluralization

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
I18n_37
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
37
version_id:
110
issue_org_id:
21856
author_id:
103744
assigned_to_id:
0
comments:
5
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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.


journals

--------------------------------------------------------------------------------
Could you give us patch for Redmine core?
--------------------------------------------------------------------------------
Ok. Here is patch. As i wrote, only 1 line +
--------------------------------------------------------------------------------
Committed in trunk r15281, thanks.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,36396,Custom I18n Pluralization rules are not applied correctly

Admin Redmine さんが3年以上前に更新

  • カテゴリI18n_37 にセット
  • 対象バージョン3.3.0_110 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0