From dc962cbb175c0be5216147745b4612ef45f202c2 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 28 Sep 2021 08:34:53 -0400 Subject: [PATCH 1/3] Update localization directive to trim whitepsace around text content. --- client/src/components/plugins/localization.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/components/plugins/localization.js b/client/src/components/plugins/localization.js index b3468a10d7f..186e392c86e 100644 --- a/client/src/components/plugins/localization.js +++ b/client/src/components/plugins/localization.js @@ -8,11 +8,11 @@ const newlineMatch = /\r?\n|\r/g; const doublespaces = /\s\s+/g; const localizeDirective = { + // TODO consider using a different hook if we need dynamic updates in content translation bind(el, binding, vnode) { el.childNodes.forEach((node) => { - const oneline = node.textContent.replace(newlineMatch, " "); - const singleSpaces = oneline.replace(doublespaces, " "); - node.textContent = _l(singleSpaces); + const standardizedContent = node.textContent.replace(newlineMatch, " ").replace(doublespaces, " ").trim(); + node.textContent = _l(standardizedContent); }); }, }; From 01ce29c2cb74cbb497b051cc527e59f7049fe060 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 27 Oct 2021 09:21:51 -0400 Subject: [PATCH 2/3] Workflow editor tool upgrade fix -- don't rely on whitespace in localized blocks anymore (this is a good thing). --- client/src/components/Tool/ToolCard.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Tool/ToolCard.vue b/client/src/components/Tool/ToolCard.vue index fe675d9eab7..699571a9a9d 100644 --- a/client/src/components/Tool/ToolCard.vue +++ b/client/src/components/Tool/ToolCard.vue @@ -51,7 +51,7 @@ - Switch to {{ v }}Switch to {{ v }} Date: Wed, 27 Oct 2021 09:23:54 -0400 Subject: [PATCH 3/3] Trim one more localized string --- .../History/ContentItem/DatasetCollection/DscMenu.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/History/ContentItem/DatasetCollection/DscMenu.vue b/client/src/components/History/ContentItem/DatasetCollection/DscMenu.vue index 644e22e0332..7d314f5ef95 100644 --- a/client/src/components/History/ContentItem/DatasetCollection/DscMenu.vue +++ b/client/src/components/History/ContentItem/DatasetCollection/DscMenu.vue @@ -27,7 +27,7 @@ - Delete Collection Only + Delete Collection Only