From 6eeb9d6af46d173e864875d5ad3623656c91f4c8 Mon Sep 17 00:00:00 2001 From: Lars-Erik Aabech Date: Tue, 7 Jan 2014 18:53:47 +0100 Subject: [PATCH] Forgot document type on general properties tab --- .../Models/Mapping/TabsAndPropertiesResolver.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs index dc99f70c58..95a46b0e27 100644 --- a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs @@ -94,7 +94,7 @@ namespace Umbraco.Web.Models.Mapping { Alias = string.Format("{0}doctype", Constants.PropertyEditors.InternalGenericPropertiesPrefix), Label = ui.Text("content", "documentType"), - Value = display.ContentTypeName, + Value = TranslateItem(display.ContentTypeName, CreateDictionary()), View = labelEditor } }; @@ -209,12 +209,18 @@ namespace Umbraco.Web.Models.Mapping // This should really be centralized and used anywhere globalization applies. internal string TranslateItem(string text) + { + var cultureDictionary = CultureDictionary; + return TranslateItem(text, cultureDictionary); + } + + private static string TranslateItem(string text, ICultureDictionary cultureDictionary) { if (!text.StartsWith("#")) return text; text = text.Substring(1); - return CultureDictionary[text].IfNullOrWhiteSpace(text); + return cultureDictionary[text].IfNullOrWhiteSpace(text); } private ICultureDictionary CultureDictionary @@ -223,8 +229,13 @@ namespace Umbraco.Web.Models.Mapping { return cultureDictionary ?? - (cultureDictionary = CultureDictionaryFactoryResolver.Current.Factory.CreateDictionary()); + (cultureDictionary = CreateDictionary()); } } + + private static ICultureDictionary CreateDictionary() + { + return CultureDictionaryFactoryResolver.Current.Factory.CreateDictionary(); + } } }