From 060500a4f07b9aa94de048a11d4ef2b5c40d598d Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Thu, 6 Jul 2023 23:29:41 +0200
Subject: [PATCH] [TASK] Add MM-related DataHandler tests

This change adds the status quo for further MM-related work.

This relates to some tests that had tests on
"allowLanguageSynchronization" but not "l10n_mode=exclude" set.

In addition, some MM-related tests were not added to all workspace-*
tests anymore, which are now added:

* copyContentToLanguageOfRelation
* copyCategoryToLanguageOfRelation
* localizeContentOfRelationWithLanguageExclude
* localizeContentOfRelationAndAddCategoryWithLanguageSynchronization

Resolves: #101285
Related: #80640
Releases: main, 12.4
Change-Id: Ib675b9bc263d519372a8028370db581e25a49edf
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79864
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: core-ci <typo3@b13.com>
---
 .../ManyToMany/AbstractActionTestCase.php     |  25 ++--
 .../ManyToMany/Modify/ActionTest.php          |  16 +++
 .../localizeContentOfRelationWExclude.csv     |  35 ++++++
 .../WorkspacesDiscard/ActionTest.php          |  70 +++++++++++
 .../copyCategoryToLanguageOfRelation.csv      |  40 ++++++
 .../copyContentToLanguageOfRelation.csv       |  38 ++++++
 ...OfRelationNAddCategoryWSynchronization.csv |  48 ++++++++
 ...OfRelationNAddCategoryWSynchronization.csv |  48 ++++++++
 .../localizeContentOfRelationWExclude.csv     |  38 ++++++
 ...alizeContentOfRelationWSynchronization.csv |  38 ++++++
 .../WorkspacesModify/ActionTest.php           | 114 ++++++++++++++++++
 .../copyCategoryToLanguageOfRelation.csv      |  39 ++++++
 .../copyContentToLanguageOfRelation.csv       |  46 +++++++
 ...OfRelationNAddCategoryWSynchronization.csv |  64 ++++++++++
 ...OfRelationNAddCategoryWSynchronization.csv |  56 +++++++++
 .../localizeContentOfRelationWExclude.csv     |  47 ++++++++
 ...alizeContentOfRelationWSynchronization.csv |  47 ++++++++
 .../WorkspacesPublish/ActionTest.php          | 101 ++++++++++++++++
 .../copyCategoryToLanguageOfRelation.csv      |  39 ++++++
 .../copyContentToLanguageOfRelation.csv       |  43 +++++++
 ...OfRelationNAddCategoryWSynchronization.csv |  70 +++++++++++
 ...OfRelationNAddCategoryWSynchronization.csv |  59 +++++++++
 .../localizeContentOfRelationWExclude.csv     |  44 +++++++
 ...alizeContentOfRelationWSynchronization.csv |  44 +++++++
 .../WorkspacesPublishAll/ActionTest.php       |  99 +++++++++++++++
 .../copyCategoryToLanguageOfRelation.csv      |  39 ++++++
 .../copyContentToLanguageOfRelation.csv       |  43 +++++++
 ...OfRelationNAddCategoryWSynchronization.csv |  58 +++++++++
 ...OfRelationNAddCategoryWSynchronization.csv |  48 ++++++++
 .../localizeContentOfRelationWExclude.csv     |  44 +++++++
 ...alizeContentOfRelationWSynchronization.csv |  44 +++++++
 31 files changed, 1571 insertions(+), 13 deletions(-)
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/Modify/DataSet/localizeContentOfRelationWExclude.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/copyCategoryToLanguageOfRelation.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/copyContentToLanguageOfRelation.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationWExclude.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/copyCategoryToLanguageOfRelation.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/copyContentToLanguageOfRelation.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationWExclude.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/copyCategoryToLanguageOfRelation.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/copyContentToLanguageOfRelation.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationWExclude.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/copyCategoryToLanguageOfRelation.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/copyContentToLanguageOfRelation.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationWExclude.csv
 create mode 100644 typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationWSynchronization.csv

diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/AbstractActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/AbstractActionTestCase.php
index f9ad4354c988..e3d4eee171a8 100644
--- a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/AbstractActionTestCase.php
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/AbstractActionTestCase.php
@@ -134,20 +134,21 @@ abstract class AbstractActionTestCase extends AbstractDataHandlerActionTestCase
 
     /**
      * See DataSet/copyContentToLanguageOfRelation.csv
-     * @todo: does not exist in workspaces
      */
     public function copyContentToLanguageOfRelation(): void
     {
-        $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
+        $newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
+        $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
     }
 
     /**
      * See DataSet/copyCategoryToLanguageOfRelation.csv
-     * @todo: does not exist in workspaces
+     * @todo: This action does not copy the relations with it (at least in workspaces), and should be re-evaluated
      */
     public function copyCategoryToLanguageOfRelation(): void
     {
-        $this->actionService->copyRecordToLanguage(self::TABLE_Category, self::VALUE_CategoryIdFirst, self::VALUE_LanguageId);
+        $newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Category, self::VALUE_CategoryIdFirst, self::VALUE_LanguageId);
+        $this->recordIds['newCategoryId'] = $newTableIds[self::TABLE_Category][self::VALUE_CategoryIdFirst];
     }
 
     public function localizeContentOfRelation(): void
@@ -156,9 +157,6 @@ abstract class AbstractActionTestCase extends AbstractDataHandlerActionTestCase
         $this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
     }
 
-    /**
-     * @todo: does not exist in workspaces
-     */
     public function localizeContentOfRelationWithLanguageSynchronization(): void
     {
         $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_Categories]['config']['behaviour']['allowLanguageSynchronization'] = true;
@@ -166,9 +164,13 @@ abstract class AbstractActionTestCase extends AbstractDataHandlerActionTestCase
         $this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
     }
 
-    /**
-     * @todo: does not exist in workspaces
-     */
+    public function localizeContentOfRelationWithLanguageExclude(): void
+    {
+        $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_Categories]['config']['l10n_mode'] = 'exclude';
+        $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
+        $this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
+    }
+
     public function localizeContentOfRelationAndAddCategoryWithLanguageSynchronization(): void
     {
         $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_Categories]['config']['behaviour']['allowLanguageSynchronization'] = true;
@@ -182,9 +184,6 @@ abstract class AbstractActionTestCase extends AbstractDataHandlerActionTestCase
         );
     }
 
-    /**
-     * @todo: does not exist in workspaces
-     */
     public function localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization(): void
     {
         $GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_Categories]['config']['behaviour']['allowLanguageSynchronization'] = true;
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/Modify/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/Modify/ActionTest.php
index c0516a164317..fe96c2ccf3ca 100644
--- a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/Modify/ActionTest.php
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/Modify/ActionTest.php
@@ -269,6 +269,22 @@ final class ActionTest extends AbstractActionTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
     }
 
+    /**
+     * @test
+     * See DataSet/localizeContentOfRelationWExclude.csv
+     */
+    public function localizeContentOfRelationWithLanguageExclude(): void
+    {
+        parent::localizeContentOfRelationWithLanguageExclude();
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWExclude.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
     /**
      * @test
      * See DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/Modify/DataSet/localizeContentOfRelationWExclude.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/Modify/DataSet/localizeContentOfRelationWExclude.csv
new file mode 100644
index 000000000000..a0a653fb43a8
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/Modify/DataSet/localizeContentOfRelationWExclude.csv
@@ -0,0 +1,35 @@
+"pages",,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,
+,1,0,256,0,0,0,0,0,0,"FunctionalTest",,,,,
+,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,,,,
+,89,88,256,0,0,0,0,0,0,"Relations",,,,,
+,90,88,512,0,0,0,0,0,0,"Target",,,,,
+"sys_category",,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",
+,28,0,256,0,0,0,0,0,0,0,0,"Category A",0,0,
+,29,0,512,0,0,0,0,0,0,0,0,"Category B",0,0,
+,30,0,768,0,0,0,0,0,0,0,0,"Category C",0,0,
+,31,0,1024,0,0,0,0,0,0,0,0,"Category A.A",28,0,
+"sys_category_record_mm",,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state"
+,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",0,2,"\NULL"
+,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",0,2,"\NULL"
+,299,89,768,0,1,298,298,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,2,"\NULL"
+"sys_refindex",,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,
+,"6dc66af7d395e5be3c87fc4e13c0455c","tt_content",299,"l18n_parent",,,,0,0,"tt_content",298,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/ActionTest.php
index eb2f9aa41663..e0c9a2b98436 100644
--- a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/ActionTest.php
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/ActionTest.php
@@ -195,6 +195,16 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
         $this->assertCSVDataSet(__DIR__ . '/DataSet/copyContentOfRelation.csv');
     }
 
+    /**
+     * @test
+     */
+    public function copyContentToLanguageOfRelation(): void
+    {
+        parent::copyContentToLanguageOfRelation();
+        $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/copyContentToLanguageOfRelation.csv');
+    }
+
     /**
      * @test
      */
@@ -205,6 +215,17 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
         $this->assertCSVDataSet(__DIR__ . '/DataSet/copyCategoryOfRelation.csv');
     }
 
+    /**
+     * @test
+     * @todo: this is a faulty test, because the category should be discarded
+     */
+    public function copyCategoryToLanguageOfRelation(): void
+    {
+        parent::copyCategoryToLanguageOfRelation();
+        $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newCategoryId']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/copyCategoryToLanguageOfRelation.csv');
+    }
+
     /**
      * @test
      */
@@ -215,6 +236,55 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
         $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelation.csv');
     }
 
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationWithLanguageSynchronization(): void
+    {
+        parent::localizeContentOfRelationWithLanguageSynchronization();
+        $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWSynchronization.csv');
+    }
+
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationWithLanguageExclude(): void
+    {
+        parent::localizeContentOfRelationWithLanguageExclude();
+        $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWExclude.csv');
+    }
+
+    /**
+     * @test
+     * See DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
+     * Note: The added category still exists, even if we discard the localized content
+     */
+    public function localizeContentOfRelationAndAddCategoryWithLanguageSynchronization(): void
+    {
+        parent::localizeContentOfRelationAndAddCategoryWithLanguageSynchronization();
+        // @todo: even if we discard this record, it is still showing up in the result
+        $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
+        // @todo: do we need to discard the references manually?
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv');
+    }
+
+    /**
+     * @test
+     * See DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
+     * Note: The added category still exists, even if we discard the localized content
+     */
+    public function localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization(): void
+    {
+        parent::localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization();
+        // @todo: even if we discard this record, it is still showing up in the result
+        $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
+        $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentIdSecond']);
+        // @todo: do we need to discard the references manually?
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv');
+    }
+
     /**
      * @test
      */
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/copyCategoryToLanguageOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/copyCategoryToLanguageOfRelation.csv
new file mode 100644
index 000000000000..8e52c515d732
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/copyCategoryToLanguageOfRelation.csv
@@ -0,0 +1,40 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+# @todo: this is a bug. Discard should remove this record
+,32,0,384,0,1,0,1,1,0,0,"[Translate to Dansk:] Category A",0,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/copyContentToLanguageOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/copyContentToLanguageOfRelation.csv
new file mode 100644
index 000000000000..20ff25652b1e
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/copyContentToLanguageOfRelation.csv
@@ -0,0 +1,38 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
new file mode 100644
index 000000000000..cee1eee86312
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
@@ -0,0 +1,48 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+# @todo: These records have been added in Workspace but are not discarded (as it's a loose connection) - does this make sense?
+,29,301,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,301,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,301,"tt_content",0,3,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+# @todo: this should never be there. And: Why doesn't this have a sys_language_uid record?
+,301,89,512,0,0,0,1,0,0,298,"Regular Element #2",0,3,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"a2784c59b73c994181170d02af23959c","sys_category",29,"items",,,,0,1,"tt_content",297,,,,,,
+,"f0163305d4f0d8bb60442a6274f60789","sys_category",29,"items",,,,2,1,"tt_content",301,,,,,,
+,"7e26b91c5c5b4a248372dc4088aab1a2","sys_category",30,"items",,,,1,1,"tt_content",301,,,,,,
+,"25149609959939239d08d8a9bf55d0dd","sys_category",31,"items",,,,0,1,"tt_content",301,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
new file mode 100644
index 000000000000..f2d01a204af8
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
@@ -0,0 +1,48 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+# @todo: These records have been added in Workspace but are not discarded (as it's a loose connection) - does this make sense?
+,29,300,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,300,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,300,"tt_content",0,3,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+# @todo: this should never be there. And: Why doesn't this have a sys_language_uid record?
+,300,89,512,0,0,0,1,0,0,298,"Regular Element #2",0,3,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"a2784c59b73c994181170d02af23959c","sys_category",29,"items",,,,0,1,"tt_content",297,,,,,,
+,"f075722a18763b90bece7e2a128a4c37","sys_category",29,"items",,,,2,1,"tt_content",300,,,,,,
+,"a05563ee05b1309b920ab23a469e94aa","sys_category",30,"items",,,,1,1,"tt_content",300,,,,,,
+,"3f2f472a5a6903529448b3da3d4c1e4d","sys_category",31,"items",,,,0,1,"tt_content",300,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationWExclude.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationWExclude.csv
new file mode 100644
index 000000000000..08e6d17b33c8
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationWExclude.csv
@@ -0,0 +1,38 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationWSynchronization.csv
new file mode 100644
index 000000000000..08e6d17b33c8
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesDiscard/DataSet/localizeContentOfRelationWSynchronization.csv
@@ -0,0 +1,38 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/ActionTest.php
index 83c4d7287aa6..f0ec9146baf6 100644
--- a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/ActionTest.php
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/ActionTest.php
@@ -285,6 +285,24 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
     }
 
+    /**
+     * @test
+     */
+    public function copyContentToLanguageOfRelation(): void
+    {
+        parent::copyContentToLanguageOfRelation();
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/copyContentToLanguageOfRelation.csv');
+
+        $response = $this->executeFrontendSubRequest(
+            (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
+            (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
+        );
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
     /**
      * @test
      */
@@ -303,6 +321,26 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category A (copy 1)'));
     }
 
+    /**
+     * @test
+     */
+    public function copyCategoryToLanguageOfRelation(): void
+    {
+        parent::copyCategoryToLanguageOfRelation();
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/copyCategoryToLanguageOfRelation.csv');
+
+        $response = $this->executeFrontendSubRequest(
+            (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
+            (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
+        );
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A'));
+        // As the copy is not connected, it is also not shown in the default language @todo check if this is correct
+        //    ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', '[Translate to Dansk:] Category A'));
+    }
+
     /**
      * @test
      */
@@ -321,6 +359,82 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
     }
 
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationWithLanguageSynchronization(): void
+    {
+        parent::localizeContentOfRelationWithLanguageSynchronization();
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWSynchronization.csv');
+
+        $response = $this->executeFrontendSubRequest(
+            (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
+            (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
+        );
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
+    /**
+     * @test
+     */
+    public function localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization(): void
+    {
+        parent::localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization();
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv');
+
+        // @todo: should we check for LanguageId_Second?
+        $response = $this->executeFrontendSubRequest(
+            (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
+            (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
+        );
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationWithLanguageExclude(): void
+    {
+        parent::localizeContentOfRelationWithLanguageExclude();
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWExclude.csv');
+
+        $response = $this->executeFrontendSubRequest(
+            (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
+            (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
+        );
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
+    /**
+     * @test
+     * See DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
+     * @todo: this test is faulty as it adds a lot of entries
+     */
+    public function localizeContentOfRelationAndAddCategoryWithLanguageSynchronization(): void
+    {
+        parent::localizeContentOfRelationAndAddCategoryWithLanguageSynchronization();
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv');
+
+        $response = $this->executeFrontendSubRequest(
+            (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
+            (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
+        );
+        // @todo: should probably also show the fourth category
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
     /**
      * @test
      */
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/copyCategoryToLanguageOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/copyCategoryToLanguageOfRelation.csv
new file mode 100644
index 000000000000..f8d860d99d62
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/copyCategoryToLanguageOfRelation.csv
@@ -0,0 +1,39 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+,32,0,384,0,1,0,1,1,0,0,"[Translate to Dansk:] Category A",0,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/copyContentToLanguageOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/copyContentToLanguageOfRelation.csv
new file mode 100644
index 000000000000..e8299313538e
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/copyContentToLanguageOfRelation.csv
@@ -0,0 +1,46 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,0,1,1,0,0,"[Translate to Dansk:] Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"a2784c59b73c994181170d02af23959c","sys_category",29,"items",,,,0,1,"tt_content",297,,,,,,
+,"6824a5635d464123a7a91770440e1d23","sys_category",29,"items",,,,1,1,"tt_content",298,,,,,,
+,"92e328e25f38d92ecf90478f6b47e671","sys_category",29,"items",,,,2,1,"tt_content",299,,,,,,
+,"d624da48d7d6427f385a8197cb90c391","sys_category",30,"items",,,,0,1,"tt_content",298,,,,,,
+,"f65da53fb6e3b34333940d2cffe010a3","sys_category",30,"items",,,,1,1,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
new file mode 100644
index 000000000000..cd06a15e2b6d
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
@@ -0,0 +1,64 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+# @todo: These records have been added in Workspace but are not discarded (as it's a loose connection) - does this make sense?
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,299,"tt_content",0,3,"categories",,,,,,,,,,,
+,29,300,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,300,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,300,"tt_content",0,3,"categories",,,,,,,,,,,
+,29,301,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,301,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,301,"tt_content",0,3,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,1,1,0,0,"[Translate to Dansk:] Regular Element #2",0,3,"{""categories"":""parent""}",,,
+,300,89,1024,0,2,298,1,1,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #2",0,3,"{""categories"":""source""}",,,
+# @todo: this should never be there. And: Why doesn't this have a sys_language_uid record?
+,301,89,512,0,0,0,1,0,0,298,"Regular Element #2",0,3,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"a2784c59b73c994181170d02af23959c","sys_category",29,"items",,,,0,1,"tt_content",297,,,,,,
+,"92e328e25f38d92ecf90478f6b47e671","sys_category",29,"items",,,,2,1,"tt_content",299,,,,,,
+,"f65da53fb6e3b34333940d2cffe010a3","sys_category",30,"items",,,,1,1,"tt_content",299,,,,,,
+,"55997c67816b709e1d0f0323fea3c39a","sys_category",31,"items",,,,0,1,"tt_content",299,,,,,,
+,"bc70e11586947a0c445e348692fd80ba","sys_category",29,"items",,,,3,1,"tt_content",300,,,,,,
+,"30dbf807a4f9b02e14ed66e14fbafa8d","sys_category",30,"items",,,,2,1,"tt_content",300,,,,,,
+,"cc7a87f86e822a6fa9e657823dd403cb","sys_category",31,"items",,,,1,1,"tt_content",300,,,,,,
+,"e4afda9b67d6ad42e03f5c797250235d","tt_content",299,"l18n_parent",,,,0,1,"tt_content",298,,,,,,
+,"395b0d618186f09ea54b5c1d1453b546","tt_content",300,"l18n_parent",,,,0,1,"tt_content",298,,,,,,
+,"f61b78a60242bcb99d06fa67e53e901f","sys_category",29,"items",,,,4,1,"tt_content",301,,,,,,
+,"82a47852dee1493bcb8621ec3f4a3774","sys_category",30,"items",,,,3,1,"tt_content",301,,,,,,
+,"43deb98f64c8be0b517af16d3f667792","sys_category",31,"items",,,,2,1,"tt_content",301,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
new file mode 100644
index 000000000000..cb9178f86563
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
@@ -0,0 +1,56 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+# @todo: This does not seem right at all. A lot of duplicates
+,29,300,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,300,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,300,"tt_content",0,3,"categories",,,,,,,,,,,
+,31,299,"tt_content",0,3,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,1,1,0,0,"[Translate to Dansk:] Regular Element #2",0,3,"{""categories"":""parent""}",,,
+# @todo: This does not seem right at all. This is a copy of the regular element IN ADDITION to the translated version
+,300,89,512,0,0,0,1,0,0,298,"Regular Element #2",0,3,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"e4afda9b67d6ad42e03f5c797250235d","tt_content",299,"l18n_parent",,,,0,1,"tt_content",298,,,,,,
+,"a2784c59b73c994181170d02af23959c","sys_category",29,"items",,,,0,1,"tt_content",297,,,,,,
+,"92e328e25f38d92ecf90478f6b47e671","sys_category",29,"items",,,,2,1,"tt_content",299,,,,,,
+,"f65da53fb6e3b34333940d2cffe010a3","sys_category",30,"items",,,,1,1,"tt_content",299,,,,,,
+,"bc70e11586947a0c445e348692fd80ba","sys_category",29,"items",,,,3,1,"tt_content",300,,,,,,
+,"30dbf807a4f9b02e14ed66e14fbafa8d","sys_category",30,"items",,,,2,1,"tt_content",300,,,,,,
+,"55997c67816b709e1d0f0323fea3c39a","sys_category",31,"items",,,,0,1,"tt_content",299,,,,,,
+,"cc7a87f86e822a6fa9e657823dd403cb","sys_category",31,"items",,,,1,1,"tt_content",300,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationWExclude.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationWExclude.csv
new file mode 100644
index 000000000000..4db5fa391f44
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationWExclude.csv
@@ -0,0 +1,47 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,1,1,0,0,"[Translate to Dansk:] Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"e4afda9b67d6ad42e03f5c797250235d","tt_content",299,"l18n_parent",,,,0,1,"tt_content",298,,,,,,
+,"a2784c59b73c994181170d02af23959c","sys_category",29,"items",,,,0,1,"tt_content",297,,,,,,
+,"6824a5635d464123a7a91770440e1d23","sys_category",29,"items",,,,1,1,"tt_content",298,,,,,,
+,"92e328e25f38d92ecf90478f6b47e671","sys_category",29,"items",,,,2,1,"tt_content",299,,,,,,
+,"d624da48d7d6427f385a8197cb90c391","sys_category",30,"items",,,,0,1,"tt_content",298,,,,,,
+,"f65da53fb6e3b34333940d2cffe010a3","sys_category",30,"items",,,,1,1,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationWSynchronization.csv
new file mode 100644
index 000000000000..debbb7c4890e
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesModify/DataSet/localizeContentOfRelationWSynchronization.csv
@@ -0,0 +1,47 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,1,1,0,0,"[Translate to Dansk:] Regular Element #2",0,2,"{""categories"":""parent""}",,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"e4afda9b67d6ad42e03f5c797250235d","tt_content",299,"l18n_parent",,,,0,1,"tt_content",298,,,,,,
+,"a2784c59b73c994181170d02af23959c","sys_category",29,"items",,,,0,1,"tt_content",297,,,,,,
+,"6824a5635d464123a7a91770440e1d23","sys_category",29,"items",,,,1,1,"tt_content",298,,,,,,
+,"92e328e25f38d92ecf90478f6b47e671","sys_category",29,"items",,,,2,1,"tt_content",299,,,,,,
+,"d624da48d7d6427f385a8197cb90c391","sys_category",30,"items",,,,0,1,"tt_content",298,,,,,,
+,"f65da53fb6e3b34333940d2cffe010a3","sys_category",30,"items",,,,1,1,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/ActionTest.php
index 285bda23566b..f99f431e5f4d 100644
--- a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/ActionTest.php
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/ActionTest.php
@@ -279,6 +279,22 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
     }
 
+    /**
+     * @test
+     */
+    public function copyContentToLanguageOfRelation(): void
+    {
+        parent::copyContentToLanguageOfRelation();
+        $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/copyContentToLanguageOfRelation.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
     /**
      * @test
      */
@@ -295,6 +311,25 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category A (copy 1)'));
     }
 
+    /**
+     * @test
+     */
+    public function copyCategoryToLanguageOfRelation(): void
+    {
+        parent::copyCategoryToLanguageOfRelation();
+        $this->actionService->publishRecord(self::TABLE_Category, $this->recordIds['newCategoryId']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/copyCategoryToLanguageOfRelation.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A'));
+        // [Translate to Dansk:] Category A is not connected, thus it is not shown
+        // ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', '[Translate to Dansk:] Category A'));
+
+    }
+
     /**
      * @test
      */
@@ -311,6 +346,72 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
     }
 
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationWithLanguageSynchronization(): void
+    {
+        parent::localizeContentOfRelationWithLanguageSynchronization();
+        $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWSynchronization.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationWithLanguageExclude(): void
+    {
+        parent::localizeContentOfRelationWithLanguageExclude();
+        $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWExclude.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationAndAddCategoryWithLanguageSynchronization(): void
+    {
+        parent::localizeContentOfRelationAndAddCategoryWithLanguageSynchronization();
+        $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
+    /**
+     * @test
+     */
+    public function localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization(): void
+    {
+        parent::localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization();
+        $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
+        $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentIdSecond']);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv');
+
+        // @todo: should we check for LanguageId_Second?
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
     /**
      * @test
      */
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/copyCategoryToLanguageOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/copyCategoryToLanguageOfRelation.csv
new file mode 100644
index 000000000000..eaaa8e344e01
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/copyCategoryToLanguageOfRelation.csv
@@ -0,0 +1,39 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+,32,0,384,0,1,0,0,0,0,0,"[Translate to Dansk:] Category A",0,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/copyContentToLanguageOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/copyContentToLanguageOfRelation.csv
new file mode 100644
index 000000000000..071536216deb
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/copyContentToLanguageOfRelation.csv
@@ -0,0 +1,43 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,0,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
new file mode 100644
index 000000000000..a3ef6e21cbc7
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
@@ -0,0 +1,70 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+# @todo: These records have been added in Workspace but are not discarded (as it's a loose connection) - does this make sense?
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,299,"tt_content",0,3,"categories",,,,,,,,,,,
+,29,300,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,300,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,300,"tt_content",0,3,"categories",,,,,,,,,,,
+,29,301,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,301,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,301,"tt_content",0,3,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,3,"{""categories"":""parent""}",,,
+,300,89,1024,0,2,298,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #2",0,3,"{""categories"":""source""}",,,
+# @todo: this should never be there. And: Why doesn't this have a sys_language_uid record?
+,301,89,512,0,0,0,1,0,0,298,"Regular Element #2",0,3,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
+,"51c976b55c7d8cded9b04d8f6a7ba588","sys_category",31,"items",,,,0,0,"tt_content",299,,,,,,
+,"c9b6f46d28e208f172a6d23329c6ca99","sys_category",29,"items",,,,3,0,"tt_content",300,,,,,,
+,"0a064b8983002eeee02584d61a5bbf76","sys_category",30,"items",,,,2,0,"tt_content",300,,,,,,
+,"eff6e1e751e73db5f4d29f1cffee82af","sys_category",31,"items",,,,1,0,"tt_content",300,,,,,,
+,"6dc66af7d395e5be3c87fc4e13c0455c","tt_content",299,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
+,"96c729dcc96a40a04fd5591a442b68b5","tt_content",300,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
+,"f61b78a60242bcb99d06fa67e53e901f","sys_category",29,"items",,,,4,1,"tt_content",301,,,,,,
+,"82a47852dee1493bcb8621ec3f4a3774","sys_category",30,"items",,,,3,1,"tt_content",301,,,,,,
+,"43deb98f64c8be0b517af16d3f667792","sys_category",31,"items",,,,2,1,"tt_content",301,,,,,,
+,"a2784c59b73c994181170d02af23959c","sys_category",29,"items",,,,0,1,"tt_content",297,,,,,,
+,"92e328e25f38d92ecf90478f6b47e671","sys_category",29,"items",,,,2,1,"tt_content",299,,,,,,
+,"f65da53fb6e3b34333940d2cffe010a3","sys_category",30,"items",,,,1,1,"tt_content",299,,,,,,
+,"55997c67816b709e1d0f0323fea3c39a","sys_category",31,"items",,,,0,1,"tt_content",299,,,,,,
+,"bc70e11586947a0c445e348692fd80ba","sys_category",29,"items",,,,3,1,"tt_content",300,,,,,,
+,"30dbf807a4f9b02e14ed66e14fbafa8d","sys_category",30,"items",,,,2,1,"tt_content",300,,,,,,
+,"cc7a87f86e822a6fa9e657823dd403cb","sys_category",31,"items",,,,1,1,"tt_content",300,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
new file mode 100644
index 000000000000..fd3bda0410b3
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
@@ -0,0 +1,59 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+# @todo this is probably wrong as there are multiple records
+,29,300,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,300,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,300,"tt_content",0,3,"categories",,,,,,,,,,,
+,31,299,"tt_content",0,3,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,3,,,,
+# @todo: should not exist
+,300,89,512,0,0,0,1,0,0,298,"Regular Element #2",0,3,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"6dc66af7d395e5be3c87fc4e13c0455c","tt_content",299,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
+,"a2784c59b73c994181170d02af23959c","sys_category",29,"items",,,,0,1,"tt_content",297,,,,,,
+,"bc70e11586947a0c445e348692fd80ba","sys_category",29,"items",,,,3,1,"tt_content",300,,,,,,
+,"30dbf807a4f9b02e14ed66e14fbafa8d","sys_category",30,"items",,,,2,1,"tt_content",300,,,,,,
+,"cc7a87f86e822a6fa9e657823dd403cb","sys_category",31,"items",,,,1,1,"tt_content",300,,,,,,
+,"51c976b55c7d8cded9b04d8f6a7ba588","sys_category",31,"items",,,,0,0,"tt_content",299,,,,,,
+,"92e328e25f38d92ecf90478f6b47e671","sys_category",29,"items",,,,2,1,"tt_content",299,,,,,,
+,"f65da53fb6e3b34333940d2cffe010a3","sys_category",30,"items",,,,1,1,"tt_content",299,,,,,,
+,"55997c67816b709e1d0f0323fea3c39a","sys_category",31,"items",,,,0,1,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationWExclude.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationWExclude.csv
new file mode 100644
index 000000000000..4d7e8dacf729
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationWExclude.csv
@@ -0,0 +1,44 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"6dc66af7d395e5be3c87fc4e13c0455c","tt_content",299,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationWSynchronization.csv
new file mode 100644
index 000000000000..111ec9ebd86c
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublish/DataSet/localizeContentOfRelationWSynchronization.csv
@@ -0,0 +1,44 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,2,"{""categories"":""parent""}",,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"6dc66af7d395e5be3c87fc4e13c0455c","tt_content",299,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/ActionTest.php
index e69c8800e1c1..75a7babe98ff 100644
--- a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/ActionTest.php
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/ActionTest.php
@@ -263,6 +263,22 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
     }
 
+    /**
+     * @test
+     */
+    public function copyContentToLanguageOfRelation(): void
+    {
+        parent::copyContentToLanguageOfRelation();
+        $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/copyContentToLanguageOfRelation.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
     /**
      * @test
      */
@@ -279,6 +295,24 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category A (copy 1)'));
     }
 
+    /**
+     * @test
+     */
+    public function copyCategoryToLanguageOfRelation(): void
+    {
+        parent::copyCategoryToLanguageOfRelation();
+        $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/copyCategoryToLanguageOfRelation.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A'));
+        // [Translate to Dansk:] Category A is not connected, thus it is not shown
+        // ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', '[Translate to Dansk:] Category A'));
+    }
+
     /**
      * @test
      */
@@ -295,6 +329,71 @@ final class ActionTest extends AbstractActionWorkspacesTestCase
             ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
     }
 
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationWithLanguageSynchronization(): void
+    {
+        parent::localizeContentOfRelationWithLanguageSynchronization();
+        $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWSynchronization.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationWithLanguageExclude(): void
+    {
+        parent::localizeContentOfRelationWithLanguageExclude();
+        $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWExclude.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
+    /**
+     * @test
+     */
+    public function localizeContentOfRelationAndAddCategoryWithLanguageSynchronization(): void
+    {
+        parent::localizeContentOfRelationAndAddCategoryWithLanguageSynchronization();
+        $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv');
+
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
+    /**
+     * @test
+     */
+    public function localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization(): void
+    {
+        parent::localizeContentChainOfRelationAndAddCategoryWithLanguageSynchronization();
+        $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
+        $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv');
+
+        // @todo: should we check for LanguageId_Second?
+        $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
+        $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
+        self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+            ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
+            ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
+    }
+
     /**
      * @test
      */
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/copyCategoryToLanguageOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/copyCategoryToLanguageOfRelation.csv
new file mode 100644
index 000000000000..eaaa8e344e01
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/copyCategoryToLanguageOfRelation.csv
@@ -0,0 +1,39 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+,32,0,384,0,1,0,0,0,0,0,"[Translate to Dansk:] Category A",0,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/copyContentToLanguageOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/copyContentToLanguageOfRelation.csv
new file mode 100644
index 000000000000..071536216deb
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/copyContentToLanguageOfRelation.csv
@@ -0,0 +1,43 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,0,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
new file mode 100644
index 000000000000..8fec0de24286
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentChainOfRelationNAddCategoryWSynchronization.csv
@@ -0,0 +1,58 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+# @todo: These records have been added in Workspace but are not discarded (as it's a loose connection) - does this make sense?
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,299,"tt_content",0,3,"categories",,,,,,,,,,,
+,29,300,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,300,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,300,"tt_content",0,3,"categories",,,,,,,,,,,
+,31,298,"tt_content",0,3,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,3,,,,
+,299,89,768,0,1,298,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,3,"{""categories"":""parent""}",,,
+,300,89,1024,0,2,298,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #2",0,3,"{""categories"":""source""}",,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
+,"6353470b60a88a0d5f54f34692c16358","sys_category",31,"items",,,,0,0,"tt_content",298,,,,,,
+,"c9b6f46d28e208f172a6d23329c6ca99","sys_category",29,"items",,,,3,0,"tt_content",300,,,,,,
+,"0a064b8983002eeee02584d61a5bbf76","sys_category",30,"items",,,,2,0,"tt_content",300,,,,,,
+# @todo: interesting sorting
+,"e50479cdf26742b853f7c6887e590abe","sys_category",31,"items",,,,2,0,"tt_content",300,,,,,,
+,"c3bb83bc7d6b774c78ef56f8ce67fba5","sys_category",31,"items",,,,1,0,"tt_content",299,,,,,,
+,"6dc66af7d395e5be3c87fc4e13c0455c","tt_content",299,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
+,"96c729dcc96a40a04fd5591a442b68b5","tt_content",300,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
new file mode 100644
index 000000000000..26ea9f143d13
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationNAddCategoryWSynchronization.csv
@@ -0,0 +1,48 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+,31,298,"tt_content",0,3,"categories",,,,,,,,,,,
+,31,299,"tt_content",0,3,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories",,,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,3,,,,
+,299,89,768,0,1,298,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,3,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"6dc66af7d395e5be3c87fc4e13c0455c","tt_content",299,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
+,"6353470b60a88a0d5f54f34692c16358","sys_category",31,"items",,,,0,0,"tt_content",298,,,,,,
+,"c3bb83bc7d6b774c78ef56f8ce67fba5","sys_category",31,"items",,,,1,0,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationWExclude.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationWExclude.csv
new file mode 100644
index 000000000000..4d7e8dacf729
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationWExclude.csv
@@ -0,0 +1,44 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,2,,,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"6dc66af7d395e5be3c87fc4e13c0455c","tt_content",299,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
diff --git a/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationWSynchronization.csv b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationWSynchronization.csv
new file mode 100644
index 000000000000..111ec9ebd86c
--- /dev/null
+++ b/typo3/sysext/core/Tests/Functional/DataScenarios/ManyToMany/WorkspacesPublishAll/DataSet/localizeContentOfRelationWSynchronization.csv
@@ -0,0 +1,44 @@
+"pages",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title",,,,,,,,
+,1,0,256,0,0,0,0,0,"FunctionalTest",,,,,,,,
+,88,1,256,0,0,0,0,0,"DataHandlerTest",,,,,,,,
+,89,88,256,0,0,0,0,0,"Relations",,,,,,,,
+,90,88,512,0,0,0,0,0,"Target",,,,,,,,
+"sys_workspace",,,,,,,,,,,,,,,,,
+,"uid","pid","deleted","title","adminusers","members","db_mountpoints","file_mountpoints","freeze","live_edit","publish_access","custom_stages","stagechg_notification","edit_notification_defaults","edit_allow_notificaton_settings","publish_notification_defaults","publish_allow_notificaton_settings"
+,1,0,0,"Workspace #1",,,,,0,0,0,0,0,0,0,0,0
+,2,0,0,"Workspace #2",,,,,0,0,0,0,0,0,0,0,0
+"sys_workspace_stage",,,,,,,,,,,,,,,,,
+,"uid","pid","tstamp","deleted","sorting","title","responsible_persons","default_mailcomment","parentid","parenttable","notification_defaults","allow_notificaton_settings",,,,,
+,1,0,1290048921,0,1,"Stage 1","be_users_3",,1,"sys_workspace",0,0,,,,,
+"sys_category",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l10n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","title","parent","items",,,,
+,28,0,256,0,0,0,0,0,0,0,"Category A",0,0,,,,
+,29,0,512,0,0,0,0,0,0,0,"Category B",0,0,,,,
+,30,0,768,0,0,0,0,0,0,0,"Category C",0,0,,,,
+,31,0,1024,0,0,0,0,0,0,0,"Category A.A",28,0,,,,
+"sys_category_record_mm",,,,,,,,,,,,,,,,,
+,"uid_local","uid_foreign","tablenames","sorting","sorting_foreign","fieldname",,,,,,,,,,,
+,28,297,"tt_content",0,1,"categories",,,,,,,,,,,
+,29,297,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,298,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,298,"tt_content",0,2,"categories",,,,,,,,,,,
+,29,299,"tt_content",0,1,"categories",,,,,,,,,,,
+,30,299,"tt_content",0,2,"categories",,,,,,,,,,,
+"tt_content",,,,,,,,,,,,,,,,,
+,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","header","image","categories","l10n_state",,,
+,297,89,256,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,,
+,298,89,512,0,0,0,0,0,0,0,"Regular Element #2",0,2,,,,
+,299,89,768,0,1,298,0,0,0,0,"[Translate to Dansk:] Regular Element #2",0,2,"{""categories"":""parent""}",,,
+"sys_refindex",,,,,,,,,,,,,,,,,
+,"hash","tablename","recuid","field","flexpointer","softref_key","softref_id","sorting","workspace","ref_table","ref_uid","ref_string",,,,,
+,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",,,,0,0,"be_users",3,,,,,,
+,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",,,,0,0,"sys_category",28,,,,,,
+,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",,,,0,0,"sys_workspace_stage",1,,,,,,
+,"3c637501ab9c158daa933643bff8cc43","sys_category",28,"items",,,,0,0,"tt_content",297,,,,,,
+,"6dc66af7d395e5be3c87fc4e13c0455c","tt_content",299,"l18n_parent",,,,0,0,"tt_content",298,,,,,,
+,"aabda97b66f9b693f30d1faf442b37d6","sys_category",29,"items",,,,1,0,"tt_content",298,,,,,,
+,"b102e2f9b1ed99b14d813363199cb281","sys_category",30,"items",,,,0,0,"tt_content",298,,,,,,
+,"e19100d609a435906e16432a41b55c72","sys_category",29,"items",,,,0,0,"tt_content",297,,,,,,
+,"40880cf3db51a7c80d8714f9b60409eb","sys_category",29,"items",,,,2,0,"tt_content",299,,,,,,
+,"60e6778effa62e4edb070c954d9643ff","sys_category",30,"items",,,,1,0,"tt_content",299,,,,,,
-- 
GitLab