From 55301b9b6bc1d17a2c3533d3df7e4a16eb5ab23a Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 11 Mar 2016 15:14:31 +0100 Subject: [PATCH] start replacing ui.text calls... now gonna try some regex. --- .../umbraco/dialogs/emptyTrashcan.aspx | 2 +- .../property/EditStyleSheetProperty.aspx | 13 +++++------ .../umbraco/settings/views/EditView.aspx.cs | 13 ++++++----- src/umbraco.businesslogic/ui.cs | 23 +------------------ .../businesslogic/workflow/Notification.cs | 5 +++- 5 files changed, 19 insertions(+), 37 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/emptyTrashcan.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/emptyTrashcan.aspx index a6bcd4084b..1a54e016d6 100644 --- a/src/Umbraco.Web.UI/umbraco/dialogs/emptyTrashcan.aspx +++ b/src/Umbraco.Web.UI/umbraco/dialogs/emptyTrashcan.aspx @@ -61,7 +61,7 @@
- <%=umbraco.ui.Text("deleting", UmbracoUser)%> + <%=Services.TextService.Localize("deleting")%>
diff --git a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx index 96991df575..33be29065a 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx +++ b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx @@ -1,7 +1,6 @@ <%@ Page Language="c#" MasterPageFile="../../../masterpages/umbracoPage.Master" CodeBehind="EditStyleSheetProperty.aspx.cs" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.Settings.Stylesheet.Property.EditStyleSheetProperty" ValidateRequest="False" %> - <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> @@ -10,26 +9,26 @@
- <%=umbraco.ui.Text("name", UmbracoUser)%>: + <%=Services.TextService.Localize("name")%>
- <%=umbraco.ui.Text("stylesheet", "nameHelp", UmbracoUser)%> + <%=Services.TextService.Localize("stylesheet/nameHelp")%>
- <%=umbraco.ui.Text("alias", UmbracoUser)%>: + <%=Services.TextService.Localize("alias")%>:
- <%=umbraco.ui.Text("stylesheet", "aliasHelp", UmbracoUser)%> + <%=Services.TextService.Localize("stylesheet/aliasHelp")%>
- <%=umbraco.ui.Text("styles", UmbracoUser)%>: + <%=Services.TextService.Localize("styles")%> @@ -39,7 +38,7 @@
- <%=umbraco.ui.Text("preview", UmbracoUser)%>: + <%=Services.TextService.Localize("preview")%>
diff --git a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs index 230b4fa139..d175d4352e 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs @@ -17,6 +17,7 @@ using Umbraco.Core; using umbraco.uicontrols; using Umbraco.Core.Configuration; using Umbraco.Web.UI.Pages; +using Umbraco.Core.Services; namespace Umbraco.Web.UI.Umbraco.Settings.Views { @@ -178,10 +179,10 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views SaveButton.ID = "save"; SaveButton.CssClass = "client-side"; - Panel1.Text = ui.Text("edittemplate"); - pp_name.Text = ui.Text("name", UmbracoContext.UmbracoUser); - pp_alias.Text = ui.Text("alias", UmbracoContext.UmbracoUser); - pp_masterTemplate.Text = ui.Text("mastertemplate", UmbracoContext.UmbracoUser); + Panel1.Text = Services.TextService.Localize("edittemplate"); + pp_name.Text = Services.TextService.Localize("name"); + pp_alias.Text = Services.TextService.Localize("alias"); + pp_masterTemplate.Text = Services.TextService.Localize("mastertemplate"); // Editing buttons MenuIconI umbField = editorSource.Menu.NewIcon(); @@ -189,7 +190,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views umbField.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + - editorSource.ClientID + "&tagName=UMBRACOGETDATA&mvcView=true", ui.Text("template", "insertPageField"), 640, 550); + editorSource.ClientID + "&tagName=UMBRACOGETDATA&mvcView=true", Services.TextService.Localize("template/insertPageField"), 640, 550); umbField.AltText = ui.Text("template", "insertPageField"); @@ -199,7 +200,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views umbDictionary.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + - editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY&mvcView=true", ui.Text("template", "insertDictionaryItem"), + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY&mvcView=true", Services.TextService.Localize("template/insertDictionaryItem"), 640, 550); umbDictionary.AltText = "Insert umbraco dictionary item"; diff --git a/src/umbraco.businesslogic/ui.cs b/src/umbraco.businesslogic/ui.cs index 3136e43559..e9b5a7b6eb 100644 --- a/src/umbraco.businesslogic/ui.cs +++ b/src/umbraco.businesslogic/ui.cs @@ -27,29 +27,8 @@ namespace umbraco public class ui { private static readonly string UmbracoDefaultUiLanguage = Umbraco.Core.Configuration.GlobalSettings.DefaultUILanguage; - private static readonly string UmbracoPath = SystemDirectories.Umbraco; + private static readonly string UmbracoPath = SystemDirectories.Umbraco; - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Get the current culture/language from the currently logged in IUser, the IUser object is available on most Umbraco base classes and on the UmbracoContext")] - public static string Culture(User u) - { - if (ApplicationContext.Current == null) return string.Empty; - - var found = UserExtensions.GetUserCulture(u.Language, ApplicationContext.Current.Services.TextService); - return found == null ? string.Empty : found.Name; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Get the current culture/language from the currently logged in IUser, the IUser object is available on most Umbraco base classes and on the UmbracoContext")] - internal static string Culture(IUser u) - { - if (ApplicationContext.Current == null) return string.Empty; - - var found = u.GetUserCulture(ApplicationContext.Current.Services.TextService); - return found == null ? string.Empty : found.Name; - } - - private static string GetLanguage() { return "en-US"; diff --git a/src/umbraco.cms/businesslogic/workflow/Notification.cs b/src/umbraco.cms/businesslogic/workflow/Notification.cs index 76bf86a130..b2dd33041c 100644 --- a/src/umbraco.cms/businesslogic/workflow/Notification.cs +++ b/src/umbraco.cms/businesslogic/workflow/Notification.cs @@ -11,6 +11,7 @@ using umbraco.cms.businesslogic.web; using Umbraco.Core.Models.Rdbms; using umbraco.DataLayer; using umbraco.interfaces; +using Umbraco.Core.Models; namespace umbraco.cms.businesslogic.workflow { @@ -59,7 +60,9 @@ namespace umbraco.cms.businesslogic.workflow { if (u.Disabled == false && u.GetNotifications(node.Path).IndexOf(action.Letter.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal) > -1) { - LogHelper.Debug(string.Format("Notification about {0} sent to {1} ({2})", ui.Text(action.Alias, u), u.Name, u.Email)); + LogHelper.Debug(string.Format("Notification about {0} sent to {1} ({2})", + ApplicationContext.Current.Services.TextService.Localize("actions/" + action.Alias, u.UserEntity.GetUserCulture(ApplicationContext.Current.Services.TextService)), + u.Name, u.Email)); SendNotification(user, u, (Document)node, action); } }