#19010: Removing Html encoding when translating arguments

Work Item: 19010

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-09-19 12:57:23 -07:00
parent 62023ea6aa
commit caab31f881

View File

@@ -11,7 +11,6 @@ namespace Orchard.Localization {
private readonly IWorkContextAccessor _workContextAccessor;
private readonly ILocalizedStringManager _localizedStringManager;
public Text(string scope, IWorkContextAccessor workContextAccessor, ILocalizedStringManager localizedStringManager) {
_scope = scope;
_workContextAccessor = workContextAccessor;
@@ -30,7 +29,7 @@ namespace Orchard.Localization {
return args.Length == 0
? new LocalizedString(localizedFormat, _scope, textHint, args)
: new LocalizedString(string.Format(GetFormatProvider(currentCulture), localizedFormat, args.Select(Encode).ToArray()), _scope, textHint, args);
: new LocalizedString(string.Format(GetFormatProvider(currentCulture), localizedFormat, args), _scope, textHint, args);
}
private static IFormatProvider GetFormatProvider(string currentCulture) {
@@ -41,12 +40,5 @@ namespace Orchard.Localization {
return null;
}
}
static object Encode(object arg) {
if (arg is IFormattable || arg is IHtmlString) {
return arg;
}
return HttpUtility.HtmlEncode(arg);
}
}
}