diff --git a/src/Umbraco.Core/Models/Content.cs b/src/Umbraco.Core/Models/Content.cs
index 343310dd4e..2861ad4b26 100644
--- a/src/Umbraco.Core/Models/Content.cs
+++ b/src/Umbraco.Core/Models/Content.cs
@@ -232,7 +232,7 @@ namespace Umbraco.Core.Models
///
[IgnoreDataMember]
- public IReadOnlyDictionary PublishNames => _publishInfos?.ToDictionary(x => x.Key, x => x.Value.Name, StringComparer.OrdinalIgnoreCase) ?? NoNames;
+ public IReadOnlyDictionary PublishCultureNames => _publishInfos?.ToDictionary(x => x.Key, x => x.Value.Name, StringComparer.OrdinalIgnoreCase) ?? NoNames;
///
public string GetPublishName(string culture)
@@ -300,10 +300,10 @@ namespace Umbraco.Core.Models
}
///
- public IEnumerable EditedCultures => Names.Keys.Where(IsCultureEdited);
+ public IEnumerable EditedCultures => CultureNames.Keys.Where(IsCultureEdited);
///
- public IEnumerable AvailableCultures => Names.Keys;
+ public IEnumerable AvailableCultures => CultureNames.Keys;
[IgnoreDataMember]
public int PublishedVersionId { get; internal set; }
@@ -324,7 +324,7 @@ namespace Umbraco.Core.Models
throw new InvalidOperationException($"Cannot publish invariant culture without a name.");
PublishName = Name;
var now = DateTime.Now;
- foreach (var (culture, name) in Names)
+ foreach (var (culture, name) in CultureNames)
{
if (string.IsNullOrWhiteSpace(name))
return false; //fixme this should return an attempt with error results
@@ -479,7 +479,7 @@ namespace Umbraco.Core.Models
// copy names
ClearNames();
- foreach (var (culture, name) in other.Names)
+ foreach (var (culture, name) in other.CultureNames)
SetName(name, culture);
Name = other.Name;
}
diff --git a/src/Umbraco.Core/Models/ContentBase.cs b/src/Umbraco.Core/Models/ContentBase.cs
index 1bebdd39c5..d10b2e770d 100644
--- a/src/Umbraco.Core/Models/ContentBase.cs
+++ b/src/Umbraco.Core/Models/ContentBase.cs
@@ -69,7 +69,7 @@ namespace Umbraco.Core.Models
public readonly PropertyInfo DefaultContentTypeIdSelector = ExpressionHelper.GetPropertyInfo(x => x.ContentTypeId);
public readonly PropertyInfo PropertyCollectionSelector = ExpressionHelper.GetPropertyInfo(x => x.Properties);
public readonly PropertyInfo WriterSelector = ExpressionHelper.GetPropertyInfo(x => x.WriterId);
- public readonly PropertyInfo NamesSelector = ExpressionHelper.GetPropertyInfo>(x => x.Names);
+ public readonly PropertyInfo NamesSelector = ExpressionHelper.GetPropertyInfo>(x => x.CultureNames);
}
protected void PropertiesChanged(object sender, NotifyCollectionChangedEventArgs e)
@@ -141,7 +141,7 @@ namespace Umbraco.Core.Models
///
[DataMember]
- public virtual IReadOnlyDictionary Names => _cultureInfos?.ToDictionary(x => x.Key, x => x.Value.Name, StringComparer.OrdinalIgnoreCase) ?? NoNames;
+ public virtual IReadOnlyDictionary CultureNames => _cultureInfos?.ToDictionary(x => x.Key, x => x.Value.Name, StringComparer.OrdinalIgnoreCase) ?? NoNames;
// sets culture infos
// internal for repositories
diff --git a/src/Umbraco.Core/Models/IContent.cs b/src/Umbraco.Core/Models/IContent.cs
index 51cc3e42ff..7bf52ea56b 100644
--- a/src/Umbraco.Core/Models/IContent.cs
+++ b/src/Umbraco.Core/Models/IContent.cs
@@ -121,7 +121,7 @@ namespace Umbraco.Core.Models
/// Because a dictionary key cannot be null this cannot get the invariant
/// name, which must be get via the property.
///
- IReadOnlyDictionary PublishNames { get; }
+ IReadOnlyDictionary PublishCultureNames { get; }
///
/// Gets the available cultures.
diff --git a/src/Umbraco.Core/Models/IContentBase.cs b/src/Umbraco.Core/Models/IContentBase.cs
index e127b42fe9..527b4455ce 100644
--- a/src/Umbraco.Core/Models/IContentBase.cs
+++ b/src/Umbraco.Core/Models/IContentBase.cs
@@ -53,7 +53,7 @@ namespace Umbraco.Core.Models
/// Because a dictionary key cannot be null this cannot get the invariant
/// name, which must be get or set via the property.
///
- IReadOnlyDictionary Names { get; }
+ IReadOnlyDictionary CultureNames { get; }
///
/// Gets a value indicating whether a given culture is available.
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs
index 1fec78954b..905e2dc910 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs
@@ -343,7 +343,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (content.ContentType.Variations.DoesSupportCulture())
{
// names also impact 'edited'
- foreach (var (culture, name) in content.Names)
+ foreach (var (culture, name) in content.CultureNames)
if (name != content.GetPublishName(culture))
(editedCultures ?? (editedCultures = new HashSet(StringComparer.OrdinalIgnoreCase))).Add(culture);
@@ -498,7 +498,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (content.ContentType.Variations.DoesSupportCulture())
{
// names also impact 'edited'
- foreach (var (culture, name) in content.Names)
+ foreach (var (culture, name) in content.CultureNames)
if (name != content.GetPublishName(culture))
(editedCultures ?? (editedCultures = new HashSet(StringComparer.OrdinalIgnoreCase))).Add(culture);
@@ -1031,7 +1031,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
private IEnumerable GetContentVariationDtos(IContent content, bool publishing)
{
// create dtos for the 'current' (non-published) version, all cultures
- foreach (var (culture, name) in content.Names)
+ foreach (var (culture, name) in content.CultureNames)
yield return new ContentVersionCultureVariationDto
{
VersionId = content.VersionId,
@@ -1046,7 +1046,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (!publishing) yield break;
// create dtos for the 'published' version, for published cultures (those having a name)
- foreach (var (culture, name) in content.PublishNames)
+ foreach (var (culture, name) in content.PublishCultureNames)
yield return new ContentVersionCultureVariationDto
{
VersionId = content.PublishedVersionId,
@@ -1059,7 +1059,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
private IEnumerable GetDocumentVariationDtos(IContent content, bool publishing, HashSet editedCultures)
{
- foreach (var (culture, name) in content.Names)
+ foreach (var (culture, name) in content.CultureNames)
yield return new DocumentCultureVariationDto
{
NodeId = content.Id,
@@ -1097,7 +1097,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (content.ContentType.Variations.DoesSupportCulture())
{
// no variant name = error
- if (content.Names.Count == 0)
+ if (content.CultureNames.Count == 0)
throw new InvalidOperationException("Cannot save content with an empty name.");
// sync the invariant name to the default culture name if it's empty since we can't save with an empty invariant name.
@@ -1105,10 +1105,10 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (string.IsNullOrWhiteSpace(content.Name))
{
var defaultCulture = LanguageRepository.GetDefaultIsoCode();
- if (defaultCulture != null && content.Names.TryGetValue(defaultCulture, out var cultureName))
+ if (defaultCulture != null && content.CultureNames.TryGetValue(defaultCulture, out var cultureName))
content.Name = cultureName;
else
- content.Name = content.Names.First().Value; // only option is to take the first
+ content.Name = content.CultureNames.First().Value; // only option is to take the first
}
}
@@ -1116,7 +1116,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (publishing && string.IsNullOrWhiteSpace(content.PublishName))
{
// no variant name = error
- if (content.PublishNames.Count == 0)
+ if (content.PublishCultureNames.Count == 0)
throw new InvalidOperationException("Cannot publish content with an empty name.");
// else... we cannot deal with it here because PublishName is readonly, so in reality, PublishName
@@ -1132,7 +1132,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
private void EnsureUniqueVariationNames(IContent content)
{
- if (!EnsureUniqueNaming || content.Names.Count == 0) return;
+ if (!EnsureUniqueNaming || content.CultureNames.Count == 0) return;
//Get all culture names at the same level
@@ -1156,7 +1156,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (names.Count == 0) return;
- foreach(var n in content.Names)
+ foreach(var n in content.CultureNames)
{
var langId = LanguageRepository.GetIdByIsoCode(n.Key);
if (!langId.HasValue) continue;
diff --git a/src/Umbraco.Tests/Models/VariationTests.cs b/src/Umbraco.Tests/Models/VariationTests.cs
index 9f124b65fc..044f8fa0cd 100644
--- a/src/Umbraco.Tests/Models/VariationTests.cs
+++ b/src/Umbraco.Tests/Models/VariationTests.cs
@@ -184,11 +184,11 @@ namespace Umbraco.Tests.Models
Assert.AreEqual("name-uk", content.GetName(langUk));
// variant dictionary of names work
- Assert.AreEqual(2, content.Names.Count);
- Assert.IsTrue(content.Names.ContainsKey(langFr));
- Assert.AreEqual("name-fr", content.Names[langFr]);
- Assert.IsTrue(content.Names.ContainsKey(langUk));
- Assert.AreEqual("name-uk", content.Names[langUk]);
+ Assert.AreEqual(2, content.CultureNames.Count);
+ Assert.IsTrue(content.CultureNames.ContainsKey(langFr));
+ Assert.AreEqual("name-fr", content.CultureNames[langFr]);
+ Assert.IsTrue(content.CultureNames.ContainsKey(langUk));
+ Assert.AreEqual("name-uk", content.CultureNames[langUk]);
}
[Test]
diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs
index 6285e3cd25..884c4f94d9 100644
--- a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs
+++ b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs
@@ -752,7 +752,7 @@ namespace Umbraco.Tests.Persistence.Repositories
foreach (var r in result)
{
var isInvariant = r.ContentType.Alias == "umbInvariantTextpage";
- var name = isInvariant ? r.Name : r.Names["en-US"];
+ var name = isInvariant ? r.Name : r.CultureNames["en-US"];
var namePrefix = isInvariant ? "INV" : "VAR";
//ensure the correct name (invariant vs variant) is in the result
diff --git a/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs
index 621fa0b95f..d0ab4099a9 100644
--- a/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs
+++ b/src/Umbraco.Web/Models/Mapping/MemberMapperProfile.cs
@@ -45,7 +45,7 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(dest => dest.CreatorId, opt => opt.Ignore())
.ForMember(dest => dest.Level, opt => opt.Ignore())
.ForMember(dest => dest.Name, opt => opt.Ignore())
- .ForMember(dest => dest.Names, opt => opt.Ignore())
+ .ForMember(dest => dest.CultureNames, opt => opt.Ignore())
.ForMember(dest => dest.ParentId, opt => opt.Ignore())
.ForMember(dest => dest.Path, opt => opt.Ignore())
.ForMember(dest => dest.SortOrder, opt => opt.Ignore())
diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
index 062a696ffc..0af0f3e6cc 100644
--- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
+++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
@@ -1188,9 +1188,9 @@ namespace Umbraco.Web.PublishedCache.NuCache
var names = content is IContent document
? (published
- ? document.PublishNames
- : document.Names)
- : content.Names;
+ ? document.PublishCultureNames
+ : document.CultureNames)
+ : content.CultureNames;
foreach (var (culture, name) in names)
{
diff --git a/src/Umbraco.Web/umbraco.presentation/page.cs b/src/Umbraco.Web/umbraco.presentation/page.cs
index 2a2f125ece..4730d1b501 100644
--- a/src/Umbraco.Web/umbraco.presentation/page.cs
+++ b/src/Umbraco.Web/umbraco.presentation/page.cs
@@ -484,7 +484,7 @@ namespace umbraco
if (_cultureInfos != null)
return _cultureInfos;
- return _cultureInfos = _inner.PublishNames
+ return _cultureInfos = _inner.PublishCultureNames
.ToDictionary(x => x.Key, x => new PublishedCultureInfo(x.Key, x.Value, _inner.GetCulturePublishDate(x.Key)));
}
}