Fix for Application Path on localization to deal with virtual paths

This commit is contained in:
Nicholas Mayne
2015-02-18 15:32:23 +00:00
parent 1a5a483568
commit f1d97b7251

View File

@@ -34,7 +34,10 @@ namespace Orchard.Localization.Selectors {
path = context.Request.Path;
}
var content = GetByPath(path.TrimStart('/'));
var appPath = context.Request.ApplicationPath ?? "/";
var requestUrl = (path.StartsWith(appPath) ? path.Substring(appPath.Length) : path).TrimStart('/');
var content = GetByPath(requestUrl);
if (content != null) {
return new CultureSelectorResult { Priority = -2, CultureName = _localizationService.Value.GetContentCulture(content) };
}