mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
reverting file annotations
This commit is contained in:
@@ -26,19 +26,19 @@ namespace Orchard.Mvc.ViewEngines.Razor {
|
||||
public Localizer T {
|
||||
get {
|
||||
// first time used, create it
|
||||
if (_localizer == NullLocalizer.Instance) {
|
||||
if(_localizer == NullLocalizer.Instance) {
|
||||
|
||||
// if the Model is a shape, get localization scopes from binding sources
|
||||
// e.g., Logon.cshtml in a theme, overriging Users/Logon.cshtml, needs T to
|
||||
// fallback to the one in Users
|
||||
var shape = Model as IShape;
|
||||
if (shape != null && shape.Metadata.BindingSources.Count > 1) {
|
||||
if(shape != null && shape.Metadata.BindingSources.Count > 1) {
|
||||
var localizers = shape.Metadata.BindingSources.Reverse().Select(scope => LocalizationUtilities.Resolve(ViewContext, scope)).ToList();
|
||||
_localizer = (text, args) => {
|
||||
foreach (var localizer in localizers) {
|
||||
foreach(var localizer in localizers) {
|
||||
var hint = localizer(text, args);
|
||||
// if not localized using this scope, use next scope
|
||||
if (hint.Text != text) {
|
||||
if(hint.Text != text) {
|
||||
return hint;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user