# Romanian pluralization rules are wrong

**URL:** https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761
**Category:** Bug
**Created:** [March 30, 2016, 1:12pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761 "2016-03-30T13:12:31Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [March 30, 2016, 1:12pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761/1 "2016-03-30T13:12:31Z")

</div>

Hey guys.

I noticed (the hard way…) that translating numbers is a bit off. The expectation was „enforced” by transifex’s one/few/other for cases that contain numbers to behave in a certain way. At least in romanian, we have this rules:

- for one item is obvious;
- for up to 20 items, it’s also ok (e.g.: 19 items);
- over 20 items it’s an extra particle (e.g. 21 _of_ items ).

Anyhow, I marched on the idea that this was implemented and updated quite a few strings to act accordingly. After the update? Surprise! Only „one” and „other” cases are used, leaving me with awkward translations 🙂

This can be changed? Or can transifex be configured to not show the redundant one? (because you cannot save a translation that doesn’t have all three translation)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [March 30, 2016, 1:47pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761/2 "2016-03-30T13:47:09Z")

</div>

The pluralization rules used by Discourse are wrong:

> <https://github.com/discourse/discourse/blob/main/config/locales/plurals.rb#L82-L82>

See: [http://www.unicode.org/cldr/charts/27/supplemental/language\_plural\_rules.html#ro](http://www.unicode.org/cldr/charts/27/supplemental/language_plural_rules.html#ro)

It should be like this:  
[https://github.com/discourse/discourse/blob/master/lib/javascripts/locale/ro.js](https://github.com/discourse/discourse/blob/master/lib/javascripts/locale/ro.js)

---

<div class="post-metadata">

### Author: ![tibarra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tibarra/32/52222_2.png) [@tibarra](https://meta.discourse.org/u/tibarra)
#### Post date: [March 30, 2016, 7:30pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761/3 "2016-03-30T19:30:22Z")

</div>

How can i repro this? i want to fix it

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [March 30, 2016, 7:40pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761/4 "2016-03-30T19:40:35Z")

</div>

Already pushed a pull request here: [Romanian Plurals by iamntz · Pull Request #4126 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/4126)

However, in order to reproduce, the best place to check is on like counter:

- on more than one, less than 19 likes, you should read „3 aprecieri”
- over 20 likes, you should read „23 **de** aprecieri”.

---

<div class="post-metadata">

### Author: ![tibarra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tibarra/32/52222_2.png) [@tibarra](https://meta.discourse.org/u/tibarra)
#### Post date: [March 30, 2016, 8:48pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761/5 "2016-03-30T20:48:19Z")

</div>

I think you forgot to take care of the 100 modules in your logic as in this section:

```plaintext
if (n === 0 || n != 1 && (n % 100) >= 1 &&
      (n % 100) <= 19 && n == Math.floor(n)) {
    return 'few';
  }

```

I made a PR with that conditionals too, but your solution was great! Cheers!

[https://github.com/discourse/discourse/pull/4127](https://github.com/discourse/discourse/pull/4127)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 30, 2016, 9:27pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761/6 "2016-03-30T21:27:31Z")

</div>

I merged @iamntz’s change, thanks ❤

@tibarra if we also need this change submit a PR

---

<div class="post-metadata">

### Author: ![tibarra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tibarra/32/52222_2.png) [@tibarra](https://meta.discourse.org/u/tibarra)
#### Post date: [March 30, 2016, 10:02pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761/7 "2016-03-30T22:02:10Z")

</div>

Q: So, i make it again considering the modules?

A: Never mind, i already did it 😅

[https://github.com/discourse/discourse/pull/4128](https://github.com/discourse/discourse/pull/4128)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 30, 2016, 10:33pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761/8 "2016-03-30T22:33:57Z")

</div>

Thanks !! merged the PR in

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 30, 2016, 10:34pm UTC](https://meta.discourse.org/t/romanian-pluralization-rules-are-wrong/41761/9 "2016-03-30T22:34:03Z")

</div>


