From b5fdd1fd93ff9bd8e52fa8418c1e10417548d556 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 8 Oct 2022 08:27:29 +0200 Subject: add two new system messages for error messages --- Vote.php | 4 ++-- i18n/en.json | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Vote.php b/Vote.php index b27cb5b..ada160a 100644 --- a/Vote.php +++ b/Vote.php @@ -74,12 +74,12 @@ class VoteHooks { if (!$date) { $addErrorCategory(); - $voteText .= formatError("invalid date" . ':') . " $line\n"; + $voteText .= formatError($msg('vote-error-invalid-date') . ':') . " $line\n"; continue; } if (!in_array($vote, self::$options)) { $addErrorCategory(); - $voteText .= formatError("invalid vote (expected YES, NO or ABSTAIN)" . ':') . " $line\n"; + $voteText .= formatError($msg('vote-error-invalid-vote', '(YES, NO, ABSTAIN)') . ':') . " $line\n"; continue; } diff --git a/i18n/en.json b/i18n/en.json index 3be3c6f..e948cd7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -17,6 +17,8 @@ "vote-error-end": "Failed to parse end date (expected YYYY-MM-DD).", "vote-error-missing-newline": "Please add a line break before ", "vote-error-one-vote-per-page": "There can only be one active vote per page (and it has to be the first one).", + "vote-error-invalid-date": "invalid date", + "vote-error-invalid-vote": "invalid vote, expected one of $1", "vote-already-yes": "You already voted to approve.", "vote-already-no": "You already voted to oppose.", "vote-already-abstain": "You already chose to abstain.", -- cgit v1.2.3