William Parr
12/20/2023, 10:31 AMKevin Jump
12/20/2023, 12:15 PMWilliam Parr
12/20/2023, 12:30 PMBlockListMapper
in order to fix a bug that was occurring with BlockList items getting mixed up after using Translation Manager (causing e.g. French content to show up on the English website -- so both ways instead of only source → target).William Parr
12/20/2023, 12:30 PMKevin Jump
12/20/2023, 1:01 PMWilliam Parr
12/20/2023, 2:27 PMWilliam Parr
12/20/2023, 2:29 PMBlockListMapper
to force it to create a new GUID for these items during translation. But apparently that is now preventing the actual translation via the Connector (Google Translation API) from being applied, so we need to adjust that code.Kevin Jump
12/20/2023, 4:14 PMWilliam Parr
12/21/2023, 8:26 AMWilliam Parr
12/21/2023, 9:53 AMBlockListValueMapper
extension class I'm attempting to use the code from a GitHub Gist of yours @Kevin Jump . However, I can't seem to discern where ValueMapperFactory
can be loaded/accessed from?
https://gist.github.com/KevinJump/a7754bb20f93b1e9934a8cbfb1bb9203William Parr
12/21/2023, 9:54 AMGetTargetValue()
method: var value = (string)ValueMapperFactory.GetMapperTarget(...)
William Parr
12/21/2023, 10:01 AMValueMapperCollection
(used dotPeek)? Don't seem to be able to access it from my class thoughKevin Jump
12/21/2023, 10:04 AMKevin Jump
12/21/2023, 10:04 AMKevin Jump
12/21/2023, 10:21 AMKevin Jump
12/21/2023, 10:22 AMUpdateLayout
method at the end to fix the guid issue.William Parr
12/21/2023, 11:49 AMWilliam Parr
12/22/2023, 12:51 PMTranslationValue
variable in the GetTargetValue()
method to parse the inner values in the way they are expected to be.
The JSON is different than that of Block List and I've been fiddling around for an hour or so but thought perhaps asking you could be quicker?William Parr
12/22/2023, 12:57 PMsourceValue
this is (e.g.) "menuItemDC", whereas in the TranslationValue
object it is "menuItemDC_1", which doesn't seem very reliable that it will always be appended by "_1".William Parr
12/22/2023, 1:44 PMforeach
loops to match the values in sourceValue
and values
to one another, but I'm struggling to wrap my head around how to structure this exactly.Kevin Jump
12/22/2023, 2:06 PMKevin Jump
12/22/2023, 2:09 PMcs
public class IdChangingNestedContentMapper : NestedContentMapper
{
public IdChangingNestedContentMapper(IContentService contentService, IDataTypeService dataTypeService, IContentTypeService contentTypeService, ILogger<NestedContentMapper> logger, Lazy<ValueMapperCollection> valueMappers)
: base(contentService, dataTypeService, contentTypeService, logger, valueMappers)
{
}
public new object GetTargetValue(string propertyEditorAlias, object sourceValue, TranslationValue value, CultureInfoView sourceCulture, CultureInfoView targetCulture)
{
var result = base.GetTargetValue(propertyEditorAlias, sourceValue, value, sourceCulture, targetCulture);
// do work here ?
return result;
}
}
William Parr
12/22/2023, 2:22 PMWilliam Parr
12/22/2023, 2:24 PMNestedContentMapper
which was for fixing the GUID bug I spoke to you about earlier this week, we have three in total (Block List, Nested Content and a 'catch-all' one for miscellaneous 'regular' data types which weren't being copied across in the job for some reason (e.g., Mediapicker, Tags, DateTime).
So I was trying to adjust our existing Nested Content mapper extension class but was mostly accomplishing giving myself a headache, lol.William Parr
12/22/2023, 2:24 PM