Skip to content

Commit

Permalink
Add tmTextUnitVariantId in the leveraging message
Browse files Browse the repository at this point in the history
Previously, it was recording only the tmTextUnitVariantId. It was not explicit so one add to know which "id" it was. In addition, there was no way to search by that "tmTextUnitVariantId" in the workbench. As such it could be only used when looking at the database.

It now records the tmTextUnitId and tmTextUnitVariantId. Search by "tmTextUnitId" is possible in the current UI/workbench.

A good follow up, will be to be able to search by tmTextUnitVariantId in the workbench too.
  • Loading branch information
aurambaj committed Jul 18, 2023
1 parent 73fcee0 commit c075bb2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ private void addLeveragedTranslations(

private String getLeverageComment(TextUnitDTO translation, boolean uniqueTMTextUnitMatched) {
return getType()
+ " leveraging from: "
+ " - leveraging from tmTextUnitId: "
+ translation.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation.getTmTextUnitVariantId()
+ ", unique match: "
+ uniqueTMTextUnitMatched;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ public void testSourceLeveraging()
.get(0);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by name and content for source leveraging leveraging from: "
"by name and content for source leveraging - leveraging from tmTextUnitId: "
+ translationfrFR.getTmTextUnit().getId()
+ ", tmTextUnitVariantId: "
+ translationfrFR.getId()
+ ", unique match: true",
comment.getContent());
Expand All @@ -593,7 +595,9 @@ public void testSourceLeveraging()
.get(0);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by name and content for source leveraging leveraging from: "
"by name and content for source leveraging - leveraging from tmTextUnitId: "
+ translationjaJP.getTmTextUnit().getId()
+ ", tmTextUnitVariantId: "
+ translationjaJP.getId()
+ ", unique match: true",
comment.getContent());
Expand Down Expand Up @@ -641,7 +645,9 @@ public void testSourceLeveraging()
.get(1);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by name for source leveraging leveraging from: "
"by name for source leveraging - leveraging from tmTextUnitId: "
+ translation2frFR.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation2frFR.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand All @@ -667,7 +673,9 @@ public void testSourceLeveraging()
.get(1);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by name for source leveraging leveraging from: "
"by name for source leveraging - leveraging from tmTextUnitId: "
+ translation2jaJP.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation2jaJP.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand Down Expand Up @@ -720,7 +728,9 @@ public void testSourceLeveraging()
.get(2);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by content for source leveraging leveraging from: "
"by content for source leveraging - leveraging from tmTextUnitId: "
+ translation3frFR.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation3frFR.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand All @@ -742,7 +752,9 @@ public void testSourceLeveraging()
.get(2);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by content for source leveraging leveraging from: "
"by content for source leveraging - leveraging from tmTextUnitId: "
+ translation3jaJP.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation3jaJP.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand Down Expand Up @@ -805,7 +817,9 @@ public void testSourceLeveraging()
.get(3);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by name for source leveraging leveraging from: "
"by name for source leveraging - leveraging from tmTextUnitId: "
+ translation4frFR.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation4frFR.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand All @@ -827,7 +841,9 @@ public void testSourceLeveraging()
.get(3);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by name for source leveraging leveraging from: "
"by name for source leveraging - leveraging from tmTextUnitId: "
+ translation4jaJP.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation4jaJP.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand Down Expand Up @@ -856,7 +872,9 @@ public void testSourceLeveraging()
.get(3);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by content for source leveraging leveraging from: "
"by content for source leveraging - leveraging from tmTextUnitId: "
+ translation4frFR.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation4frFR.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand All @@ -875,7 +893,9 @@ public void testSourceLeveraging()
.get(3);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by content for source leveraging leveraging from: "
"by content for source leveraging - leveraging from tmTextUnitId: "
+ translation4jaJP.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation4jaJP.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand Down Expand Up @@ -904,7 +924,9 @@ public void testSourceLeveraging()
.get(3);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by content for source leveraging leveraging from: "
"by content for source leveraging - leveraging from tmTextUnitId: "
+ translation4frFR.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation4frFR.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand All @@ -923,7 +945,9 @@ public void testSourceLeveraging()
.get(3);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by content for source leveraging leveraging from: "
"by content for source leveraging - leveraging from tmTextUnitId: "
+ translation4jaJP.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation4jaJP.getTmTextUnitVariantId()
+ ", unique match: true",
comment.getContent());
Expand Down Expand Up @@ -973,7 +997,9 @@ public void testSourceLeveraging()
.get(4);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by content for source leveraging leveraging from: "
"by content for source leveraging - leveraging from tmTextUnitId: "
+ translation5frFRb.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation5frFRb.getTmTextUnitVariantId()
+ ", unique match: false",
comment.getContent());
Expand All @@ -992,7 +1018,9 @@ public void testSourceLeveraging()
.get(4);
assertEquals(TMTextUnitVariantComment.Type.LEVERAGING, comment.getType());
assertEquals(
"by content for source leveraging leveraging from: "
"by content for source leveraging - leveraging from tmTextUnitId: "
+ translation5jaJPb.getTmTextUnitId()
+ ", tmTextUnitVariantId: "
+ translation5jaJPb.getTmTextUnitVariantId()
+ ", unique match: false",
comment.getContent());
Expand Down

0 comments on commit c075bb2

Please sign in to comment.