From fc39568415f43a1f2cc484fcbf8dd4bc697e207f Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 30 Oct 2018 14:49:25 +1100 Subject: [PATCH] Updated audit info to include full lang name --- .../Services/Implement/ContentService.cs | 20 ++++++++++++++----- src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 6 +++--- .../Umbraco/config/lang/en_us.xml | 6 +++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Core/Services/Implement/ContentService.cs b/src/Umbraco.Core/Services/Implement/ContentService.cs index f14747cda3..3953e7a640 100644 --- a/src/Umbraco.Core/Services/Implement/ContentService.cs +++ b/src/Umbraco.Core/Services/Implement/ContentService.cs @@ -849,7 +849,7 @@ namespace Umbraco.Core.Services.Implement //track the cultures that have changed var culturesChanging = content.ContentType.VariesByCulture() - ? string.Join(",", content.CultureInfos.Where(x => x.Value.IsDirty()).Select(x => x.Key)) + ? content.CultureInfos.Where(x => x.Value.IsDirty()).Select(x => x.Key).ToList() : null; //TODO: Currently there's no way to change track which variant properties have changed, we only have change // tracking enabled on all values on the Property which doesn't allow us to know which variants have changed. @@ -867,7 +867,12 @@ namespace Umbraco.Core.Services.Implement scope.Events.Dispatch(TreeChanged, this, new TreeChange(content, changeType).ToEventArgs()); if (culturesChanging != null) - Audit(AuditType.SaveVariant, userId, content.Id, $"Saved cultures: {culturesChanging}", culturesChanging); + { + var langs = string.Join(", ", _languageRepository.GetMany() + .Where(x => culturesChanging.InvariantContains(x.IsoCode)) + .Select(x => x.CultureName)); + Audit(AuditType.SaveVariant, userId, content.Id, $"Saved languagues: {langs}", langs); + } else Audit(AuditType.Save, userId, content.Id); @@ -1057,7 +1062,7 @@ namespace Umbraco.Core.Services.Implement var publishing = content.PublishedState == PublishedState.Publishing; var unpublishing = content.PublishedState == PublishedState.Unpublishing; - string culturesChanging = null; + IEnumerable culturesChanging = null; using (var scope = ScopeProvider.CreateScope()) { @@ -1082,7 +1087,7 @@ namespace Umbraco.Core.Services.Implement } else { - culturesChanging = string.Join(",", content.PublishCultureInfos.Where(x => x.Value.IsDirty()).Select(x => x.Key)); + culturesChanging = content.PublishCultureInfos.Where(x => x.Value.IsDirty()).Select(x => x.Key).ToList(); } } @@ -1193,7 +1198,12 @@ namespace Umbraco.Core.Services.Implement } if (culturesChanging != null) - Audit(AuditType.PublishVariant, userId, content.Id, $"Published cultures: {culturesChanging}", culturesChanging); + { + var langs = string.Join(", ", _languageRepository.GetMany() + .Where(x => culturesChanging.InvariantContains(x.IsoCode)) + .Select(x => x.CultureName)); + Audit(AuditType.PublishVariant, userId, content.Id, $"Published languagues: {langs}", langs); + } else Audit(AuditType.Publish, userId, content.Id); diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index 8bc9d190fa..6ee8fc2428 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -143,14 +143,14 @@ Content deleted Content unpublished Content saved and Published - Content cultures %0% saved and published + Content languages: %0% saved and published Content saved - Content cultures %0% saved + Content languages: %0% saved Content moved Content copied Content rolled back Content sent for publishing - Content cultures %0% sent for publishing + Content languages: %0% sent for publishing Sort child items performed by user Copy Publish diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index a2487b2dc8..a710abde5a 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -148,14 +148,14 @@ Content deleted Content unpublished Content saved and Published - Content cultures %0% saved and published + Content languages: %0% saved and published Content saved - Content cultures %0% saved + Content languages: %0% saved Content moved Content copied Content rolled back Content sent for publishing - Content cultures %0% sent for publishing + Content languages: %0% sent for publishing Sort child items performed by user Copy Publish