Thread (12 messages) flat view 12 messages, 5 authors, 2016-06-15

Re: [PATCH] For Real - Fixed pluralization in diff reports

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:51:44

Jon Forrest [off-list ref] writes:
On 8/1/2011 2:58 AM, Sverre Rabbelier wrote:
quoted
On Mon, Aug 1, 2011 at 06:46, Jon Forrest[off-list ref]  wrote:
quoted
quoted
        fprintf(options->file, "%s", line_prefix);
        fprintf(options->file,
-              " %d files changed, %d insertions(+), %d deletions(-)\n",
-              total_files, adds, dels);
+              " %d file%s changed, %d insertion%s(+), %d deletion%s(-)\n",
+              total_files, total_files == 1 ? "" : "s", adds, adds == 1 ?
"" : "s", dels,
+               dels == 1 ? "" : "s");
  }
Also, this is rather detrimental to the i18n effort methinks?
Besides, as it was already said, this is an API.
 
If the goal if the i18n effort is also to produce grammatically
correct output in all the supported languages then the
tests that my patch would break would have to be rewritten
anyway.
That's not it.

The problem is that above code assumes that plural form can be formed
by adding suffix, and it assumes that is only one plural form... both
assumptions does not hold for non-English.

C.f. "Additional functions for plural forms" chapter in gettext info
page: http://www.gnu.org/s/hello/manual/gettext/Plural-forms.html

-- 
Jakub Narębski
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help