umbraco / Umbraco.Deploy.Issues

1 stars 0 forks source link

Smarter handling of content transfer of dictionary items #191

Closed jemayn closed 8 months ago

jemayn commented 8 months ago

The problem:

A pretty common workflow in my company is for the developers to create dictionary items as they need them, and then just fill in the language that they are currently testing their work against. Then later on when the dictionary items are transfered to live the client can fill in all the languages themselves.

I can imagine this is a common workflow for most devs.

Scenario:

Now if the site has 2 languages and 2 dictionary items, but only the first language is filled out:

Danish English
Klik her
Link

It gets pushed to live and the editors fill out the english translations:

Danish English
Klik her Click here
Link Link

In the meantime the developers add a third translation without pullin the live changes:

Danish English
Klik her
Link
Pris

If they content transfer this to live, then live will lose their english translations of the first two.

If instead dictionary items were transfered as uda files, then the merge process would either replace the empty values with the filled out ones, or throw a merge conflict so the developer would know something had to be fixed.

Possible solutions:

A simple thing that would solve many of the problems we have would be to not overwrite values with empty strings. If it has an empty string in one end and a non-empty string in the other then it should prefer the non-empty one.

A more complex solution could be a diff viewer where you could select the version you'd want from each environment when comparing the two.


This item has been added to our backlog AB#36123

AndyButland commented 8 months ago

We'll add a configuration option to support this from the next releases. It'll look like this:

  "Umbraco": {
    "Deploy": {
      "Settings": {
        "TransferDictionaryAsContent": true,
        "SetEmptyDictionaryItemsOnTransfer": true|false,
      }
    }

By default the value will be true to preserve existing behaviour. But if set to false, and you are transferring dictionary items via the backoffice, an empty translation value will no longer overwrite a non-empty one.

jemayn commented 8 months ago

Thanks Andy! 😊