From fc411bc9e36f49649cd09299a090191a8321fe5e Mon Sep 17 00:00:00 2001 From: Derek P Sifford Date: Wed, 27 Dec 2017 13:18:33 -0500 Subject: [PATCH] add i18n for "Source" text in citations --- lib/fixtures.ts | 1 + lib/types/ABT.d.ts | 1 + src/js/utils/formatters/formatReferenceLinks.ts | 3 +-- src/php/i18n.php | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/fixtures.ts b/lib/fixtures.ts index 1132eb01..84abef08 100644 --- a/lib/fixtures.ts +++ b/lib/fixtures.ts @@ -206,6 +206,7 @@ export const state: ABT.Backend['state'] = { export const i18n: ABT.Backend['i18n'] = { misc: { footnotes: 'Footnotes', + source: 'Source', }, referenceList: { tooltips: { diff --git a/lib/types/ABT.d.ts b/lib/types/ABT.d.ts index 20df253c..69f0f79c 100644 --- a/lib/types/ABT.d.ts +++ b/lib/types/ABT.d.ts @@ -93,6 +93,7 @@ declare namespace ABT { fieldmaps: FieldMappings; misc: { footnotes: 'Footnotes'; + source: 'Source'; }; referenceList: { menu: { diff --git a/src/js/utils/formatters/formatReferenceLinks.ts b/src/js/utils/formatters/formatReferenceLinks.ts index 04b49b1b..25a25746 100644 --- a/src/js/utils/formatters/formatReferenceLinks.ts +++ b/src/js/utils/formatters/formatReferenceLinks.ts @@ -95,10 +95,9 @@ class LinkStyle { } case 'URL': default: { - // FIXME: i18n "Source" const sourceText = id.value.toLocaleLowerCase().endsWith('.pdf') ? 'PDF' - : 'Source'; + : top.ABT.i18n.misc.source; return oneLineTrim` ${html}${' '} diff --git a/src/php/i18n.php b/src/php/i18n.php index d5dff606..5c0e5728 100644 --- a/src/php/i18n.php +++ b/src/php/i18n.php @@ -20,6 +20,7 @@ function generate_translations() { $ABT_i18n->misc = [ 'footnotes' => __( 'Footnotes', 'academic-bloggers-toolkit' ), + 'source' => __( 'Source', 'academic-bloggers-toolkit' ), ]; $ABT_i18n->errors = [