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 text to be translated |
escapeArgumentFunc | string>.Func | The func to be applied for each argument .i.e. |
htmlArguments | object | The html arguments to be applied. For each argument will apply the escape func! |
리턴 | System.Web.Mvc.MvcHtmlString |
/// <summary> /// <para>@Alias <c>GetRaw</c> and <c>FormatRaw</c></para> /// <para>Translates the given html applying string.Format(html, htmlArguments) 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="html">The html to be translated</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> /// <created author="laurentiu.macovei" date="Fri, 06 Jan 2012 23:46:39 GMT"/> public static MvcHtmlString ___(this CultureInfo culture, string html, params object[] htmlArguments) { var result = new MvcHtmlString(string.Format(I18NComplete.GetText(html, lcid: culture.LCID), htmlArguments)); return (#if DEBUG I18NComplete.OnGetting___(result, culture, html, htmlArguments) ?? #endif result); }
/// <summary> /// <para>@Alias <c>GetRaw</c> and <c>FormatRaw</c></para> /// <para>Translates the given html applying string.Format(html, arguments.Select(a => escapeArgumentFunc(a))) to the current culture language. </para> /// <para>For each argument the escape func will be called before applying the format</para> /// </summary> /// <param name="culture">The culture being extended</param> /// <param name="html">The text to be translated</param> /// <param name="htmlArguments">The html arguments to be applied. For each argument will apply the escape func!</param> /// <param name="escapeArgumentFunc">The func to be applied for each argument .i.e. <c>a => HttpUtility.HtmlAttributeEncode(a)</c></param> /// <returns>The translated formatted html as MvcHtmlString</returns> /// <created author="laurentiu.macovei" date="Fri, 06 Jan 2012 23:46:56 GMT"/> public static MvcHtmlString ___(this CultureInfo culture, string html, Func <object, string> escapeArgumentFunc, params object[] htmlArguments) { var result = new MvcHtmlString(string.Format(I18NComplete.GetText(html, lcid: culture.LCID), htmlArguments .Select(a => escapeArgumentFunc(a)).ToArray())); return (#if DEBUG I18NComplete.OnGetting___(result, CultureInfo.CurrentCulture, html, escapeArgumentFunc, htmlArguments) ?? #endif result); }