8000 Feature Request: Improve I18n pluralize method · Issue #100 · fnando/i18n · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Feature Request: Improve I18n pluralize method #100
Open
@eugenet8k

Description

@eugenet8k

Description

Derived from the bug #99. If I wanted to patch current I18n.pluralize behavior by overriding pluralize method, it wouldn't work. This is because i18n class has code duplication and it does not uses a single point of entry into pluralizer

Describe the solution

To update lines

i18n/src/I18n.ts

Lines 383 to 389 in f49c86d

translation = pluralize({
i18n: this,
count: options.count || 0,
scope: translation as unknown as string,
options,
baseScope: getFullScope(this, scope, options),
});

to something like

translation = this.pluralize({ 
   count: options.count || 0, 
   scope: translation as unknown as string, 
   options, 
   baseScope: getFullScope(this, scope, options), 
 }); 

in this case the overrides pluralize will be respected count based translations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0