In Java, there is a class ChoiceFormat that can be used to localize strings based on a number value:
ChoiceFormat fmt = new ChoiceFormat("0#no values found | 1#one value found|1<many values found");
System.out.println(fmt.format(0)); // no values found
System.out.println(fmt.format(1)); // one value found
System.out.println(fmt.format(2)); // many values found
System.out.println(fmt.format(10)); // many values found
This is of course very important when internationalizing software, i.e. when supporting languages that have not only a singular and plural, but a dual, too. Such a language might have something like this "0#no values found | 1#one value found|2#both values found |1<many values found" and fmt.format(2)
and fmt.format(10)
would print different values unlike English.
What is the counterpart in C# for this functionality?