Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Language version is one of the most important concepts in the Sitecore CMS in general and plays a crucial role within the framework of the XTM Connect – Sitecore (referred to below as “the XTM connector”) integration. Language version is just A “language version” is simply a version of a translation of a particular content item for a particular language, that is stored in Sitecore.

Upon When the Sitecore content submission is sent to XTM Cloud for translation, the XTM connector creates a language-specific version , to pour which it fills with the actual translation into it later with , when the content importis imported from XTM Cloud.

...

How do language versions work in the context of the XTM connector?

...

Content submitted to XTM Cloud

The most important thing that needs to be noted note is that the XTM connector creates a language version for a particular content item only when the said that item is sent off to XTM Cloud for translation and NOT when it the item is merely added to the translation queue. Naturally, the language versions are created for the target languages used for content submission.

...

At this point, the language version of this item, that which is created for a particular target language, gets the is assigned XTM Message: In translation status.

...

The said This status is caused by the XTM_Translation in progress checkbox that , which is selected automatically , in the XTM Connector section for this content item.

...

Lastly, as long as the submitted content item remains in XTM Cloud, i.e. its translation into a particular target language has not been imported back to the Sitecore CMS yet, the corresponding language version contains the text in the source language. This is because the language version cannot exist without any content whatsoever, so the original text constitutes some acts as a sort of a placeholder for the awaited translation which is to be returned.

...

Content imported from XTM Cloud

Once the item’s translation into a particular target language has been imported back to the Sitecore CMS from XTM Cloud, the respective relevant language version of this item gets the is assigned XTM Message: Translated status.

...

The said This status is caused by the XTM_Translated checkbox that Translation in progress checkbox, which is selected automatically , in the XTM Connector section for this content item.

...

Lastly, the corresponding language version is filled in with the actual translation.

...

Submitting an item to XTM Cloud for the same target language twice

Default mechanism

By default, the XTM connector is set to introduce apply a certain restriction relating to language versions that are created within the framework of the Sitecore content being submitted to XTM Cloud for translation.

If a particular content item is sent off to XTM Cloud for translation into a specific target language, the very same that item cannot be sent for translation into the same target language a second time until the first language version of this item is has been imported back to the Sitecore CMS from XTM Cloud.

In other words, a new content item’s language version for a particular target language cannot be created as long as the previous language version has the status In translation status.

For example, if you try to send the item for the same target language again [in this case, German (Germany)], you will observe see the following information about this item in the log trace, relating to this item:

Code Block
[2024.03.29 13:09:34] The item 'Sajzik MainItem {C81F9F60-00C8-4257-9772-62E91195A50A}' was NOT added - it is already in translation to 'de-DE'

This restriction was designed on purpose, deliberately to prevent sending a particular content item from being sent for translation into the same target language multiple times, which might be disorientating . This might cause confusing and lead to the existence of multiple inconsistent translations of the same item at the same time, in the Sitecore CMS.

Do not show the option to send the same items for translation multiple times

The In the XTM connector offers possibility to , you can change the mechanism described above. To do so, with select the checkbox labeled Do not show the option to send the same items for translation multiple times, checkbox in the Sitecore Settings tab of , in the XTM connector’s settings.

...

Use this checkbox to specify how XTM Connect – Sitecore Users Linguists (translation requesters) can add language versions to projects: they can either add one version after another or add several versions at once. Select the checkbox, or not, as required:

  • Checkbox selected: when an item is sent to XTM Cloud, for translation into several target languages, it will not be possible to also send the same item for translation in a new project. A User Linguist will only be able to send the same item to XTM Cloud again once it has been finished and imported to Sitecore.

  • Checkbox not selected: when an item is sent to XTM Cloud, it can be included in many projects and translated into many languages at the same time.

...

In certain situations, when XTM Cloud projects are removed in an improper mannerincorrectly, from the Sitecore CMS UI (see the following article to learn more about the topic: Sitecore: Process of for removing/cancelling XTM Cloud projects from the CMS), relevant language versions might not be updated in accordance with the actions performed by the Sitecore user.

For example, imagine a project that consists of hundreds of Sitecore content items, each one having of which has its own multiple language versions, depending on the number of target languages that this item has been translated into. If you remove the project in a improper wayincorrectly, as described in the article mentioned articleabove, the project’s language versions will not be removed. Manual removal of those language versions would be a very tedious and time-consuming task.

This is where a couple of PowerShell scripts come into play, to save the day can be used to solve the problem. Make sure you have the Sitecore PowerShell Extension installed in your Sitecore CMS.

...

For each script presented below, you just need to modify two variables:

  • -path a the path to the main Sitecore main item (the script will also take into account all of the main item’s sub-items);.

  • -Language → a Sitecore language code, e.g. pl-PL.

...

Code Block
languagepowershell
Foreach ($item in Get-ChildItem -path "/PATH/TO/MAIN/ITEM" -Language "LANGUAGE-CODE" -Recurse | Where-Object { $_.Fields['XTM_Translation in progress'] -ne $null })
{
	$item.Editing.BeginEdit();
	$item.Fields['__Workflow state'].Value = "{33887AC8-F047-499B-A4D4-BF27E78EBCD3}";
	$item.Fields['__Workflow'].Value = "{011178AC-321A-4C3E-8E27-5B92DB57E062}";
	$item.Fields['XTM_Translation in progress'].Value = "0";
	$item.Fields['XTM_Translated'].Value = "1";
	$item.Editing.EndEdit();
	Write-Output "Updated item: " $item.Version.Number $item.Name $item.Id.Guid.Guid
 }

Script for deselecting the XTM_Translation in progress checkbox in a language version

Code Block
languagepowershell
Foreach ($item in Get-ChildItem -path "/PATH/TO/MAIN/ITEM" -Language "LANGUAGE-CODE" -Recurse | Where-Object { $_.Fields['XTM_Translation in progress'] -ne $null })
{
	$item.Editing.BeginEdit();
	$item.Fields['XTM_Translation in progress'].Value = "0";
	$item.Editing.EndEdit();
	Write-Output "Updated item: " $item.Version.Number $item.Name $item.Id.Guid.Guid
 }

...