From 11af49619a00f9c5da18ee0f06372d0c273c6b80 Mon Sep 17 00:00:00 2001 From: Julian Gonggrijp Date: Fri, 29 Apr 2022 02:30:59 +0200 Subject: [PATCH] Place variable interpolations inside i18n strings where appropriate (#451) --- frontend/src/i18n/en/translation.json | 8 ++++---- frontend/src/i18n/fr/translation.json | 8 ++++---- .../panel-annotation/annotation-template.hbs | 19 +++++++++++++------ .../external-resources-template.hbs | 2 +- .../related-items-template.hbs | 2 +- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/frontend/src/i18n/en/translation.json b/frontend/src/i18n/en/translation.json index 5e2aca3e..df7d58b2 100644 --- a/frontend/src/i18n/en/translation.json +++ b/frontend/src/i18n/en/translation.json @@ -97,9 +97,9 @@ "preferred-label-choice": "Choose a preferred label before saving.", "save": "Save", "delete": "Delete", - "annotation": "Annotation", - "identified-as": "identified as", - "item": "item", + "annotation-serial-identified": "Annotation {{annotationSerial}}, identified as item {{itemSerial}}", + "annotation-serial-tag-only": "Annotation {{annotationSerial}}", + "item-serial": "Item {{itemSerial}}", "annotation-verification": "This annotation needs to be verified.", "item-properties": "Item properties", "related-items-title": "Related items", @@ -112,7 +112,7 @@ "new": "New", "annotation-metadata": "Annotation metadata", "edit-external-resources": "Edit external resources", - "for-item": "For item", + "for-item-serial": "For item/{{itemSerial}}", "edit-related-items": "Edit related items", "no-details": "No further details", "search-results": "Search Results", diff --git a/frontend/src/i18n/fr/translation.json b/frontend/src/i18n/fr/translation.json index 18475ece..fca2e54b 100644 --- a/frontend/src/i18n/fr/translation.json +++ b/frontend/src/i18n/fr/translation.json @@ -97,9 +97,9 @@ "preferred-label-choice": "Choose a preferred label before saving.", "save": "Save", "delete": "Delete", - "annotation": "Annotation", - "identified-as": "identified as", - "item": "item", + "annotation-serial-identified": "Annotation {{annotationSerial}}, identified as item {{itemSerial}}", + "annotation-serial-tag-only": "Annotation {{annotationSerial}}", + "item-serial": "Item {{itemSerial}}", "annotation-verification": "This annotation needs to be verified.", "item-properties": "Item properties", "related-items-title": "Related items", @@ -112,7 +112,7 @@ "new": "New", "annotation-metadata": "Annotation metadata", "edit-external-resources": "Edit external resources", - "for-item": "For item", + "for-item-serial": "For item/{{itemSerial}}", "edit-related-items": "Edit related items", "no-details": "No further details", "search-results": "Search Results", diff --git a/frontend/src/panel-annotation/annotation-template.hbs b/frontend/src/panel-annotation/annotation-template.hbs index cc356d1f..292b7fd7 100644 --- a/frontend/src/panel-annotation/annotation-template.hbs +++ b/frontend/src/panel-annotation/annotation-template.hbs @@ -2,12 +2,19 @@

{{label}}

-
{{#if annotationSerial }} - {{#i18n 'annotation'}}Annotation{{/i18n}} {{ annotationSerial }}{{#if itemSerial}}, - {{#i18n 'identified-as'}}identified as{{/i18n}} - {{/if}}{{/if}}{{#if itemSerial }} - {{#i18n 'item'}}item{{/i18n}}/{{ itemSerial }} - {{/if}}
+
+ {{#if annotationSerial }} + {{#if itemSerial}} + {{#i18n 'annotation-serial-identified'}}Annotation {{annotationSerial}}, identified as item {{itemSerial}}{{/i18n}} + {{else}} + {{#i18n 'annotation-serial-tag-only'}}Annotation {{annotationSerial}}{{/i18n}} + {{/if}} + {{else}} + {{#if itemSerial}} + {{#i18n 'item-serial'}}Item {{itemSerial}}{{/i18n}} + {{/if}} + {{/if}} +
{{#if needsVerification}}
{{#i18n 'annotation-verification'}}This annotation needs to be verified.{{/i18n}} diff --git a/frontend/src/panel-external-resources/external-resources-template.hbs b/frontend/src/panel-external-resources/external-resources-template.hbs index 54e054a5..c5d1b102 100644 --- a/frontend/src/panel-external-resources/external-resources-template.hbs +++ b/frontend/src/panel-external-resources/external-resources-template.hbs @@ -1,7 +1,7 @@

{{#i18n 'external-resources-title'}}External resources{{/i18n}}

-
{{#i18n 'for-item'}}For item{{/i18n}}/{{ itemSerial }}
+
{{#i18n 'for-item-serial'}}For item/{{itemSerial}}{{/i18n}}
diff --git a/frontend/src/panel-related-items/related-items-template.hbs b/frontend/src/panel-related-items/related-items-template.hbs index 66b808fb..568b867f 100644 --- a/frontend/src/panel-related-items/related-items-template.hbs +++ b/frontend/src/panel-related-items/related-items-template.hbs @@ -1,7 +1,7 @@

{{#i18n 'related-items-title'}}Related items{{/i18n}}

-
{{#i18n 'for-item'}}For item{{/i18n}}/{{ itemSerial }}
+
{{#i18n 'for-item-serial'}}For item/{{itemSerial}}{{/i18n}}