From 333e3c592d216a65155ff180c77071d78be22259 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Fri, 15 Jun 2012 00:07:15 +0100 Subject: [PATCH] wrote strings for polls --- modules/poll.js | 8 ++++---- strings.json | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/modules/poll.js b/modules/poll.js index 13a65f7..7fa3c6c 100644 --- a/modules/poll.js +++ b/modules/poll.js @@ -10,7 +10,7 @@ var poll = function(dbot) { event.reply(dbot.t('newpoll_usage')); } else { if(polls.hasOwnProperty(name)) { - event.reply(dbot.t('poll_exists')); + event.reply(dbot.t('poll_exists', {'name': name})); } else { polls[name] = { 'name': name, @@ -24,7 +24,7 @@ var poll = function(dbot) { polls[name]['votes'][options[i]] = 0; } - event.reply(dbot.t('poll_created', {'name': name, 'options': options.join(' ')})); + event.reply(dbot.t('poll_created', {'name': name, 'description': description})); } } }, @@ -46,7 +46,7 @@ var poll = function(dbot) { } } } else { - event.reply(dbot.t('poll_unexistent')); + event.reply(dbot.t('poll_unexistent', {'name': name})); } }, @@ -55,7 +55,7 @@ var poll = function(dbot) { if(polls.hasOwnProperty(name)) { } else { - event.reply(dbot.t('poll_unexistent')); + event.reply(dbot.t('poll_unexistent', {'name': name})); } } }; diff --git a/strings.json b/strings.json index e624319..7be0fa8 100644 --- a/strings.json +++ b/strings.json @@ -195,5 +195,26 @@ }, "part": { "english": "Left {channel}" + }, + "newpoll_usage": { + "english": "Usage: ~newpoll name [options=opt1,opt2,opt3] description" + }, + "poll_exists": { + "english": "Poll '{name}' already exists." + }, + "poll_created": { + "english": "Poll '{name}' created ({description}). Cast thy votations!" + }, + "already_voted": { + "english": "You've already voted in this poll!" + }, + "voted": { + "english": "Voted for {vote}" + }, + "invalid_vote": { + "english": "Invalid vote: {vote}" + }, + "poll_unexistent": { + "english": "Poll '{name}' doesn't exist." } }