Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] There ARE 1 new articles #6470

Open
AbelLykens opened this issue May 17, 2024 · 6 comments
Open

[Bug] There ARE 1 new articles #6470

AbelLykens opened this issue May 17, 2024 · 6 comments

Comments

@AbelLykens
Copy link

Describe the bug

image

Are should be is in these notifications. Love Freshrss so thanks!!

To Reproduce

Get 1 new unread article, have notifications enabled.

Expected behavior

Are should be is

FreshRSS version

1.23.1

Environment information

  • Database version: Mariadb
  • PHP version: PHP
  • Installation type: From source
    -Web server type: Apache
  • Device: PC
  • OS: Hosted on Debian 12, viewing on Win11
  • Browser: Firefox 126

Additional context

No response

@AbelLykens AbelLykens added the Bug (unconfirmed) issues thar could not reproduced yeat label May 17, 2024
@Alkarex Alkarex added this to the Backlog milestone May 17, 2024
@math-GH math-GH added Bug (confirmed) 🐞 issues that are reproducable and removed Bug (unconfirmed) issues thar could not reproduced yeat labels May 18, 2024
@math-GH
Copy link
Contributor

math-GH commented May 19, 2024

I would say that it is worth to fix ;)

But keep in mind that different languages have different issues with numbers and grammar.

Here an example from Russian language: 2,3,4 have another grammar case then 6 upwards. (it repeats with 22,23,24, 32,33,34,42,43 and so on)

Есть 1 новая статья

Есть 2 новые статьи
Есть 3 новые статьи
Есть 4 новые статьи

Есть 5 новых статей
Есть 6 новых статей

@Manitosh-Paul
Copy link

Hello team, I am a new contributor and want to contribute to open source.
This issue can be found in file: https://github.com/FreshRSS/FreshRSS/blob/5b197b8130efed7953f42cde0cbd2217b7fb0dbe/app/i18n/el/gen.php#L132C5-L132C22

However, there is one more issue with this bug i.e.,
If there is only one unread article the message should be like this: "There is %%d new article to read on FreshRSS." otherwise, the message should be: "There are %%d new articles to read on FreshRSS."

As, I am new contibutor in PHP too, I think we can use conditional statement something like this in line number 132:
'body_new_articles' => ('%%d'==1 ? 'There is %%d new article to read on FreshRSS.' : 'There are %%d new articles to read on FreshRSS.'),

@Alkarex
Copy link
Member

Alkarex commented May 31, 2024

@Manitosh-Paul Thanks for trying to help :-)
As @math-GH is writing just above, the grammar of numbers is more complicated than just having two cases for singular and plural (although it would probably cover several languages well enough). So the first step is to list a couple of approaches, for instance by finding out how it is done in other projects (maybe WordPress for instance, although I have not sure they are facing this problem).

@Manitosh-Paul
Copy link

@Alkarex In that case this bug should remain unchanged due to language dynamics, so, should we focus on this bug ?

@Alkarex
Copy link
Member

Alkarex commented May 31, 2024

Yes, it would be nice if someone could dig a bit into that issue at some point, but it is not urgent

@Frenzie
Copy link
Member

Frenzie commented May 31, 2024

Wordpress uses gettext (although also some JSON thing for JS).

If you're curious about how gettext goes about things I wrote a custom implementation: http://koreader.rocks/doc/modules/gettext.html#ngettext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants