GNOME Bugzilla – Bug 670162
Use correct plurals for "Server doesn't support passwords longer than %d characters"
Last modified: 2012-08-23 20:07:35 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
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.
Why won't you just interpolate this value in the string then? Like "Server doesn't support passwords longer than 256 characters".
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)
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?
(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
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;
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.
This interferes with bug #682507 ...
*** This bug has been marked as a duplicate of bug 682507 ***