After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670162 - Use correct plurals for "Server doesn't support passwords longer than %d characters"
Use correct plurals for "Server doesn't support passwords longer than %d char...
Status: RESOLVED DUPLICATE of bug 682507
Product: gvfs
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2012-02-15 19:43 UTC by Ihar Hrachyshka
Modified: 2012-08-23 20:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Switching to ngettext (1.57 KB, patch)
2012-08-01 18:44 UTC, Felix Möller
none Details | Review

Description Ihar Hrachyshka 2012-02-15 19:43:08 UTC
#: ../daemon/gvfsafpserver.c:171 ../daemon/gvfsafpserver.c:457
#, c-format
msgid "Server doesn't support passwords longer than %d characters"
msgstr ""

See: https://live.gnome.org/TranslationProject/DevGuidelines/Plurals
Comment 1 Tomas Bzatek 2012-06-22 13:57:51 UTC
The exact code excerpt is:

>  if (strlen (password) > 256)
>  {
>    g_set_error (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
>                 _("Server doesn't support passwords longer than %d characters"), 256);
>    goto error;
>  }

The number is a constant and I don't think switching to ngettext() is really needed here.

Added a comment.
Comment 2 Ihar Hrachyshka 2012-06-22 14:00:19 UTC
Why won't you just interpolate this value in the string then? Like "Server doesn't support passwords longer than 256 characters".
Comment 3 Bastien Nocera 2012-06-22 14:02:51 UTC
Either change the text to not use %d in there, or add a translator comment. I don't see why you wouldn't use the right text directly.

(PS: you should use a macro if you're going to use the same value in multiple places btw)
Comment 4 Felix Möller 2012-08-01 13:55:20 UTC
It contains the %d because this has been mentioned in bug #657906 as this string exists with two different lengths and now just has to be translated once.

../daemon/gvfsafpserver.c:172:                 _("Server doesn't support passwords longer than %d characters"), 256);
../daemon/gvfsafpserver.c:458:                _("Server doesn't support passwords longer than %d characters"), 64);

However, %d hopefully is never 1 (passwords with length 1 are useless) and thus there is no need for the singular form.

Close it?
Comment 5 André Klapper 2012-08-01 14:06:57 UTC
(In reply to comment #4)
> However, %d hopefully is never 1 (passwords with length 1 are useless) and thus
> there is no need for the singular form.
> Close it?

No, as proper internationalization has nothing to do with checking for 1. :)
See https://live.gnome.org/TranslationProject/DevGuidelines/Plurals
Comment 6 André Klapper 2012-08-01 15:52:33 UTC
For the records why things are so complicated and why you can never really assume anything:

<fm> i am not sure if there is any language in the world which uses a different form for 64 or 256 ...
<andre__> fm: are you sure that 64 and 256 are the only two options that will ever apply?
<fm> andre__, unless apple changes the file protocol: yes
<andre__> fm: In Arabic, 20 through 90 require a noun to be in accusative singular; 100 and up require the genitive singular.
<andre__> (from https://en.wikipedia.org/wiki/Arabic_grammar )
<andre__> From http://l10n.gnome.org/languages/ar/ : nplurals=6; plural= n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;
Comment 7 Felix Möller 2012-08-01 18:44:23 UTC
Created attachment 220094 [details] [review]
Switching to ngettext

After reading the translation guideline, I hope this is correct.

I checked and it still compiles and generates a good .pot.

Please review and apply.
Comment 8 Felix Möller 2012-08-23 09:28:20 UTC
This interferes with bug #682507 ...
Comment 9 William Jon McCann 2012-08-23 20:07:35 UTC

*** This bug has been marked as a duplicate of bug 682507 ***