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

Pluralization issue when 1 < n < 2 (CTCP PING) #137

Closed
nyuszika7h opened this Issue Jul 24, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@nyuszika7h
Copy link
Contributor

commented Jul 24, 2014

If the number is anything but 1, it the plural form should be used. But that's not the case:

16:07:55 -- CTCP reply from nyuszika7h: PING 1.146 second

@nyuszika7h nyuszika7h changed the title Pluralization issue when 1 < n < 2 Pluralization issue when 1 < n < 2 (CTCP PING) Jul 24, 2014

@ghost

This comment has been minimized.

Copy link

commented Jul 24, 2014

Actually, it depends on the language. My own native language has different rules than English.

Since WeeChat uses gettext for localisation, I feel it's worth linking to this: http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html

@flashcode

This comment has been minimized.

Copy link
Member

commented Jul 25, 2014

@evropi: yes, WeeChat already uses plural form with gettext, but it looks like some plural strings are missing (by the way, if you know similar problem in other messages, please let me know).

@flashcode

This comment has been minimized.

Copy link
Member

commented Jul 26, 2014

Hmm... I tried and just read again the gettext doc, and I noticed the count argument for ngettext is an unsigned long int. So it's not possible to deal with float numbers :(
The doc clearly says it's not possible to use a plural form with a float number:

Negative and floating-point values usually represent physical entities for which
singular and plural don’t clearly apply. In such cases, there is no need to use
ngettext; a simple gettext call with a form suitable for all values will do.
For example:

printf (gettext ("Time elapsed: %.3f seconds"),
        num_milliseconds * 0.001);

Even if num_milliseconds happens to be a multiple of 1000, the output
    Time elapsed: 1.000 seconds
is acceptable in English, and similarly for other languages.

By the way, I don't agree with that. In French, "0 secondes" is wrong, but "0 seconde" is correct.
And then I think I can't fix that (unless they fix it in gettext, which will probably not hapen).

@flashcode flashcode added the wontfix label Jul 26, 2014

@flashcode flashcode removed this from the 1.0 milestone Jul 26, 2014

@flashcode flashcode closed this Jul 26, 2014

@flashcode

This comment has been minimized.

Copy link
Member

commented Jul 26, 2014

Or maybe an alternate solution would be to display "2.345s", so there's no more translation of "second".
For example it's already displayed like that when there's a timeout of a command run by hook_process:
End of command '%s', timeout reached (%.1fs).

@flashcode flashcode reopened this Jul 26, 2014

@flashcode flashcode removed the wontfix label Jul 26, 2014

@flashcode flashcode added this to the 1.0 milestone Jul 26, 2014

@flashcode flashcode modified the milestones: 1.0, 1.1 Aug 3, 2014

@flashcode flashcode closed this in ab8ea0f Aug 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.