From 029c0cbe806701151e575dcd010d7e8faa3a13ae Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 17 Oct 2010 18:37:13 +0200 Subject: [PATCH] Internationalize Nickometer, Praise, Protector, Quote, and QuoteGrabs --- plugins/Nickometer/config.py | 4 +- plugins/Nickometer/messages.pot | 31 ++++++ plugins/Nickometer/plugin.py | 5 +- plugins/Praise/config.py | 8 +- plugins/Praise/messages.pot | 60 +++++++++++ plugins/Praise/plugin.py | 14 ++- plugins/Protector/config.py | 10 +- plugins/Protector/messages.pot | 31 ++++++ plugins/Protector/plugin.py | 2 + plugins/Quote/config.py | 4 +- plugins/Quote/messages.pot | 31 ++++++ plugins/Quote/plugin.py | 5 +- plugins/QuoteGrabs/config.py | 20 ++-- plugins/QuoteGrabs/messages.pot | 170 ++++++++++++++++++++++++++++++++ plugins/QuoteGrabs/plugin.py | 35 ++++--- 15 files changed, 392 insertions(+), 38 deletions(-) create mode 100644 plugins/Nickometer/messages.pot create mode 100644 plugins/Praise/messages.pot create mode 100644 plugins/Protector/messages.pot create mode 100644 plugins/Quote/messages.pot create mode 100644 plugins/QuoteGrabs/messages.pot diff --git a/plugins/Nickometer/config.py b/plugins/Nickometer/config.py index 27cc2568f..c8945d41f 100644 --- a/plugins/Nickometer/config.py +++ b/plugins/Nickometer/config.py @@ -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: diff --git a/plugins/Nickometer/messages.pot b/plugins/Nickometer/messages.pot new file mode 100644 index 000000000..fd8dfe20c --- /dev/null +++ b/plugins/Nickometer/messages.pot @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR , 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 \n" +"Language-Team: LANGUAGE \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 "" +"[]\n" +"\n" +" Tells you how lame said nick is. If 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 "" + diff --git a/plugins/Nickometer/plugin.py b/plugins/Nickometer/plugin.py index ec24737ff..b5bac6d2c 100644 --- a/plugins/Nickometer/plugin.py +++ b/plugins/Nickometer/plugin.py @@ -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): """[] @@ -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 ' diff --git a/plugins/Praise/config.py b/plugins/Praise/config.py index b16b5d842..fc5aadd62 100644 --- a/plugins/Praise/config.py +++ b/plugins/Praise/config.py @@ -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: diff --git a/plugins/Praise/messages.pot b/plugins/Praise/messages.pot new file mode 100644 index 000000000..81a2b8502 --- /dev/null +++ b/plugins/Praise/messages.pot @@ -0,0 +1,60 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR , 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 \n" +"Language-Team: LANGUAGE \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 \" to add new ones, making sure to include \"$who\" in 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 "" +"[] [] [for ]\n" +"\n" +" Praises (for , if given). If is given, uses\n" +" that specific praise. 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 "" + diff --git a/plugins/Praise/plugin.py b/plugins/Praise/plugin.py index dd6ad4171..2d912e8c5 100644 --- a/plugins/Praise/plugin.py +++ b/plugins/Praise/plugin.py @@ -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): """[] [] [for ] @@ -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) diff --git a/plugins/Protector/config.py b/plugins/Protector/config.py index 977bd0d7a..b4d10f417 100644 --- a/plugins/Protector/config.py +++ b/plugins/Protector/config.py @@ -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."""))) diff --git a/plugins/Protector/messages.pot b/plugins/Protector/messages.pot new file mode 100644 index 000000000..0bb646f0a --- /dev/null +++ b/plugins/Protector/messages.pot @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR , 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 \n" +"Language-Team: LANGUAGE \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 "" + diff --git a/plugins/Protector/plugin.py b/plugins/Protector/plugin.py index cae90feeb..b90e3c2de 100644 --- a/plugins/Protector/plugin.py +++ b/plugins/Protector/plugin.py @@ -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): diff --git a/plugins/Quote/config.py b/plugins/Quote/config.py index 39813e5d6..1d1a2cfeb 100644 --- a/plugins/Quote/config.py +++ b/plugins/Quote/config.py @@ -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: diff --git a/plugins/Quote/messages.pot b/plugins/Quote/messages.pot new file mode 100644 index 000000000..7d85fdf6e --- /dev/null +++ b/plugins/Quote/messages.pot @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR , 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 \n" +"Language-Team: LANGUAGE \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 "" +"[]\n" +"\n" +" Returns a random quote from . 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 "" + diff --git a/plugins/Quote/plugin.py b/plugins/Quote/plugin.py index c1f0d938a..c18bc750d 100644 --- a/plugins/Quote/plugin.py +++ b/plugins/Quote/plugin.py @@ -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): """[] @@ -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 diff --git a/plugins/QuoteGrabs/config.py b/plugins/QuoteGrabs/config.py index 27a8f7b0e..18219a8b3 100644 --- a/plugins/QuoteGrabs/config.py +++ b/plugins/QuoteGrabs/config.py @@ -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: diff --git a/plugins/QuoteGrabs/messages.pot b/plugins/QuoteGrabs/messages.pot new file mode 100644 index 000000000..9b365e4ee --- /dev/null +++ b/plugins/QuoteGrabs/messages.pot @@ -0,0 +1,170 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR , 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 \n" +"Language-Team: LANGUAGE \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 "" +"[] \n" +"\n" +" Grabs a quote from by for the quotegrabs table.\n" +" 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 "" +"[] \n" +"\n" +" Removes the grab (the last by default) on .\n" +" 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 "" +"[] \n" +"\n" +" Returns 's latest quote grab in . 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 "" +"[] \n" +"\n" +" Returns a list of shortened quotes that have been grabbed for \n" +" as well as the id of each quote. These ids can be used to get the\n" +" full quote. 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 "" +"[] []\n" +"\n" +" Returns a randomly grabbed quote, optionally choosing only from those\n" +" quotes grabbed for . 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 "" +"[] \n" +"\n" +" Return the quotegrab with the given . 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 "" +"[] \n" +"\n" +" Searches for in a quote. 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 "" + diff --git a/plugins/QuoteGrabs/plugin.py b/plugins/QuoteGrabs/plugin.py index 03d3a98d6..9e4f6f77f 100644 --- a/plugins/QuoteGrabs/plugin.py +++ b/plugins/QuoteGrabs/plugin.py @@ -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): """[] @@ -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): """[] @@ -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): """[] @@ -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): """[] @@ -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): """[] [] @@ -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): """[] @@ -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): """[] @@ -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'])