static private OnGetting___s ( System.Web.Mvc.MvcHtmlString defaultResult, |
||
defaultResult | System.Web.Mvc.MvcHtmlString | The I18NComplete default result. Returning null will fallback on this result, otherwise return a custom value to oveerride this. |
culture | The culture this translation is being translated | |
singularHTML | string | The text/HTML to be translated when count is 1 |
pluralHTML | string | The text/HTML to be translated when count is NOT 1 |
count | int | If count is 1 the singular text/HTML will be used, otherwise the plural text |
escapeArgumentFunc | string>.Func | The func to be applied for each argument .i.e. |
htmlArguments | object | The text/HTML arguments to be applied. For each argument will apply the escape func! |
리턴 | System.Web.Mvc.MvcHtmlString |
/// <summary> /// <para>@Alias <c>GetPluralRaw</c> and <c>FormatRawPlural</c></para> /// <para>Translates the given singular or plural HTML applying string.Format(html, arguments) to the current culture language. </para> /// <para>Warning! Neither the html nor the htmlArguments will be encoded whatsoever</para> /// </summary> /// <param name="culture">The culture being extended</param> /// <param name="singularHTML">The HTML to be translated when count is 1</param> /// <param name="pluralHTML">The HTML to be translated when count is NOT 1</param> /// <param name="count">If count is 1 the singular HTML will be used, otherwise the plural HTML</param> /// <param name="htmlArguments">The html arguments to be applied. Warning! The arguments will not be htmlEncoded!</param> /// <returns>The translated formatted HTML as MvcHtmlString</returns> public static MvcHtmlString ___s(this CultureInfo culture, string singularHTML, string pluralHTML, int count, params object[] htmlArguments) { var result = new MvcHtmlString( ((htmlArguments == null || htmlArguments.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(htmlArguments).ToArray()))); return (#if DEBUG I18NComplete.OnGetting___s(result, culture, singularHTML, pluralHTML, count, htmlArguments) ?? #endif result); }