🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2873

Re: Printing plural forms.

#2873
From: Dan Bernstein
Date: Sat, 02 Mar 1991 00:51
19 lines
1378 bytes
In article <1991Feb26.161256.14202@hq.demos.su> avg@hq.demos.su (Vadim Antonov) writes:
> Got the point? I've spent a hell lot of time making bilingual release
> of Unix (Russian and English) and finally I think it would be better
> to have a standard function for producing plural forms, something like:
> 	printf("%d file%s copied\n", n, plural(n, ":s", "english"));
> 	printf("%d fail%s skopirovan%s\n", n, plural(n, "ov::a", "russian"),
> 					      plural(n, "o::o", "russian"));

In my forthcoming error-message library:

  %1 file%{%1%(e-plural)} copied%
  %1 fail%{%1%(r1-plural)} skopirovan%{%1%(r2-plural)}%

where e-plural is ``%_1%_%=%?s:'' and r{1,2}-plural are something like
``%_%d1%_%-10%_%/10%_%*%-%d1%_%=%?ov:%!%?{5%_%<%?a:}:'' Okay, okay, so
the interface still needs quite a bit of work, but this sort of
internationalization can certainly be done within configuration files.

---Dan
Technical Details
Message-ID: <5931:Mar200:51:5191@kramden.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
References: <3404.27c905aa@iccgcc.decnet.ab.com> <1991Feb26.012135.6029@ico.isc.com> <1991Feb26.161256.14202@hq.demos.su>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein)
Newsgroups: comp.lang.misc
Subject: Re: Printing plural forms.
Message-ID: <5931:Mar200:51:5191@kramden.acf.nyu.edu>
Date: 2 Mar 91 00:51:51 GMT
References: <3404.27c905aa@iccgcc.decnet.ab.com> <1991Feb26.012135.6029@ico.isc.com> <1991Feb26.161256.14202@hq.demos.su>
Organization: IR
Lines: 19