Skip to content

fix: fixed hacky pluralization of contributors#3385

Open
Ducica wants to merge 1 commit intoinveniosoftware:masterfrom
oarepo:oarepo-contribution-multiple-contributors
Open

fix: fixed hacky pluralization of contributors#3385
Ducica wants to merge 1 commit intoinveniosoftware:masterfrom
oarepo:oarepo-contribution-multiple-contributors

Conversation

@Ducica
Copy link
Copy Markdown
Contributor

@Ducica Ducica commented Mar 26, 2026

❤️ Thank you for your contribution!

Description

Contributors widget on detail has a hacky pluralization that works only with English language. When used in any other language, it looks really strange:

image

We think it is not correct to use such a principle for pluralization, especially since this is supposed to be a multilingual value (title from a vocabulary item). Please if possible to merge.

Thank you,

Dusan S CESNET

@Ducica Ducica added this to v14 Mar 26, 2026
@Ducica Ducica moved this to Tested, triage in v14 Mar 26, 2026
{%- for group in record_ui["ui"]["contributors"]["contributors"]|groupby('role.title')%}
<div>
<h3 class="creatibutors-header ui small header">{{group.grouper}}{%- if group.list|length > 1 -%}s{%- endif -%}:</h3>
<h3 class="creatibutors-header ui small header">{{group.grouper}}:</h3>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't be the extra "s" missing now for English?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sure, but it is not possible to actually make pluralization here in a reasonable way, so in my opinion, it is better to have correct text in all languages without pluralization, thank to have correct pluralization in English, but gibberish in all other languages.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, can't we instead define on the group.grouper an extra property e.g group.grouper_plural to be able to translate both and not hack the s in the template?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, in my opinion, the issue is, that role.title, is a localized value from a vocabulary and you don't know what plural of that is. Meaning in english you know Supervisor is Supervisors, in Czech for example it is Supervizor and Supervizory. So I would say, unless you would store plurals of everything in the vocabulary, which is a humongous change, this cannot be done properly. If the english version pluralization is very important, we could keep the existing hack, only in case selected language is english, or potentially provide number in a bracket i.e. Supervisor (3):. Please let me know what you think

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand :) I like the idea of the (count). @kpsherva @ntarocco @slint any objections?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that we can't do pluralization properly unless we translate all the strings in their plural form (cc @utnapischtim and @tmorrell), so the ({count}) is a good middle-ground.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree ({count}) is probably the best option without completely refactoring the translations to include plurals

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks everyone, I've modified to use count instead.

@Ducica Ducica force-pushed the oarepo-contribution-multiple-contributors branch from 2fcc084 to 272e004 Compare April 1, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Tested, triage

Development

Successfully merging this pull request may close these issues.

5 participants