static private OnGetting___q ( 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 |
return | System.Web.Mvc.MvcHtmlString |
internal static MvcHtmlString OnGetting___q(MvcHtmlString defaultResult, CultureInfo culture, string html, params object[] htmlArguments)
{
if (Getting___q != null)
return Getting___q(defaultResult, culture, html, htmlArguments);
return null;
}
/// <summary> /// <para>Quotes the text as the xgettext cannot correctly extract values from attributes</para> /// <para>Translates the given html applying '"'+HttpUtility.HtmlAttributeEncode(string.Format(html, htmlArguments))+'"' to the current culture language. </para> /// <para>Warning! Neither the html nor the htmlArguments will be encoded whatsoever</para> /// <para>Usage: <div title=@___q("< class='tip'>There are {0} {1} in cart.</div>", 3, "<b>Items</b>")>... -- Note the missing quotes!</para> /// </summary> /// <param name="culture">The culture being extended</param> /// <param name="html">The html text to be translated</param> /// <param name="htmlArguments">Custom arguments list to be passed to string.Format</param> /// <returns>The translated formatted html as MvcHtmlString</returns> /// <created author="laurentiu.macovei" date="Fri, 13 Jan 2012 03:55:43 GMT"/> public static MvcHtmlString ___q(this CultureInfo culture, string html, params object[] htmlArguments) { var result = new MvcHtmlString('"' + HttpUtility.HtmlAttributeEncode(string.Format(I18NComplete.GetText(html, lcid: culture.LCID), htmlArguments.Select(a => HttpUtility.HtmlEncode(a)).ToArray())) + '"'); return (#if DEBUG I18NComplete.OnGetting___q(result, culture, html, htmlArguments) ?? #endif result); }