Copied to clipboard

Flag this post as spam?

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


  • Tor Langlo 189 posts 532 karma points
    Apr 29, 2019 @ 21:46
    Tor Langlo
    0

    Translating Grid Layouts using Doc Type Grid Editors (DTGE)

    I'm just getting my feet wet with TM, but see that translating pages containing more complex grid layouts looks a bit tedious as it is right now.

    • Rows, and cells are not correctly sorted - I would expect fields to be sorted within controls within cells within rows

    • Translation field labels are not accurate enough to identify which part of the grid layout is being edited - as can be seen in the screenshot below, the first field label is "Content Meet Us Doc Type Title Vertical Offset" where "Content" is the tab name, "Meet Us Doc Type" is the grid editor name, and "Title Vertical Offset" is the property name. If the fields can't be grouped somehow, then we need more/better description of each field, maybe something like "Row 1 ('2 columns'), cell 2, meetUsDocType/dtgeMeetUsSection, 'Title Vertical Offset'".

    • How do we hide certain properties of DTGE doc types? The "Title Vertical Offset" is actually not a translatable field (it's a css value). I tried adding -titleVerticalOffset in the Properties list of the translation set config, but it didn't seem to work. Maybe it's not getting through to the DTGE doc type?

    I don't mean to be negative here, just trying to understand where/if TM can be used :-) enter image description here

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 30, 2019 @ 08:22
    Kevin Jump
    0

    Hi Tor,

    Yeah, the sort order is something we've been looking at, we don't have a universal solution, because for example in a grid a nested property can have its own way of storing things, and it's actually the displaying of all the nested sorted elements that are a bit of a pain.

    Naming it's difficult because we are translating what can be a quite complicated structure into something linear that may well then be imported into another system (via an export). I am more inclined to say it's a developer choice as to how items within the grid are named, and we then do our best to represent that.

    Ignoring deeply nested properties: again its something that has been asked for and we are looking at - the main thing holding us back is how this will be a major version change as it will change how certain properties are passed around as these elements are loosely coupled - so the value mappers (the things that do the extraction) don't actually know about the set settings and just extract values, so at the top level we can say don't extract this, but once we are nested (at the moment) nothing gets sent around - it will be a change to how we pass stuff around which will change value mappers which will have an impact on people who have custom ones.

    Property workaround: The workaround is to use a datatype that doesn't have a value mapper for these values you don't want to map.

    What this means in practice is having your own datatype that behaves like Umbraco.Textbox but are called something else (like My.TextString)

    Properties using this datatype wouldn't have a value mapper they would be ignored at every level by Translation Manager - this is probably something we should just create and ship with translation manager, to be honest - would make this a bit easier.

    and don't worry all feedback is welcome - there are so many different ways people have this setup we couldn't possibly work it all out, so anything you notice/want to change is always a help.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 30, 2019 @ 09:25
    Kevin Jump
    0

    Hi

    Just to follow up, we are looking at the naming/sorting stuff

    looks like there are some quick wins, we can do which make nested / DTGE stuff look nicer. and well be in the right order.

    Kevin

  • Tor Langlo 189 posts 532 karma points
    Apr 30, 2019 @ 15:47
    Tor Langlo
    0

    Thanks for the update!

    I see how using a different datatype would solve the property hiding. I think it's feasible for us to take care of that (and if you're coming out with a built-in datatype ready for use, then we'll use it).

    On the Grid Layout Value Mapper, would it be possible to add some extensibility to it, e.g. event handlers for generating fields names and another event handler for comparing them for sort rank?

    Do you have any plans for new releases in the short term? What we do will probably be dependent on that.

    -Tor

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 30, 2019 @ 18:05
    Kevin Jump
    0

    Hi

    a quick "catch the easy stuff" release should be out tomorrow - which will fix sort orders of properties and the tab groups.

    it probably won't have the ignore text datatype in it ( but might see what we can do on that one ).

    There are events firing at a slightly higher level then field generation:

    There is a TranslationNodeService.Created which is fired once a node has been created an example of how you might use that to do stuff to properties

    {
      // in ApplicationStarted or similar register the event 
      TranslationNodeService.Created += TranslationNodeService_Created;
    }
    
    private void TranslationNodeService_Created(TranslationNodeEventArgs e)
    {
      // e.Node.Groups contains the tab groups with the properties 
      // in it. here you could go in manipulate names, strip out properties ect.
    }
    

    for indivudial nodes all the events are :

    TranslationNodeService.Created += TranslationNodeService_Created;
    TranslationNodeService.Approved += TranslationNodeService_Approved;
    
    TranslationNodeService.Creating += TranslationNodeService_Creating;
    TranslationNodeService.Approving += TranslationNodeService_Approving;
    

    the Creating / Approving are cancellable (so you can stop the process if you need to).

    There are also a load of events the TranslationJobService fires, but they are more about jobs then properties, but if you need them they are there.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Apr 30, 2019 @ 18:11
    Kevin Jump
    0

    Just to add - code sample for using the Created event to manipulate property values in a translation node :

    https://gist.github.com/KevinJump/9551e9adbaebba1910771f7b40936649

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    May 01, 2019 @ 10:34
    Kevin Jump
    100

    Hi,

    Version 2.2.5 should hopefully fix the sorting issues; and property names should be a little bit better (for newly generated things, the display names are created with the translation items).

    https://jumoo.co.uk/translate/releases/2.2.5/

    In terms of not translating properties inside nested/grids/etc - we've knocked up a Non-Translatable version of textbox and textarea

    https://www.nuget.org/packages/Jumoo.TranslationManager.NoneTranslatableText/

    This gives you two non-translatable versions of the textbox or textarea, and you should be able to swap them with the built-in ones.

    the code for this is also here: https://github.com/Jumoo/TranslationProperyEditors

    Kevin

  • Tor Langlo 189 posts 532 karma points
    May 01, 2019 @ 17:59
    Tor Langlo
    0

    Fantastic turn-around, Kevin!

    So far everything looks better. I'll will be getting into the complex grid layouts later today.

    One thing, I wasn't able to test the Non-Translatable data types. The Nuget dll's were compiled .NET 4.6.x while my Cloud website is at 4.5. I also downloaded and looked at the code, but it choked on compiling (it seemed to have dependencies on Umbraco which I didn't have time to study and figure out how to resolve). I'm pretty busy right now so will have to get back to this...

    -Tor

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    May 01, 2019 @ 19:26
    Kevin Jump
    0

    Hi

    what version of Umbraco are you using?

    I did notice this when testing both the textbox and textarea have recently had the maxchars properties added to them, (around v7.8 or v7.9 i think?)

    yes the .net thing should be something we can change down, isn't any reason it's 4.6.2

  • Tor Langlo 189 posts 532 karma points
    May 01, 2019 @ 20:38
    Tor Langlo
    0

    I'm on 7.14, Umbraco Cloud website version. VS 2017.

Please Sign in or register to post replies

Write your reply to:

Draft