mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Internationalize Nickometer, Praise, Protector, Quote, and QuoteGrabs
This commit is contained in:
parent
ffc609a299
commit
029c0cbe80
@ -30,6 +30,8 @@
|
||||
|
||||
import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Nickometer')
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by setup.py to configure this module. Advanced is
|
||||
@ -42,7 +44,7 @@ def configure(advanced):
|
||||
Nickometer = conf.registerPlugin('Nickometer')
|
||||
# This is where your configuration variables (if any) should go. For example:
|
||||
# conf.registerGlobalValue(Nickometer, 'someConfigVariableName',
|
||||
# registry.Boolean(False, """Help for someConfigVariableName."""))
|
||||
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
31
plugins/Nickometer/messages.pot
Normal file
31
plugins/Nickometer/messages.pot
Normal file
@ -0,0 +1,31 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR ORGANIZATION
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2010-10-17 18:28+CEST\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: ENCODING\n"
|
||||
"Generated-By: pygettext.py 1.5\n"
|
||||
|
||||
|
||||
#: plugin.py:84
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<nick>]\n"
|
||||
"\n"
|
||||
" Tells you how lame said nick is. If <nick> is not given, uses the\n"
|
||||
" nick of the person giving the command.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:226
|
||||
msgid "The \"lame nick-o-meter\" reading for \"%s\" is %s%%."
|
||||
msgstr ""
|
||||
|
@ -53,6 +53,8 @@ import string
|
||||
|
||||
import supybot.callbacks as callbacks
|
||||
from supybot.commands import wrap, additional
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Nickometer')
|
||||
|
||||
def slowExponent(x):
|
||||
return 1.3 * x * (1 - math.atan(x / 6.0) * 2 / math.pi)
|
||||
@ -77,6 +79,7 @@ class Nickometer(callbacks.Plugin):
|
||||
self.log.debug('%s lameness points awarded: %s', damage, reason)
|
||||
return damage
|
||||
|
||||
@internationalizeDocstring
|
||||
def nickometer(self, irc, msg, args, nick):
|
||||
"""[<nick>]
|
||||
|
||||
@ -220,7 +223,7 @@ class Nickometer(callbacks.Plugin):
|
||||
# if it's above 99.9%, show as many digits as is interesting
|
||||
score_string=re.sub('(99\\.9*\\d|\\.\\d).*','\\1',`percentage`)
|
||||
|
||||
irc.reply('The "lame nick-o-meter" reading for "%s" is %s%%.' %
|
||||
irc.reply(_('The "lame nick-o-meter" reading for "%s" is %s%%.') %
|
||||
(originalNick, score_string))
|
||||
|
||||
self.log.debug('Calculated lameness score for %s as %s '
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Praise')
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by supybot to configure this module. advanced is
|
||||
@ -42,10 +44,10 @@ def configure(advanced):
|
||||
Praise = conf.registerPlugin('Praise')
|
||||
# This is where your configuration variables (if any) should go. For example:
|
||||
# conf.registerGlobalValue(Praise, 'someConfigVariableName',
|
||||
# registry.Boolean(False, """Help for someConfigVariableName."""))
|
||||
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
|
||||
conf.registerChannelValue(Praise, 'showIds',
|
||||
registry.Boolean(False, """Determines whether the bot will show the ids of
|
||||
a praise when the praise is given."""))
|
||||
registry.Boolean(False, _("""Determines whether the bot will show the ids of
|
||||
a praise when the praise is given.""")))
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
60
plugins/Praise/messages.pot
Normal file
60
plugins/Praise/messages.pot
Normal file
@ -0,0 +1,60 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR ORGANIZATION
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2010-10-17 18:33+CEST\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: ENCODING\n"
|
||||
"Generated-By: pygettext.py 1.5\n"
|
||||
|
||||
|
||||
#: config.py:49
|
||||
msgid ""
|
||||
"Determines whether the bot will show the ids of\n"
|
||||
" a praise when the praise is given."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:40
|
||||
#, docstring
|
||||
msgid ""
|
||||
"Praise is a plugin for ... well, praising things. Feel free to add\n"
|
||||
" your own flavor to it by customizing what praises it gives. Use \"praise\n"
|
||||
" add <text>\" to add new ones, making sure to include \"$who\" in <text> where\n"
|
||||
" you want to insert the thing being praised.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:54
|
||||
msgid "Praises must contain $who."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:58
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<channel>] [<id>] <who|what> [for <reason>]\n"
|
||||
"\n"
|
||||
" Praises <who|what> (for <reason>, if given). If <id> is given, uses\n"
|
||||
" that specific praise. <channel> is only necessary if the message isn't\n"
|
||||
" sent in the channel itself.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:74
|
||||
msgid "There is no praise with id #%i."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:79
|
||||
msgid "There are no praises in my database for %s."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:87
|
||||
msgid " for "
|
||||
msgstr ""
|
||||
|
@ -32,7 +32,10 @@ import re
|
||||
from supybot.commands import *
|
||||
import supybot.plugins as plugins
|
||||
import supybot.ircutils as ircutils
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Praise')
|
||||
|
||||
@internationalizeDocstring
|
||||
class Praise(plugins.ChannelIdDatabasePlugin):
|
||||
"""Praise is a plugin for ... well, praising things. Feel free to add
|
||||
your own flavor to it by customizing what praises it gives. Use "praise
|
||||
@ -48,8 +51,9 @@ class Praise(plugins.ChannelIdDatabasePlugin):
|
||||
|
||||
def addValidator(self, irc, text):
|
||||
if '$who' not in text:
|
||||
irc.error('Praises must contain $who.', Raise=True)
|
||||
irc.error(_('Praises must contain $who.'), Raise=True)
|
||||
|
||||
@internationalizeDocstring
|
||||
def praise(self, irc, msg, args, channel, id, text):
|
||||
"""[<channel>] [<id>] <who|what> [for <reason>]
|
||||
|
||||
@ -67,20 +71,20 @@ class Praise(plugins.ChannelIdDatabasePlugin):
|
||||
try:
|
||||
praise = self.db.get(channel, id)
|
||||
except KeyError:
|
||||
irc.error(format('There is no praise with id #%i.', id))
|
||||
irc.error(format(_('There is no praise with id #%i.'), id))
|
||||
return
|
||||
else:
|
||||
praise = self.db.random(channel)
|
||||
if not praise:
|
||||
irc.error(format('There are no praises in my database ' \
|
||||
'for %s.', channel))
|
||||
irc.error(format(_('There are no praises in my database ' \
|
||||
'for %s.'), channel))
|
||||
return
|
||||
text = self._replaceFirstPerson(praise.text, msg.nick)
|
||||
reason = self._replaceFirstPerson(reason, msg.nick)
|
||||
target = self._replaceFirstPerson(target, msg.nick)
|
||||
text = text.replace('$who', target)
|
||||
if reason:
|
||||
text += ' for ' + reason
|
||||
text += _(' for ') + reason
|
||||
if self.registryValue('showIds', channel):
|
||||
text += format(' (#%i)', praise.id)
|
||||
irc.reply(text, action=True)
|
||||
|
@ -30,6 +30,8 @@
|
||||
import supybot.conf as conf
|
||||
import supybot.ircutils as ircutils
|
||||
import supybot.registry as registry
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Protector')
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by supybot to configure this module. advanced is
|
||||
@ -42,17 +44,17 @@ def configure(advanced):
|
||||
|
||||
Protector = conf.registerPlugin('Protector')
|
||||
conf.registerChannelValue(Protector, 'enable',
|
||||
registry.Boolean(True, """Determines whether this plugin is enabled in a
|
||||
given channel."""))
|
||||
registry.Boolean(True, _("""Determines whether this plugin is enabled in a
|
||||
given channel.""")))
|
||||
|
||||
class ImmuneNicks(conf.ValidNicks):
|
||||
List = ircutils.IrcSet
|
||||
|
||||
conf.registerChannelValue(Protector, 'immune',
|
||||
ImmuneNicks([], """Determines what nicks the bot will consider to
|
||||
ImmuneNicks([], _("""Determines what nicks the bot will consider to
|
||||
be immune from enforcement. These nicks will not even have their actions
|
||||
watched by this plugin. In general, only the ChanServ for this network
|
||||
will be in this list."""))
|
||||
will be in this list.""")))
|
||||
|
||||
|
||||
|
||||
|
31
plugins/Protector/messages.pot
Normal file
31
plugins/Protector/messages.pot
Normal file
@ -0,0 +1,31 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR ORGANIZATION
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2010-10-17 18:34+CEST\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: ENCODING\n"
|
||||
"Generated-By: pygettext.py 1.5\n"
|
||||
|
||||
|
||||
#: config.py:47
|
||||
msgid ""
|
||||
"Determines whether this plugin is enabled in a\n"
|
||||
" given channel."
|
||||
msgstr ""
|
||||
|
||||
#: config.py:54
|
||||
msgid ""
|
||||
"Determines what nicks the bot will consider to\n"
|
||||
" be immune from enforcement. These nicks will not even have their actions\n"
|
||||
" watched by this plugin. In general, only the ChanServ for this network\n"
|
||||
" will be in this list."
|
||||
msgstr ""
|
||||
|
@ -32,6 +32,8 @@ import supybot.ircdb as ircdb
|
||||
import supybot.ircmsgs as ircmsgs
|
||||
import supybot.ircutils as ircutils
|
||||
import supybot.callbacks as callbacks
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Protector')
|
||||
|
||||
class Protector(callbacks.Plugin):
|
||||
def isImmune(self, irc, msg):
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Quote')
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by supybot to configure this module. advanced is
|
||||
@ -42,7 +44,7 @@ def configure(advanced):
|
||||
Quote = conf.registerPlugin('Quote')
|
||||
# This is where your configuration variables (if any) should go. For example:
|
||||
# conf.registerGlobalValue(Quote, 'someConfigVariableName',
|
||||
# registry.Boolean(False, """Help for someConfigVariableName."""))
|
||||
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
31
plugins/Quote/messages.pot
Normal file
31
plugins/Quote/messages.pot
Normal file
@ -0,0 +1,31 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR ORGANIZATION
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2010-10-17 18:34+CEST\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: ENCODING\n"
|
||||
"Generated-By: pygettext.py 1.5\n"
|
||||
|
||||
|
||||
#: plugin.py:38
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<channel>]\n"
|
||||
"\n"
|
||||
" Returns a random quote from <channel>. <channel> is only necessary if\n"
|
||||
" the message isn't sent in the channel itself.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:47
|
||||
msgid "I have no quotes in my database for %s."
|
||||
msgstr ""
|
||||
|
@ -29,8 +29,11 @@
|
||||
|
||||
from supybot.commands import *
|
||||
import supybot.plugins as plugins
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('Quote')
|
||||
|
||||
class Quote(plugins.ChannelIdDatabasePlugin):
|
||||
@internationalizeDocstring
|
||||
def random(self, irc, msg, args, channel):
|
||||
"""[<channel>]
|
||||
|
||||
@ -41,7 +44,7 @@ class Quote(plugins.ChannelIdDatabasePlugin):
|
||||
if quote:
|
||||
irc.reply(self.showRecord(quote))
|
||||
else:
|
||||
irc.error('I have no quotes in my database for %s.' % channel)
|
||||
irc.error(_('I have no quotes in my database for %s.') % channel)
|
||||
random = wrap(random, ['channeldb'])
|
||||
|
||||
Class = Quote
|
||||
|
@ -29,6 +29,8 @@
|
||||
|
||||
import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('QuoteGrabs')
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by supybot to configure this module. advanced is
|
||||
@ -42,24 +44,24 @@ def configure(advanced):
|
||||
QuoteGrabs = conf.registerPlugin('QuoteGrabs')
|
||||
# This is where your configuration variables (if any) should go. For example:
|
||||
# conf.registerGlobalValue(QuoteGrabs, 'someConfigVariableName',
|
||||
# registry.Boolean(False, """Help for someConfigVariableName."""))
|
||||
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
|
||||
conf.registerChannelValue(conf.supybot.plugins.QuoteGrabs, 'randomGrabber',
|
||||
registry.Boolean(False, """Determines whether the bot will randomly grab
|
||||
registry.Boolean(False, _("""Determines whether the bot will randomly grab
|
||||
possibly-suitable quotes on occasion. The suitability of a given message
|
||||
is determined by ..."""))
|
||||
is determined by ...""")))
|
||||
conf.registerChannelValue(conf.supybot.plugins.QuoteGrabs.randomGrabber,
|
||||
'averageTimeBetweenGrabs',
|
||||
registry.PositiveInteger(864000, """Determines about how many seconds, on
|
||||
registry.PositiveInteger(864000, _("""Determines about how many seconds, on
|
||||
average, should elapse between random grabs. This is only an average
|
||||
value; grabs can happen from any time after half this time until never,
|
||||
although that's unlikely to occur."""))
|
||||
although that's unlikely to occur.""")))
|
||||
conf.registerChannelValue(conf.supybot.plugins.QuoteGrabs.randomGrabber,
|
||||
'minimumWords', registry.PositiveInteger(3, """Determines the minimum
|
||||
'minimumWords', registry.PositiveInteger(3, _("""Determines the minimum
|
||||
number of words in a message for it to be considered for random
|
||||
grabbing."""))
|
||||
grabbing.""")))
|
||||
conf.registerChannelValue(conf.supybot.plugins.QuoteGrabs.randomGrabber,
|
||||
'minimumCharacters', registry.PositiveInteger(8, """Determines the
|
||||
'minimumCharacters', registry.PositiveInteger(8, _("""Determines the
|
||||
minimum number of characters in a message for it to be considered for
|
||||
random grabbing."""))
|
||||
random grabbing.""")))
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
170
plugins/QuoteGrabs/messages.pot
Normal file
170
plugins/QuoteGrabs/messages.pot
Normal file
@ -0,0 +1,170 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR ORGANIZATION
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2010-10-17 18:36+CEST\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: ENCODING\n"
|
||||
"Generated-By: pygettext.py 1.5\n"
|
||||
|
||||
|
||||
#: config.py:49
|
||||
msgid ""
|
||||
"Determines whether the bot will randomly grab\n"
|
||||
" possibly-suitable quotes on occasion. The suitability of a given message\n"
|
||||
" is determined by ..."
|
||||
msgstr ""
|
||||
|
||||
#: config.py:54
|
||||
msgid ""
|
||||
"Determines about how many seconds, on\n"
|
||||
" average, should elapse between random grabs. This is only an average\n"
|
||||
" value; grabs can happen from any time after half this time until never,\n"
|
||||
" although that's unlikely to occur."
|
||||
msgstr ""
|
||||
|
||||
#: config.py:59
|
||||
msgid ""
|
||||
"Determines the minimum\n"
|
||||
" number of words in a message for it to be considered for random\n"
|
||||
" grabbing."
|
||||
msgstr ""
|
||||
|
||||
#: config.py:63
|
||||
msgid ""
|
||||
"Determines the\n"
|
||||
" minimum number of characters in a message for it to be considered for\n"
|
||||
" random grabbing."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:57
|
||||
msgid "%s (Said by: %s; grabbed by %s at %t)"
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:210
|
||||
#, docstring
|
||||
msgid "Add the help for \"@help QuoteGrabs\" here."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:249
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<channel>] <nick>\n"
|
||||
"\n"
|
||||
" Grabs a quote from <channel> by <nick> for the quotegrabs table.\n"
|
||||
" <channel> is only necessary if the message isn't sent in the channel\n"
|
||||
" itself.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:262
|
||||
msgid "You can't quote grab yourself."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:269
|
||||
msgid "I couldn't find a proper message to grab."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:274
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<channel>] <number>\n"
|
||||
"\n"
|
||||
" Removes the grab <number> (the last by default) on <channel>.\n"
|
||||
" <channel> is only necessary if the message isn't sent in the channel\n"
|
||||
" itself.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:285
|
||||
msgid "Nothing to ungrab."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:287
|
||||
msgid "Invalid grab number."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:292
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<channel>] <nick>\n"
|
||||
"\n"
|
||||
" Returns <nick>'s latest quote grab in <channel>. <channel> is only\n"
|
||||
" necessary if the message isn't sent in the channel itself.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:300
|
||||
msgid "I couldn't find a matching quotegrab for %s."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:306
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<channel>] <nick>\n"
|
||||
"\n"
|
||||
" Returns a list of shortened quotes that have been grabbed for <nick>\n"
|
||||
" as well as the id of each quote. These ids can be used to get the\n"
|
||||
" full quote. <channel> is only necessary if the message isn't sent in\n"
|
||||
" the channel itself.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:323
|
||||
msgid "I couldn't find any quotegrabs for %s."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:329
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<channel>] [<nick>]\n"
|
||||
"\n"
|
||||
" Returns a randomly grabbed quote, optionally choosing only from those\n"
|
||||
" quotes grabbed for <nick>. <channel> is only necessary if the message\n"
|
||||
" isn't sent in the channel itself.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:339
|
||||
msgid "Couldn't get a random quote for that nick."
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:341
|
||||
msgid "Couldn't get a random quote. Are there any grabbed quotes in the database?"
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:347
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<channel>] <id>\n"
|
||||
"\n"
|
||||
" Return the quotegrab with the given <id>. <channel> is only necessary\n"
|
||||
" if the message isn't sent in the channel itself.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:355
|
||||
msgid "No quotegrab for id %s"
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:361
|
||||
#, docstring
|
||||
msgid ""
|
||||
"[<channel>] <text>\n"
|
||||
"\n"
|
||||
" Searches for <text> in a quote. <channel> is only necessary if the\n"
|
||||
" message isn't sent in the channel itself.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#: plugin.py:376
|
||||
msgid "No quotegrabs matching %s"
|
||||
msgstr ""
|
||||
|
@ -40,6 +40,8 @@ import supybot.ircmsgs as ircmsgs
|
||||
import supybot.plugins as plugins
|
||||
import supybot.ircutils as ircutils
|
||||
import supybot.callbacks as callbacks
|
||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||
_ = PluginInternationalization('QuoteGrabs')
|
||||
|
||||
class QuoteGrabsRecord(dbi.Record):
|
||||
__fields__ = [
|
||||
@ -52,7 +54,7 @@ class QuoteGrabsRecord(dbi.Record):
|
||||
|
||||
def __str__(self):
|
||||
grabber = plugins.getUserName(self.grabber)
|
||||
return format('%s (Said by: %s; grabbed by %s at %t)',
|
||||
return format(_('%s (Said by: %s; grabbed by %s at %t)'),
|
||||
self.text, self.hostmask, grabber, self.at)
|
||||
|
||||
class SqliteQuoteGrabsDB(object):
|
||||
@ -242,6 +244,7 @@ class QuoteGrabs(callbacks.Plugin):
|
||||
s = 'jots down a new quote for %s' % msg.nick
|
||||
irc.reply(s, action=True, prefixNick=False)
|
||||
|
||||
@internationalizeDocstring
|
||||
def grab(self, irc, msg, args, channel, nick):
|
||||
"""[<channel>] <nick>
|
||||
|
||||
@ -256,16 +259,17 @@ class QuoteGrabs(callbacks.Plugin):
|
||||
if chan is None:
|
||||
raise callbacks.ArgumentError
|
||||
if ircutils.nickEqual(nick, msg.nick):
|
||||
irc.error('You can\'t quote grab yourself.', Raise=True)
|
||||
irc.error(_('You can\'t quote grab yourself.'), Raise=True)
|
||||
for m in reversed(irc.state.history):
|
||||
if m.command == 'PRIVMSG' and ircutils.nickEqual(m.nick, nick) \
|
||||
and ircutils.strEqual(m.args[0], chan):
|
||||
self._grab(channel, irc, m, msg.prefix)
|
||||
irc.replySuccess()
|
||||
return
|
||||
irc.error('I couldn\'t find a proper message to grab.')
|
||||
irc.error(_('I couldn\'t find a proper message to grab.'))
|
||||
grab = wrap(grab, ['channeldb', 'nick'])
|
||||
|
||||
@internationalizeDocstring
|
||||
def ungrab(self, irc, msg, args, channel, grab):
|
||||
"""[<channel>] <number>
|
||||
|
||||
@ -278,11 +282,12 @@ class QuoteGrabs(callbacks.Plugin):
|
||||
irc.replySuccess()
|
||||
except dbi.NoRecordError:
|
||||
if grab is None:
|
||||
irc.error('Nothing to ungrab.')
|
||||
irc.error(_('Nothing to ungrab.'))
|
||||
else:
|
||||
irc.error('Invalid grab number.')
|
||||
irc.error(_('Invalid grab number.'))
|
||||
ungrab = wrap(ungrab, ['channeldb', optional('id')])
|
||||
|
||||
@internationalizeDocstring
|
||||
def quote(self, irc, msg, args, channel, nick):
|
||||
"""[<channel>] <nick>
|
||||
|
||||
@ -292,10 +297,11 @@ class QuoteGrabs(callbacks.Plugin):
|
||||
try:
|
||||
irc.reply(self.db.getQuote(channel, nick))
|
||||
except dbi.NoRecordError:
|
||||
irc.error('I couldn\'t find a matching quotegrab for %s.' % nick,
|
||||
Raise=True)
|
||||
irc.error(_('I couldn\'t find a matching quotegrab for %s.') %
|
||||
nick, Raise=True)
|
||||
quote = wrap(quote, ['channeldb', 'nick'])
|
||||
|
||||
@internationalizeDocstring
|
||||
def list(self, irc, msg, args, channel, nick):
|
||||
"""[<channel>] <nick>
|
||||
|
||||
@ -314,10 +320,11 @@ class QuoteGrabs(callbacks.Plugin):
|
||||
L.append(item)
|
||||
irc.reply(utils.str.commaAndify(L))
|
||||
except dbi.NoRecordError:
|
||||
irc.error('I couldn\'t find any quotegrabs for %s.' % nick,
|
||||
irc.error(_('I couldn\'t find any quotegrabs for %s.') % nick,
|
||||
Raise=True)
|
||||
list = wrap(list, ['channeldb', 'nick'])
|
||||
|
||||
@internationalizeDocstring
|
||||
def random(self, irc, msg, args, channel, nick):
|
||||
"""[<channel>] [<nick>]
|
||||
|
||||
@ -329,12 +336,13 @@ class QuoteGrabs(callbacks.Plugin):
|
||||
irc.reply(self.db.random(channel, nick))
|
||||
except dbi.NoRecordError:
|
||||
if nick:
|
||||
irc.error('Couldn\'t get a random quote for that nick.')
|
||||
irc.error(_('Couldn\'t get a random quote for that nick.'))
|
||||
else:
|
||||
irc.error('Couldn\'t get a random quote. Are there any '
|
||||
'grabbed quotes in the database?')
|
||||
irc.error(_('Couldn\'t get a random quote. Are there any '
|
||||
'grabbed quotes in the database?'))
|
||||
random = wrap(random, ['channeldb', additional('nick')])
|
||||
|
||||
@internationalizeDocstring
|
||||
def get(self, irc, msg, args, channel, id):
|
||||
"""[<channel>] <id>
|
||||
|
||||
@ -344,10 +352,11 @@ class QuoteGrabs(callbacks.Plugin):
|
||||
try:
|
||||
irc.reply(self.db.get(channel, id))
|
||||
except dbi.NoRecordError:
|
||||
irc.error('No quotegrab for id %s' % utils.str.quoted(id),
|
||||
irc.error(_('No quotegrab for id %s') % utils.str.quoted(id),
|
||||
Raise=True)
|
||||
get = wrap(get, ['channeldb', 'id'])
|
||||
|
||||
@internationalizeDocstring
|
||||
def search(self, irc, msg, args, channel, text):
|
||||
"""[<channel>] <text>
|
||||
|
||||
@ -364,7 +373,7 @@ class QuoteGrabs(callbacks.Plugin):
|
||||
L.append(item)
|
||||
irc.reply(utils.str.commaAndify(L))
|
||||
except dbi.NoRecordError:
|
||||
irc.error('No quotegrabs matching %s' % utils.str.quoted(text),
|
||||
irc.error(_('No quotegrabs matching %s') % utils.str.quoted(text),
|
||||
Raise=True)
|
||||
search = wrap(search, ['channeldb', 'text'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user