From 9809872c6173ef29f858ec155241eddac82f9d93 Mon Sep 17 00:00:00 2001 From: Johan Date: Tue, 19 Feb 2013 17:02:38 +0100 Subject: [PATCH] Added pluralization to NextLevelConfirm --- src/js/views/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/views/index.js b/src/js/views/index.js index 65510732..fadee10e 100644 --- a/src/js/views/index.js +++ b/src/js/views/index.js @@ -426,11 +426,13 @@ var NextLevelConfirm = ConfirmCancelTerminal.extend({ initialize: function(options) { options = options || {}; var nextLevelName = (options.nextLevel) ? options.nextLevel.name : ''; + var pluralNumCommands = (options.numCommands == 1) ? '' : 's'; + var pluralBest = (options.best == 1) ? '' : 's'; var markdowns = [ '## Great Job!!', '', - 'You solved the level in **' + options.numCommands + '** command(s); ', + 'You solved the level in **' + options.numCommands + '** command' + pluralNumCommands + '; ', 'our solution uses ' + options.best + '. ' ]; @@ -440,7 +442,7 @@ var NextLevelConfirm = ConfirmCancelTerminal.extend({ ); } else { markdowns.push( - 'See if you can whittle it down to ' + options.best + ' command(s) :D ' + 'See if you can whittle it down to ' + options.best + ' command' + pluralBest + ' :D ' ); }