private static string GetValue(PluralRules.PluralRuleDelegate pluralRule, int value, IReadOnlyList <string> units) { // Get the plural index from the plural rule, // unless there's only 1 unit in the first place: var pluralIndex = units.Count == 1 ? 0 : pluralRule(value, units.Count); return(string.Format(units[pluralIndex], value)); }
private static string getValue(PluralRules.PluralRuleDelegate pluralRule, int value, string[] units) { // Get the plural index from the plural rule, // unless there's only 1 unit in the first place: var pluralIndex = units.Length == 1 ? 0 : pluralRule(value, units.Length); return(string.Format(units[pluralIndex], value)); }
public TimeTextInfo(string week, string day, string hour, string minute, string second, string millisecond, string lessThan) { // Always use singular: this.PluralRule = (d, c) => 0; this.week = new[] { week }; this.day = new[] { day }; this.hour = new[] { hour }; this.minute = new[] { minute }; this.second = new[] { second }; this.millisecond = new[] { millisecond }; this.lessThan = lessThan; }
public TimeTextInfo(string week, string day, string hour, string minute, string second, string millisecond, string lessThan) { // must not be null here d = h = m = ms = s = w = new string[] {}; // Always use singular: PluralRule = (d, c) => 0; this.week = new[] { week }; this.day = new[] { day }; this.hour = new[] { hour }; this.minute = new[] { minute }; this.second = new[] { second }; this.millisecond = new[] { millisecond }; this.lessThan = lessThan; }
public TimeTextInfo(PluralRules.PluralRuleDelegate pluralRule, string[] week, string[] day, string[] hour, string[] minute, string[] second, string[] millisecond, string[] w, string[] d, string[] h, string[] m, string[] s, string[] ms, string lessThan) { this.PluralRule = pluralRule; this.week = week; this.day = day; this.hour = hour; this.minute = minute; this.second = second; this.millisecond = millisecond; this.w = w; this.d = d; this.h = h; this.m = m; this.s = s; this.ms = ms; this.lessThan = lessThan; }
public CustomPluralRuleProvider(PluralRules.PluralRuleDelegate pluralRule) { _pluralRule = pluralRule; }
public CustomPluralRuleProvider(PluralRules.PluralRuleDelegate pluralRule) { this.pluralRule = pluralRule; }