From c0bee7c08ae2429e4a9ed2bc75679b012db6e3bd Mon Sep 17 00:00:00 2001 From: Ryan McCahan Date: Wed, 2 Oct 2024 03:17:49 -0600 Subject: [PATCH] Query widget number-verb number agreement (#1683) * Query widget number-verb agreement * Missing this, whoops --- src/Resources/queries/widget.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Resources/queries/widget.js b/src/Resources/queries/widget.js index 61b43a05..85e30e77 100644 --- a/src/Resources/queries/widget.js +++ b/src/Resources/queries/widget.js @@ -158,9 +158,9 @@ connections.add(statement.connection); } - const $text = $('').text(`${data.nb_statements} statements were executed`); + const $text = $('').text(`${data.nb_statements} ${data.nb_statements == 1 ? 'statement was' : 'statements were'} executed`); if (data.nb_excluded_statements) { - $text.append(`, ${data.nb_excluded_statements} have been excluded`); + $text.append(`, ${data.nb_excluded_statements} ${data.nb_excluded_statements == 1 ? 'has' : 'have'} been excluded`); } if (data.nb_failed_statements > 0 || this.duplicateQueries.size > 0) { const details = []; @@ -168,7 +168,7 @@ details.push(`${data.nb_failed_statements} failed`); } if (this.duplicateQueries.size > 0) { - details.push(`${this.duplicateQueries.size} duplicates`); + details.push(`${this.duplicateQueries.size} ${this.duplicateQueries.size == 1 ? 'duplicate' : 'duplicates'}`); } $text.append(` (${details.join(', ')})`); }