# Issue with pluralized (count) translation override

**URL:** https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019
**Category:** Bug
**Tags:** translation, fixed
**Created:** [July 11, 2024, 10:51pm UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019 "2024-07-11T22:51:43Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [July 11, 2024, 10:51pm UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/1 "2024-07-11T22:51:43Z")

</div>

Hello 👋

I’ve noticed the latest update uses the `one` version of the pluralized strings if the count is 1. The problem is, until now the pluralized strings always used the `other` version even if the count is 1 and on `/admin/customize/site_texts/` there is no option to find the `one` version of the string for example on Hungarian language. However on Hungarian there is no reason to use both version (one and other) because it’ll be pretty much the same.

Repro:

1. Change locale e.g. Hungarian
2. Go to `/admin/customize/site_texts/`
3. Search e.g. `js.topic_count_latest` and change the text.
4. Check it on the `See new or updated topics` banner.
5. It will use the default value when there is only 1 update available because the string you edited is the `other` version. If there is more new or updated topics the text will be change to what you added before.

Thank you 🙂

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 15, 2024, 7:46am UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/3 "2024-07-15T07:46:27Z")

</div>

Hello @Don

I did this test on Simplified Chinese and could not reproduce this issue 🤔

I added an extra char (highlighted) to the original string. And the change did happen when count was 1.

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/3/6/736ca649ad6a09625bd7742544af14fd314c0cb6.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/7/f/c7f11b2026bdcd0811880a5cdd8570162c62ebaa.png)

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [July 15, 2024, 8:00am UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/4 "2024-07-15T08:00:13Z")

</div>

Both languages have only “other” in their plurals definition

> <https://github.com/discourse/discourse/blob/9d8044a2ee24615e0e76cf8f31d6c72ffc0f9a0d/config/locales/plurals.rb#L45-L45>

> <https://github.com/discourse/discourse/blob/9d8044a2ee24615e0e76cf8f31d6c72ffc0f9a0d/config/locales/plurals.rb#L118-L118>

But Hungarian still has sparate translations for “one”.

> <https://github.com/discourse/discourse/blob/main/config/locales/client.hu.yml#L63>

which Chinese does not have

> <https://github.com/discourse/discourse/blob/main/config/locales/client.zh_CN.yml#L57>

I wonder why the separate “one” version is created in Crowdin

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [July 15, 2024, 8:18am UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/5 "2024-07-15T08:18:05Z")

</div>

Yeah, there are two versions in the Hungarian locale (one and other), but I think it never used the `one` version until now as it isn’t available in admin text customization either. It always fell back to the `other`.

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 16, 2024, 2:22am UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/6 "2024-07-16T02:22:51Z")

</div>

Can I ask, does Hungarian have any plural forms? If so, maybe we should add `:one` defination to plurals.rb

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 16, 2024, 2:37am UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/7 "2024-07-16T02:37:40Z")

</div>

I found the cause of the issue. Discourse’s I18n relies on the plural definition of an external library:

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse-i18n/src/index.js#L7](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse-i18n/src/index.js#L7)

But in this library, we can see that Hungarian is defined as using type `a`-class plurals, which distinguish between one and other.

> <https://github.com/eemeli/make-plural/blob/main/packages/plurals/cardinals.js#L264>

I don’t understand Hungarian at all, maybe someone could help point out whether their plural definition is wrong or ours 🙂

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [July 16, 2024, 5:09am UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/8 "2024-07-16T05:09:32Z")

</div>

Hello 👋

Thanks for checking it. ❤

> [@Lhc\_fl](#):
>
> Can I ask, does Hungarian have any plural forms?

Well, in Hungarian we have plural but not always which makes it little difficult. But let me explane some simple examples.

Most of Hungarian words have plural version.  
If it’s uncountable.  
E.g.  
Group → Groups = Csoport → Csoportok  
Topic → Topics = Téma → Témák

So it think that external library is correct in that we have plural form.

But we don’t use plural if there is a number (count) before words.  
If it’s countable.  
E.g.  
1 group → 2 groups = 1 csoport → 2 csoport  
1 topic → 2 topics = 1 téma → 2 téma

* * *

If you check the Hungarian language file you can see the plurals are always the same.

Hovewer I see there are strings which is not use `count` on form `one`.

Like this:

> <https://github.com/discourse/discourse/blob/main/config%2Flocales%2Fclient.hu.yml#L2763-L2765>

It’s ok because we don’t need the count in this case when only 1 topic it’s pretty obvious. But the other one difference here is only that the `other` is appears a number. The text is same no matter there is number or not.

* * *

So if you ask me I just would remove the `one` form.

But if it’s coming from an external library which is I think correct, because Hungarian have plural form but not most of cases that Discourse uses. So probably adding the `one` form to have the abality to customize it would be the easiest solution to prevent the issues. Yeah it is mooostly same but at least we can customize it in admin.

I don’t know it’s a hard question. As everyone who running a Hungarian forum and made customization in admin have been changed only the `other` form. Because it fell back to `other` from `one` always. So if we add the `one` form, admins have to review again all of the plural strings to modify that version too to be the same as `other`.

Thanks 🙂

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 16, 2024, 7:19am UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/9 "2024-07-16T07:19:44Z")

</div>

Thank you for your detailed response! Bug fix have been merged:

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

The fix adds `:one` form for Hungarian. Future crowdin translators may can try to remove %{count} for singular to make it look different from the `:other` form.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [July 16, 2024, 7:52am UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/10 "2024-07-16T07:52:57Z")

</div>

Thanks for the quick fix. ❤

> [@Lhc\_fl](#):
>
> Future crowdin translators may can try to remove %{count} for singular to make it look different from the `:other` form.

I think it’s ok, the `%{count}` is nicely follow the English locale. Which also don’t use `%{count}` in some plural strings `one` form. Now the change is only we can edit the `one` form in admin too which is enough I think in this case. I think if it’s work correctly no need to other changes. I’ll update soon to test it. 🙂

Seems everything works excellent 🙂 That was a great pastime to change all these but I almost done with it. 😄 Thanks again and thank you @Moin too to point this out. ❤

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [July 18, 2024, 7:53am UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/11 "2024-07-18T07:53:28Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [July 22, 2024, 12:12pm UTC](https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/12 "2024-07-22T12:12:36Z")

</div>

Tracking the wider issue at [Inconsistency in plural definition](https://meta.discourse.org/t/inconsistency-in-plural-definition/317456)
