System.Globalization.I18N.__s C# (CSharp) Method

__s() public static method

@Alias GetPluralHtml and FormatHtmlPlural

Translates the given singular or plural HTML applying string.Format(html, arguments.Select(a => HttpUtility.HtmlEncode(a))) to the current culture language.

The singular/plural HTML will be kept as it is, while arguments will be automatically HTML Encoded

public static __s ( this culture, string singularHTML, string pluralHTML, int count ) : System.Web.Mvc.MvcHtmlString
culture this The culture being extended
singularHTML string The HTML to be translated when count is 1
pluralHTML string The HTML to be translated when count is NOT 1
count int If count is 1 the singular HTML will be used, otherwise the plural text
return System.Web.Mvc.MvcHtmlString
        public static MvcHtmlString __s(this CultureInfo culture, string singularHTML, string pluralHTML, int count, params object[] arguments)
        {
            var result = new MvcHtmlString(
                (arguments == null || arguments.Length == 0)
                ? string.Format(count == 1 ? I18NComplete.GetText(singularHTML, lcid: culture.LCID) : I18NComplete.GetText(singularHTML, plural: true, lcid: culture.LCID), count)
                : string.Format(count == 1 ? I18NComplete.GetText(singularHTML, lcid: culture.LCID) : I18NComplete.GetText(singularHTML, plural: true, lcid: culture.LCID), new object[] { count }.Concat(arguments.Select(a => HttpUtility.HtmlEncode(a))).ToArray()));
            return
            #if DEBUG
             I18NComplete.OnGetting__s(result, culture, singularHTML, pluralHTML, count, arguments) ??
            #endif
             result;
        }