From 19255faafc22698d4c89a3bb41673832bc0d3c04 Mon Sep 17 00:00:00 2001 From: Martin Zanoni Date: Wed, 31 Jul 2024 19:42:23 +0200 Subject: [PATCH] feat: handle varies by language for non string values --- .../Services/RelewisePropertyConverter.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Integrations.Umbraco/Services/RelewisePropertyConverter.cs b/src/Integrations.Umbraco/Services/RelewisePropertyConverter.cs index 064e020..4e58cdd 100644 --- a/src/Integrations.Umbraco/Services/RelewisePropertyConverter.cs +++ b/src/Integrations.Umbraco/Services/RelewisePropertyConverter.cs @@ -47,7 +47,17 @@ internal class RelewisePropertyConverter(IEnumerable new Multilingual.Value(x.Lang, x.Value)).ToArray())); + if (values.First().Value?.Type == DataValue.DataValueTypes.String) + { + dataKeys.Add(values.Key, new Multilingual(values.Select(x => new Multilingual.Value(x.Lang, x.Value)).ToArray())); + } + else + { + foreach ((string Lang, string Key, DataValue? Value) dataValue in values) + { + dataKeys.Add($"{dataValue.Key}_{dataValue.Lang}", dataValue.Value); + } + } } } else