Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jesse Andrews 191 posts 716 karma points c-trib
    Oct 31, 2019 @ 22:58
    Jesse Andrews
    1

    Would it be possible to share the ValueMapper for Leblender?

    I have a customized version of Leblender that runs in umbraco 8. Unfortunately, translation manager no longer includes it in it's core, since leblender isn't officially umbraco 8 compatible. Would it be possible to get the source code for the leblender value mapper used in version 2.4.3 of translation manager?

  • Kevin Jump 2311 posts 14697 karma points MVP 7x c-trib
    Nov 01, 2019 @ 14:43
    Kevin Jump
    100

    Hi Jesse,

    sure.

    it's here https://gist.github.com/KevinJump/91928a31f48a12bdb60d75d4d820a775

    there are some slight (but not significant differences between v2 and v8 mappers) so it won't slot straight in, but this should be enough for you to port it.

    if leBlender gets an official (or even semi-official) release for v8 we will add a mapper to Translation Manager.

  • Jesse Andrews 191 posts 716 karma points c-trib
    Nov 01, 2019 @ 15:48
    Jesse Andrews
    0

    Thanks for sending it over so quickly.

  • Jesse Andrews 191 posts 716 karma points c-trib
    Nov 05, 2019 @ 00:27
    Jesse Andrews
    0

    Translation Manager Version: 8.2.0

    I'm having issues getting the mapper to trigger properly. I've looked at the thread here, but I can't seem to get the grid mappers to trigger. I did a basic test with the following code, but it failed to output the test source value when I submitted the job.

    public class TestMapper : BaseValueMapper, IValueMapper {
        public string Name => "Test Mapper";
    
        public override string[] Editors => new string[] { "Umbraco.Grid.imageInfoBox" };
    
        public TestMapper(IContentService contentService, IDataTypeService dataTypeService, IContentTypeService contentTypeService, ILogger logger) : base(contentService, dataTypeService, contentTypeService, logger) {
        }
        public TranslationValue GetSourceValue(string displayName, string propertyTypeAlias, object value, CultureInfoView culture) {
            return new TranslationValue(displayName, propertyTypeAlias) {
                Value = "test"
            };
        }
    
        public object GetTargetValue(string propertyTypeAlias, object sourceValue, TranslationValue values, CultureInfoView sourceCulture, CultureInfoView targetCulture) {
            return null;
        }
    }
    

    Any ideas? Also, are there any issues with having dynamic values for the Editors property? I have some logic to dynamically determine which grid editors are for leblender.

    public override string[] Editors {
        get {
            return  _gridConfig.EditorsConfig.Editors.Where(x => x.View == "/App_Plugins/LeBlender/editors/leblendereditor/LeBlendereditor.html").Select(x => "Umbraco.Grid." + x.Alias).ToArray();
        }
    }
    

    "_gridConfig" is an IGridConfig object that I am injecting in the constructor that contains all of the grid configuration data.

  • Jesse Andrews 191 posts 716 karma points c-trib
    Jun 01, 2020 @ 23:57
    Jesse Andrews
    1

    Figured out the problem. I didn't have the right editor alias. It was expecting "Umbraco.Grid.leblenderEditor." In case you or anyone else is curious, the umbraco 8 version can be seen here.

  • Kevin Jump 2311 posts 14697 karma points MVP 7x c-trib
    Jun 02, 2020 @ 10:20
    Kevin Jump
    0

    Hi Jesse,

    This is great, We have had a few people ask us about leBlender, but its still not looking like a release - are you using this repo as your base ?

    https://github.com/mirkomaty/LeBlender/tree/umbraco-v8

    or do you have another source, I think we are very likely to be adding this so a Translation Manager release / or community package soon.

    Kevin

  • Jesse Andrews 191 posts 716 karma points c-trib
    Jun 02, 2020 @ 15:48
    Jesse Andrews
    0

    I don't have a repository set up for my version, but it started from that repository about a year ago or so. The value mapper should work for both though, as I haven't modified the model or package manifest. I did have to make a number of tweaks to get it to work for variants though. Not sure whether that's been addressed in the updates since then on that repository.

    I'm willing to share source code, but it will likely be a while before I can, as the code is on an office computer that was put into storage after my company's lease expired during the covid lockdown and I hadn't uploaded that source code anywhere. I can share the dll and relevant plugin bits though, as I do have those. Not ideal, but better than nothing if that repository has issues out of the box.

  • Kevin Jump 2311 posts 14697 karma points MVP 7x c-trib
    Jun 02, 2020 @ 16:51
    Kevin Jump
    0

    HI,

    Yeah any code/dlls will help, I am going to have to dive into that repo too and see what has changed.

    feel free to email me any stuff [email protected] if you want.

    Kevin

  • Jesse Andrews 191 posts 716 karma points c-trib
    Jun 02, 2020 @ 17:25
    Jesse Andrews
    0

    I've shared the leblender assets with you via google drive. Let me know if you have any questions.

Please Sign in or register to post replies

Write your reply to:

Draft