martinandert / counterpart

A translation and localization library for Node.js and the browser.
MIT License
242 stars 25 forks source link

Pluralization Issue #24

Closed janroesner closed 9 years ago

janroesner commented 9 years ago

With:

module.exports = {
  "greeting": "Hello, %(name)s!",
  "x_nights": {
    "zero": "No Night",
    "one":   "1 Night",
    "other": "%(count) Nights"
  }
}

executing:

translate('x_nights.other', {count: 3}) results in:

Uncaught Error: [sprintf] %(count) Nächte(…)

martinandert commented 9 years ago

Hi,

it has to be "%(count)s Nights". Notice the "s" after the ")".

janroesner commented 9 years ago

@martinandert: That was not obvious in the first place. Thx for your quick reaction!