From a47a9e5e640dde91aa841dcc1478cd75481b5bbe Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 11 Mar 2016 16:02:33 +0100 Subject: [PATCH] remore ui replacements --- .../umbraco/controls/Tree/TreeControl.ascx | 2 +- .../umbraco/controls/Tree/CustomTreeControl.cs | 3 ++- .../umbraco/controls/Tree/CustomTreeService.cs | 8 +++++--- .../umbraco.presentation/umbraco/dialogs/create.aspx.cs | 3 ++- src/umbraco.controls/TreePicker/BaseTreePicker.cs | 9 ++++++--- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/controls/Tree/TreeControl.ascx b/src/Umbraco.Web.UI/umbraco/controls/Tree/TreeControl.ascx index 2b932bd027..200fd9b210 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/Tree/TreeControl.ascx +++ b/src/Umbraco.Web.UI/umbraco/controls/Tree/TreeControl.ascx @@ -27,7 +27,7 @@ jQuery(document).ready(function() { doNotInit: <%#ManualInitialization.ToString().ToLower()%>, jsonFullMenu: ctxMenu, appActions: UmbClientMgr.appActions(), - deletingText: '<%=umbraco.ui.GetText("deleting")%>', + deletingText: '<%=Services.TextService.Localize("deleting")%>', app: app, showContext: showContext, isDialog: isDialog, diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs index 3b5e2a53d1..65b7e100b7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs @@ -5,6 +5,7 @@ using System.Web.UI.HtmlControls; using ClientDependency.Core; using umbraco.controls.Tree; using Umbraco.Core.IO; +using Umbraco.Core.Services; namespace umbraco.controls.Tree { @@ -99,7 +100,7 @@ jQuery(document).ready(function() { doNotInit: " + ManualInitialization.ToString().ToLower() + @", jsonFullMenu: ctxMenu, appActions: UmbClientMgr.appActions(), - deletingText: '" + umbraco.ui.GetText("deleting") + @"', + deletingText: '" + Services.TextService.Localize("deleting") + @"', app: app, showContext: showContext, isDialog: isDialog, diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs index a47bf10759..3758d14781 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs @@ -10,6 +10,8 @@ using umbraco; using umbraco.cms.businesslogic; using umbraco.cms.presentation.Trees; using umbraco.controls.Tree; +using Umbraco.Core.Services; +using Umbraco.Web.WebServices; namespace umbraco.controls.Tree { @@ -18,7 +20,7 @@ namespace umbraco.controls.Tree /// [ScriptService] [WebService] - public class CustomTreeService : WebService + public class CustomTreeService : UmbracoWebService { /// /// Returns some info about the node such as path and id @@ -104,8 +106,8 @@ namespace umbraco.controls.Tree //we're going to hijack the node name here to make it say content/media var node = tree.RootNode; - if (node.Text.Equals("[FilteredContentTree]")) node.Text = ui.GetText("content"); - else if (node.Text.Equals("[FilteredMediaTree]")) node.Text = ui.GetText("media"); + if (node.Text.Equals("[FilteredContentTree]")) node.Text = Services.TextService.Localize("content"); + else if (node.Text.Equals("[FilteredMediaTree]")) node.Text = Services.TextService.Localize("media"); xTree.Add(node); returnVal.Add("json", xTree.ToString()); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs index a3269ab0e1..f4a4820a1e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs @@ -8,6 +8,7 @@ using Umbraco.Core.IO; using Umbraco.Web; using umbraco.cms.businesslogic; using Umbraco.Core; +using Umbraco.Core.Services; using Umbraco.Web.LegacyActions; using Umbraco.Web.UI.Pages; @@ -71,7 +72,7 @@ namespace umbraco.dialogs else { PageNameHolder.type = uicontrols.Feedback.feedbacktype.error; - PageNameHolder.Text = ui.GetText("rights") + " " + ui.GetText("error"); + PageNameHolder.Text = Services.TextService.Localize("rights") + " " + Services.TextService.Localize("error"); JTree.DataBind(); } } diff --git a/src/umbraco.controls/TreePicker/BaseTreePicker.cs b/src/umbraco.controls/TreePicker/BaseTreePicker.cs index b6c9985ed1..3a129812a6 100644 --- a/src/umbraco.controls/TreePicker/BaseTreePicker.cs +++ b/src/umbraco.controls/TreePicker/BaseTreePicker.cs @@ -6,6 +6,9 @@ using umbraco.interfaces; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using umbraco.cms.businesslogic; +using Umbraco.Core; +using Umbraco.Core.Services; + namespace umbraco.uicontrols.TreePicker { @@ -207,8 +210,8 @@ namespace umbraco.uicontrols.TreePicker DeleteLink = new HtmlAnchor(); DeleteLink.HRef = "#"; //set on pre-render DeleteLink.Style.Add(HtmlTextWriterStyle.Color, "red"); - DeleteLink.Title = ui.GetText("delete"); - DeleteLink.InnerText = ui.GetText("delete"); + DeleteLink.Title = ApplicationContext.Current.Services.TextService.Localize("delete"); + DeleteLink.InnerText = ApplicationContext.Current.Services.TextService.Localize("delete"); DeleteLink.Attributes.Add("class", "clear"); ButtonContainer.Controls.Add(DeleteLink); @@ -224,7 +227,7 @@ namespace umbraco.uicontrols.TreePicker //add choose link with padding ChooseLink = new HtmlAnchor(); ChooseLink.HRef = "#"; //filled in on pre-render - ChooseLink.InnerText = ui.GetText("choose") + "..."; + ChooseLink.InnerText = ApplicationContext.Current.Services.TextService.Localize("choose") + "..."; ChooseLink.Attributes.Add("data-section", this.TreePickerUrl); ChooseLink.Attributes.Add("class", "choose");