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
    Feb 25, 2019 @ 23:27
    Jesse Andrews
    1

    GridValueMapper fails to preserve grid settings

    I am working on a site that makes heavy use of grid settings, and discovered that those settings are lost when the translations are pulled in. I suspect the solution is to use the GridValueConverter, as I encountered a similar issue in some of the functionality I've built. It can be used in the following way.

    using Umbraco.Core.PropertyEditors.ValueConverters;
    var gridConverter = new GridValueConverter();
    var data = gridConverter.ConvertDataToSource(null, value, false);
    

    This is an urgent issue, as it makes Translation Manager unusable in the site.

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Feb 26, 2019 @ 09:00
    Kevin Jump
    0

    Hi Jesse,

    Sorry, this is an issue - I can go through how it (should) work and if you can give us a bit more detail on your issue we can see if we can get to the bottom of it.

    Extracting Content

    When you Send something to translation, TM will extract the text elements and put them into the "TranslationValues" that is used to store the information and create the XLIFF files etc.

    This doesn't contain any of the settings / or non-text based settings in a grid, as they do not form part of the translation - but as you will see below we get that information on import

    Importing a translations

    When a translation job has been received and the user approves (approve & save or approve & publish) the job. then the translated information is put back into the content node

    We do this by getting the version* of the source content that was sent to and merging the information with that of the translation.

    So the grid settings / etc will come from the original source node, while the translated text comes from the translation jobs.

    This means you won't see any of the settings in the translation job or in the xliff files, you may produce but the settings information will be merged into the target site at approval time

    *if the version that was sent to translation is unavailable (because you are not storing old versions or it was removed) we use the latest version of the source content

    Hope this makes sense ?

    if you can provide details of the settings you don't think are making it over to the other end of a translation process that would be great.

  • Jesse Andrews 191 posts 716 karma points c-trib
    Feb 26, 2019 @ 18:21
    Jesse Andrews
    0

    The issue is that all of the settings are lost on import. I ran a simple test with just a textstring setting set and the change was lost. This should be fairly easy to test on your end, since the grid comes with a class setting by default in the grid control. The settings for the control I tested are as follows.

    {
      "label": "Hash Link",
      "description": "Controls the anchor of the row",
      "key": "id",
      "view": "textstring",
      "applyTo": "row"
    }
    

    and here is the before and after from the trace log.

    2019-02-26 09:59:37,190 [P19400/D2/T9] DEBUG Jumoo.TranslationManager.LinkUpdater.LinkUpdater - Setting : [bodyText] (Source:{
      "name": "1 column layout",
      "sections": [
        {
          "grid": 12,
          "rows": [
            {
              "label": "1 Column",
              "name": "1 Column",
              "areas": [
                {
                  "grid": 12,
                  "hasConfig": false,
                  "controls": [
                    {
                      "value": [
                        {
                          "titleLeadIn": {
                            "value": "Test",
                            "dataTypeGuid": "0cc0eba1-9960-42c9-bf9b-60e150b429ae",
                            "editorAlias": "titleLeadIn",
                            "editorName": "Title Lead In"
                          },
                          "editions": {
                            "value": [
                              {
                                "key": "5a78f897-959f-4b24-82ef-5f729f482d19",
                                "name": "Item 1",
                                "ncContentTypeAlias": "edition",
                                "targetPage": [
                                  {
                                    "id": 2743,
                                    "label": "About",
                                    "type": "internal"
                                  }
                                ],
                                "color": "068fbe",
                                "secondaryColor": "212b36",
                                "summaryLeadIn": "Test",
                                "summary": "Test",
                                "cta": ""
                              }
                            ],
                            "dataTypeGuid": "0d7fdebe-850f-4f8c-9d44-77e8c6fb36d3",
                            "editorAlias": "editions",
                            "editorName": "Editions"
                          },
                          "defaultCta": {
                            "value": "Test",
                            "dataTypeGuid": "0cc0eba1-9960-42c9-bf9b-60e150b429ae",
                            "editorAlias": "defaultCta",
                            "editorName": "Default CTA"
                          }
                        }
                      ],
                      "editor": {
                        "alias": "editions"
                      },
                      "active": false,
                      "guid": "e75a3228-63d9-53c4-dbee-94a651b9def2"
                    }
                  ]
                }
              ],
              "styles": {},
              "config": {
                "id": "test"
              },
              "hasConfig": true,
              "id": "e780e4eb-f96f-7628-e797-589b89db9a9c",
              "active": true
            }
          ]
        }
      ]
    }) [{
      "name": "1 column layout",
      "sections": [
        {
          "grid": "12",
          "rows": [
            {
              "label": "1 Column",
              "name": "1 Column",
              "hasConfig": true,
              "id": "e780e4eb-f96f-7628-e797-589b89db9a9c",
              "areas": [
                {
                  "grid": "12",
                  "hasConfig": false,
                  "controls": [
                    {
                      "value": [
                        {
                          "titleLeadIn": {
                            "dataTypeGuid": "0cc0eba1-9960-42c9-bf9b-60e150b429ae",
                            "editorName": "Title Lead In",
                            "editorAlias": "titleLeadIn",
                            "value": "Spanish Test"
                          },
                          "editions": {
                            "dataTypeGuid": "0d7fdebe-850f-4f8c-9d44-77e8c6fb36d3",
                            "editorName": "Editions",
                            "editorAlias": "editions",
                            "value": [
                              {
                                "key": "5a78f897-959f-4b24-82ef-5f729f482d19",
                                "name": "Item 1",
                                "ncContentTypeAlias": "edition",
                                "targetPage": "[\r\n  {\r\n    \"id\": 2743,\r\n    \"url\": null,\r\n    \"label\": \"Spanish About\",\r\n    \"type\": \"internal\"\r\n  }\r\n]",
                                "color": "068fbe",
                                "secondaryColor": "212b36",
                                "summaryLeadIn": "Spanish Test",
                                "summary": "Spanish Test",
                                "cta": ""
                              }
                            ]
                          },
                          "defaultCta": {
                            "dataTypeGuid": "0cc0eba1-9960-42c9-bf9b-60e150b429ae",
                            "editorName": "Default CTA",
                            "editorAlias": "defaultCta",
                            "value": "Spanish Test"
                          }
                        }
                      ],
                      "editor": {
                        "alias": "editions"
                      },
                      "active": false
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    } > {
      "name": "1 column layout",
      "sections": [
        {
          "grid": "12",
          "rows": [
            {
              "label": "1 Column",
              "name": "1 Column",
              "hasConfig": true,
              "id": "e780e4eb-f96f-7628-e797-589b89db9a9c",
              "areas": [
                {
                  "grid": "12",
                  "hasConfig": false,
                  "controls": [
                    {
                      "value": [
                        {
                          "titleLeadIn": {
                            "dataTypeGuid": "0cc0eba1-9960-42c9-bf9b-60e150b429ae",
                            "editorName": "Title Lead In",
                            "editorAlias": "titleLeadIn",
                            "value": "Spanish Test"
                          },
                          "editions": {
                            "dataTypeGuid": "0d7fdebe-850f-4f8c-9d44-77e8c6fb36d3",
                            "editorName": "Editions",
                            "editorAlias": "editions",
                            "value": [
                              {
                                "key": "5a78f897-959f-4b24-82ef-5f729f482d19",
                                "name": "Item 1",
                                "ncContentTypeAlias": "edition",
                                "targetPage": "[\r\n  {\r\n    \"id\": 2743,\r\n    \"url\": null,\r\n    \"label\": \"Spanish About\",\r\n    \"type\": \"internal\"\r\n  }\r\n]",
                                "color": "068fbe",
                                "secondaryColor": "212b36",
                                "summaryLeadIn": "Spanish Test",
                                "summary": "Spanish Test",
                                "cta": ""
                              }
                            ]
                          },
                          "defaultCta": {
                            "dataTypeGuid": "0cc0eba1-9960-42c9-bf9b-60e150b429ae",
                            "editorName": "Default CTA",
                            "editorAlias": "defaultCta",
                            "value": "Spanish Test"
                          }
                        }
                      ],
                      "editor": {
                        "alias": "editions"
                      },
                      "active": false
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }]
    

    In the original value, there is data for the config setting with a value of {"id": "test"}, but after the translation that is no longer there. Also note that "hasConfig" for the row is false in the translated version.

  • Kunal 19 posts 116 karma points
    Feb 26, 2019 @ 23:19
    Kunal
    0

    FYI, we just started using the translation manager and have the exact same issue.

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Feb 26, 2019 @ 23:25
    Kevin Jump
    0

    Hi Jesse, and Kunal,

    Yeah I can see what's missing now, and now we have a fix for this - we will just run some sanity checks and get an updated release out tomorrow to fix this issue.

    Jesse are you still running a v1.x version of translation manager ? We can push out a v1.4.2 release out with this fix in if it will help you. (although 2.x is still recommended).

  • Jesse Andrews 191 posts 716 karma points c-trib
    Feb 26, 2019 @ 23:27
    Jesse Andrews
    0

    I'm running on 2.2.2 at the moment, so upgrading to the latest won't be an issue. I was on 2.1.5, so I must have accidentally entered the wrong version on one of my reports.

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Feb 26, 2019 @ 23:28
    Kevin Jump
    0

    OK, cool - that makes it slightly easier for us :)

    Should be quite painless - but we just need to check we haven't broken a grid edge case somewhere by including the extra properties.

    Kevin

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Feb 27, 2019 @ 09:15
    Kevin Jump
    101

    Hi,

    We've tested it now and released an update to fix this.

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

    if you are upgrading from 2.2.2 you only need to install the binaries NuGet package

    Install-Package Jumoo.TranslationManager.Core.Binaries
    

    as nothing else has changed between versions.

  • Kunal 19 posts 116 karma points
    Feb 27, 2019 @ 16:23
    Kunal
    0

    Thank you for the quick response to this Kevin!

  • Jesse Andrews 191 posts 716 karma points c-trib
    Feb 27, 2019 @ 18:38
    Jesse Andrews
    0

    Thanks for the quick turn around on this Kevin. I installed the update and confirmed the grid settings are now preserved.

Please Sign in or register to post replies

Write your reply to:

Draft