From 7128c5e0b5d1f5043de6252740b269615af42e7a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 14 Feb 2020 15:07:16 +0000 Subject: [PATCH] Bug 23888: (follow-up) Wrap English string in translation function Content-Type: text/plain; charset=utf-8 This patch makes alert added in subscription-add.js translatable using the new __() function. To test, apply the patch and confirm that the alert still works correctly when submitting the subscription edit form with an invalid vendor id. Test that the string can be translated (using fr-Fr for example): 1. cd misc/translator && ./translate update fr-FR 2. Translate strings in misc/tranlator/po/fr-FR-messages-js.po 3. cd misc/translator && ./translate install fr-FR Switch to the fr-FR translation and confirm the the alert shows your translated string. Signed-off-by: Marcel de Rooy Still seeing a false negative in qa tools: FAIL Untranslatable string found (The vendor does not exist) - See coding guideline JS5 --- koha-tmpl/intranet-tmpl/prog/js/subscription-add.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js index 79de60df37..ac656eacbd 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js +++ b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js @@ -1,4 +1,4 @@ -/* global _ irregularity more_than_one_serial subscriptionid tags interface theme mana_enabled MSG_FREQUENCY_LENGTH_ERROR MSG_BIBLIO_NOT_EXIST */ +/* global __ irregularity more_than_one_serial subscriptionid tags interface theme mana_enabled MSG_FREQUENCY_LENGTH_ERROR MSG_BIBLIO_NOT_EXIST */ var globalnumpatterndata; var globalfreqdata; @@ -55,7 +55,7 @@ function Check_page1() { } else { var bookseller_ids = BOOKSELLER_IDS; if ( $.inArray(Number(bookseller_id), bookseller_ids) == -1 ) { - alert ("The vendor does not exist"); + alert ( __("The vendor does not exist") ); return false; } } -- 2.11.0