git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 3, 2011, 13:38 UTC
Message-ID
<m3livdqh9h.fsf@localhost.localdomain>
In-Reply-To
<4E36B8E4.5080900@gmail.com>
Jon Forrest <nobozo@gmail.com> writes:
> On 8/1/2011 2:58 AM, Sverre Rabbelier wrote:
>> On Mon, Aug 1, 2011 at 06:46, Jon Forrest<nobozo@gmail.com>  wrote:
Show 11 quoted lines
>>>         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
Previous: Jeff KingNext: Jon Forrest
Message 11 of 12 in “For Real - Fixed pluralization in diff reports”
  1. For Real - Fixed pluralization in diff reportsJon Forrest, Aug 1, 2011
  2. Nguyen Thai Ngoc DuyAug 1, 2011
  3. Jon ForrestAug 1, 2011
  4. Nguyen Thai Ngoc DuyAug 1, 2011
  5. Sverre RabbelierAug 1, 2011
  6. Jon ForrestAug 1, 2011
  7. Jeff KingAug 1, 2011
  8. Jon ForrestAug 1, 2011
  9. Sverre RabbelierAug 1, 2011
  10. Jeff KingAug 1, 2011
  11. Jakub NarebskiAug 3, 2011
  12. Jon ForrestAug 3, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.