static private OnGetting__ ( 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 | |
html | string | The html to be translated |
arguments | object | Custom arguments list to be passed to string.Format |
리턴 | System.Web.Mvc.MvcHtmlString |
/// <summary> /// <para>@Alias <c>GetHtml</c> and <c>FormatHtml</c></para> /// <para>Translates the given html applying string.Format(html, arguments.Select(a => HttpUtility.HtmlEncode(a))) to the current culture language. </para> /// <para>The html will be kept as it is, while arguments will be automatically HTML Encoded</para> /// </summary> /// <param name="culture">The culture being extended</param> /// <param name="html">The html to be translated</param> /// <param name="arguments">Custom arguments list to be passed to string.Format</param> /// <returns>The translated formatted html as MvcHtmlString</returns> /// <created author="laurentiu.macovei" date="Fri, 06 Jan 2012 23:49:22 GMT"/> public static MvcHtmlString __(this CultureInfo culture, string html, params object[] arguments) { var result = new MvcHtmlString(string.Format(I18NComplete.GetText(html, lcid: culture.LCID), arguments.Select(a => HttpUtility.HtmlEncode(a)).ToArray())); return (#if DEBUG I18NComplete.OnGetting__(result, culture, html, arguments) ?? #endif result); }