PDA

View Full Version : Localization - plural form of noun "Directory has %x file"


DotNetBoy
04-12-2005, 08:10 AM
hi,

i would like to know how to localize this sentence:
" directory has %x file"

x is variable and this sentence can be changed by the value of x:

x=1 directory has 1 file
x=25 directory has 25 files

In PHP I can use i.e. ngettext().
But how can I solve this problem in ASP.NET?

ps: use "file(s)" is not good reason:)

KBJensen
08-03-2006, 06:40 AM
string.Format("directory has {0} file{1}", x, x == 1 ? "" : "s");