diff --git a/plugins/Channel/config.py b/plugins/Channel/config.py index 023073dde..2e6217435 100644 --- a/plugins/Channel/config.py +++ b/plugins/Channel/config.py @@ -32,6 +32,8 @@ import supybot.conf as conf import supybot.utils as utils import supybot.registry as registry +from supybot.i18n import PluginInternationalization, internationalizeDocstring +_ = PluginInternationalization('Channel') def configure(advanced): # This will be called by supybot to configure this module. advanced is @@ -43,8 +45,8 @@ def configure(advanced): Channel = conf.registerPlugin('Channel') conf.registerChannelValue(Channel, 'alwaysRejoin', - registry.Boolean(True, """Determines whether the bot will always try to - rejoin a channel whenever it's kicked from the channel.""")) + registry.Boolean(True, _("""Determines whether the bot will always try to + rejoin a channel whenever it's kicked from the channel."""))) # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/plugins/Channel/messages.pot b/plugins/Channel/messages.pot new file mode 100644 index 000000000..4e73c5e42 --- /dev/null +++ b/plugins/Channel/messages.pot @@ -0,0 +1,621 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2010-10-16 10:17+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:48 +msgid "" +"Determines whether the bot will always try to\n" +" rejoin a channel whenever it's kicked from the channel." +msgstr "" + +#: plugin.py:69 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" Sets the mode in to , sending the arguments given.\n" +" is only necessary if the message isn't sent in the channel\n" +" itself.\n" +" " +msgstr "" + +#: plugin.py:76 +msgid "change the mode" +msgstr "" + +#: plugin.py:80 +#, docstring +msgid "" +"[] []\n" +"\n" +" Sets the channel limit to . If is 0, or isn't given,\n" +" removes the channel limit. is only necessary if the message\n" +" isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:90 +msgid "change the limit" +msgstr "" + +#: plugin.py:95 +#, docstring +msgid "" +"[]\n" +"\n" +" Sets +m on , making it so only ops and voiced users can\n" +" send messages to the channel. is only necessary if the\n" +" message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:102 +msgid "moderate the channel" +msgstr "" + +#: plugin.py:106 +#, docstring +msgid "" +"[]\n" +"\n" +" Sets -m on , making it so everyone can\n" +" send messages to the channel. is only necessary if the\n" +" message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:114 +msgid "unmoderate the channel" +msgstr "" + +#: plugin.py:118 +#, docstring +msgid "" +"[] []\n" +"\n" +" Sets the keyword in to . If is not given, removes\n" +" the keyword requirement to join . is only necessary\n" +" if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:130 +msgid "change the keyword" +msgstr "" + +#: plugin.py:135 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,op capability, this will give all the s\n" +" you provide ops. If you don't provide any s, this will op you.\n" +" is only necessary if the message isn't sent in the channel\n" +" itself.\n" +" " +msgstr "" + +#: plugin.py:147 +msgid "op someone" +msgstr "" + +#: plugin.py:151 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,halfop capability, this will give all the\n" +" s you provide halfops. If you don't provide any s, this\n" +" will give you halfops. is only necessary if the message isn't\n" +" sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:163 +msgid "halfop someone" +msgstr "" + +#: plugin.py:168 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,voice capability, this will voice all the\n" +" s you provide. If you don't provide any s, this will\n" +" voice you. is only necessary if the message isn't sent in the\n" +" channel itself.\n" +" " +msgstr "" + +#: plugin.py:190 +msgid "voice someone" +msgstr "" + +#: plugin.py:195 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,op capability, this will remove operator\n" +" privileges from all the nicks given. If no nicks are given, removes\n" +" operator privileges from the person sending the message.\n" +" " +msgstr "" + +#: plugin.py:202 +msgid "I cowardly refuse to deop myself. If you really want me deopped, tell me to op you and then deop me yourself." +msgstr "" + +#: plugin.py:210 +msgid "deop someone" +msgstr "" + +#: plugin.py:215 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,op capability, this will remove half-operator\n" +" privileges from all the nicks given. If no nicks are given, removes\n" +" half-operator privileges from the person sending the message.\n" +" " +msgstr "" + +#: plugin.py:222 +msgid "I cowardly refuse to dehalfop myself. If you really want me dehalfopped, tell me to op you and then dehalfop me yourself." +msgstr "" + +#: plugin.py:230 +msgid "dehalfop someone" +msgstr "" + +#: plugin.py:235 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,op capability, this will remove voice from all\n" +" the nicks given. If no nicks are given, removes voice from the person\n" +" sending the message.\n" +" " +msgstr "" + +#: plugin.py:242 +msgid "I cowardly refuse to devoice myself. If you really want me devoiced, tell me to op you and then devoice me yourself." +msgstr "" + +#: plugin.py:255 +#, docstring +msgid "" +"[]\n" +"\n" +" If you have the #channel,op capability, this will cause the bot to\n" +" \"cycle\", or PART and then JOIN the channel. is only necessary\n" +" if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:268 +#, docstring +msgid "" +"[] [, , ...] []\n" +"\n" +" Kicks (s) from for . If isn't given,\n" +" uses the nick of the person making the command as the reason.\n" +" is only necessary if the message isn't sent in the channel\n" +" itself.\n" +" " +msgstr "" + +#: plugin.py:276 +msgid "I cowardly refuse to kick myself." +msgstr "" + +#: plugin.py:281 +msgid "The reason you gave is longer than the allowed length for a KICK reason on this server." +msgstr "" + +#: plugin.py:286 +msgid "kick someone" +msgstr "" + +#: plugin.py:292 +#, docstring +msgid "" +"[] [--{exact,nick,user,host}] [] []\n" +"\n" +" If you have the #channel,op capability, this will kickban for\n" +" as many seconds as you specify, or else (if you specify 0 seconds or\n" +" don't specify a number of seconds) it will ban the person indefinitely.\n" +" --exact bans only the exact hostmask; --nick bans just the nick;\n" +" --user bans just the user, and --host bans just the host. You can\n" +" combine these options as you choose. is a reason to give for\n" +" the kick.\n" +" is only necessary if the message isn't sent in the channel\n" +" itself.\n" +" " +msgstr "" + +#: plugin.py:311 +msgid "I cowardly refuse to kickban myself." +msgstr "" + +#: plugin.py:318 +msgid "I haven't seen %s." +msgstr "" + +#: plugin.py:326 +msgid "I cowardly refuse to ban myself." +msgstr "" + +#: plugin.py:352 +msgid "%s has %s too, you can't ban him/her/it." +msgstr "" + +#: plugin.py:364 +msgid "kick or ban someone" +msgstr "" + +#: plugin.py:371 +#, docstring +msgid "" +"[] []\n" +"\n" +" Unbans on . If is not given, unbans\n" +" any hostmask currently banned on that matches your current\n" +" hostmask. Especially useful for unbanning yourself when you get\n" +" unexpectedly (or accidentally) banned from the channel. is\n" +" only necessary if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:388 +msgid "All bans on %s matching %s have been removed." +msgstr "" + +#: plugin.py:392 +msgid "No bans matching %s were found on %s." +msgstr "" + +#: plugin.py:395 +msgid "unban someone" +msgstr "" + +#: plugin.py:400 +#, docstring +msgid "" +"[] \n" +"\n" +" If you have the #channel,op capability, this will invite \n" +" to join . is only necessary if the message isn't\n" +" sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:409 +msgid "haveOp" +msgstr "" + +#: plugin.py:409 +msgid "invite someone" +msgstr "" + +#: plugin.py:428 +msgid "%s is already in %s." +msgstr "" + +#: plugin.py:435 +msgid "There is no %s on this network." +msgstr "" + +#: plugin.py:447 +#, docstring +msgid "" +"[]\n" +"\n" +" If you have the #channel,op capability, this will \"lobotomize\" the\n" +" bot, making it silent and unanswering to all requests made in the\n" +" channel. is only necessary if the message isn't sent in\n" +" the channel itself.\n" +" " +msgstr "" + +#: plugin.py:462 +#, docstring +msgid "" +"[]\n" +"\n" +" If you have the #channel,op capability, this will unlobotomize the\n" +" bot, making it respond to requests made in the channel again.\n" +" is only necessary if the message isn't sent in the channel\n" +" itself.\n" +" " +msgstr "" + +#: plugin.py:477 +#, docstring +msgid "" +"takes no arguments\n" +"\n" +" Returns the channels in which this bot is lobotomized.\n" +" " +msgstr "" + +#: plugin.py:492 +msgid "I'm currently lobotomized in %L." +msgstr "" + +#: plugin.py:495 +msgid "I'm not currently lobotomized in any channels that you're in." +msgstr "" + +#: plugin.py:502 +#, docstring +msgid "" +"[] []\n" +"\n" +" If you have the #channel,op capability, this will effect a\n" +" persistent ban from interacting with the bot on the given\n" +" (or the current hostmask associated with . Other\n" +" plugins may enforce this ban by actually banning users with\n" +" matching hostmasks when they join. is an optional\n" +" argument specifying when (in \"seconds from now\") the ban should\n" +" expire; if none is given, the ban will never automatically expire.\n" +" is only necessary if the message isn't sent in the\n" +" channel itself.\n" +" " +msgstr "" + +#: plugin.py:522 +#, docstring +msgid "" +"[] \n" +"\n" +" If you have the #channel,op capability, this will remove the\n" +" persistent ban on . is only necessary if the\n" +" message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:534 +msgid "There are no persistent bans for that hostmask." +msgstr "" + +#: plugin.py:539 +#, docstring +msgid "" +"[]\n" +"\n" +" If you have the #channel,op capability, this will show you the\n" +" current persistent bans on #channel.\n" +" " +msgstr "" + +#: plugin.py:549 +msgid "%q (expires %t)" +msgstr "" + +#: plugin.py:552 +msgid "%q (never expires)" +msgstr "" + +#: plugin.py:556 +msgid "There are no persistent bans on %s." +msgstr "" + +#: plugin.py:563 +#, docstring +msgid "" +"[] []\n" +"\n" +" If you have the #channel,op capability, this will set a persistent\n" +" ignore on or the hostmask currently\n" +" associated with . is an optional argument\n" +" specifying when (in \"seconds from now\") the ignore will expire; if\n" +" it isn't given, the ignore will never automatically expire.\n" +" is only necessary if the message isn't sent in the\n" +" channel itself.\n" +" " +msgstr "" + +#: plugin.py:581 +#, docstring +msgid "" +"[] \n" +"\n" +" If you have the #channel,op capability, this will remove the\n" +" persistent ignore on in the channel. is only\n" +" necessary if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:593 +msgid "There are no ignores for that hostmask." +msgstr "" + +#: plugin.py:598 +#, docstring +msgid "" +"[]\n" +"\n" +" Lists the hostmasks that the bot is ignoring on the given channel.\n" +" is only necessary if the message isn't sent in the\n" +" channel itself.\n" +" " +msgstr "" + +#: plugin.py:607 +msgid "I'm not currently ignoring any hostmasks in %q" +msgstr "" + +#: plugin.py:618 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,op capability, this will give the user\n" +" (or the user to whom maps)\n" +" the capability in the channel. is only\n" +" necessary if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:634 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,op capability, this will take from the\n" +" user currently identified as (or the user to whom \n" +" maps) the capability in the channel. is only\n" +" necessary if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:653 +msgid "That user didn't have the %L %s." +msgstr "" + +#: plugin.py:662 +#, docstring +msgid "" +"[] {True|False}\n" +"\n" +" If you have the #channel,op capability, this will set the default\n" +" response to non-power-related (that is, not {op, halfop, voice}\n" +" capabilities to be the value you give. is only necessary\n" +" if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:680 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,op capability, this will add the channel\n" +" capability for all users in the channel. is\n" +" only necessary if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:695 +#, docstring +msgid "" +"[] [ ...]\n" +"\n" +" If you have the #channel,op capability, this will unset the channel\n" +" capability so each user's specific capability or the\n" +" channel default capability will take precedence. is only\n" +" necessary if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:711 +msgid "capability" +msgstr "" + +#: plugin.py:714 +msgid "I do not know about the %L %s." +msgstr "" + +#: plugin.py:721 +#, docstring +msgid "" +"[]\n" +"\n" +" Returns the capabilities present on the . is\n" +" only necessary if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:733 +#, docstring +msgid "" +"[] [] []\n" +"\n" +" If you have the #channel,op capability, this will disable the \n" +" in . If is provided, will be disabled only\n" +" for that plugin. If only is provided, all commands in the\n" +" given plugin will be disabled. is only necessary if the\n" +" message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:749 plugin.py:788 +msgid "The %s plugin does not have a command called %s." +msgstr "" + +#: plugin.py:756 plugin.py:795 +msgid "No plugin or command named %s could be found." +msgstr "" + +#: plugin.py:772 +#, docstring +msgid "" +"[] [] []\n" +"\n" +" If you have the #channel,op capability, this will enable the \n" +" in if it has been disabled. If is provided,\n" +" will be enabled only for that plugin. If only is\n" +" provided, all commands in the given plugin will be enabled. \n" +" is only necessary if the message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:809 +msgid "%s was not disabled." +msgstr "" + +#: plugin.py:818 +#, docstring +msgid "" +"[]\n" +"\n" +" Returns the nicks in . is only necessary if the\n" +" message isn't sent in the channel itself.\n" +" " +msgstr "" + +#: plugin.py:829 +msgid "You don't have access to that information." +msgstr "" + +#: plugin.py:837 +#, docstring +msgid "" +"Internal message for notifying all the #channel,ops in a channel of\n" +" a given situation." +msgstr "" + +#: plugin.py:840 +msgid "Alert to all %s ops: %s" +msgstr "" + +#: plugin.py:842 +msgid " (from %s)" +msgstr "" + +#: plugin.py:850 +#, docstring +msgid "" +"[] \n" +"\n" +" Sends to all the users in who have the ,op\n" +" capability.\n" +" " +msgstr "" + diff --git a/plugins/Channel/plugin.py b/plugins/Channel/plugin.py index de12e91cc..9e65004f6 100644 --- a/plugins/Channel/plugin.py +++ b/plugins/Channel/plugin.py @@ -38,6 +38,8 @@ import supybot.ircmsgs as ircmsgs import supybot.schedule as schedule import supybot.ircutils as ircutils import supybot.callbacks as callbacks +from supybot.i18n import PluginInternationalization, internationalizeDocstring +_ = PluginInternationalization('Channel') class Channel(callbacks.Plugin): def __init__(self, irc): @@ -62,6 +64,7 @@ class Channel(callbacks.Plugin): irc.queueMsg(f(nicks[i:i + numModes])) irc.noReply() + @internationalizeDocstring def mode(self, irc, msg, args, channel, modes): """[] [ ...] @@ -70,8 +73,9 @@ class Channel(callbacks.Plugin): itself. """ self._sendMsg(irc, ircmsgs.mode(channel, modes)) - mode = wrap(mode, ['op', ('haveOp', 'change the mode'), many('something')]) + mode = wrap(mode, ['op', ('haveOp', _('change the mode')), many('something')]) + @internationalizeDocstring def limit(self, irc, msg, args, channel, limit): """[] [] @@ -83,9 +87,10 @@ class Channel(callbacks.Plugin): self._sendMsg(irc, ircmsgs.mode(channel, ['+l', limit])) else: self._sendMsg(irc, ircmsgs.mode(channel, ['-l'])) - limit = wrap(limit, ['op', ('haveOp', 'change the limit'), + limit = wrap(limit, ['op', ('haveOp', _('change the limit')), additional('nonNegativeInt', 0)]) + @internationalizeDocstring def moderate(self, irc, msg, args, channel): """[] @@ -94,8 +99,9 @@ class Channel(callbacks.Plugin): message isn't sent in the channel itself. """ self._sendMsg(irc, ircmsgs.mode(channel, ['+m'])) - moderate = wrap(moderate, ['op', ('haveOp', 'moderate the channel')]) + moderate = wrap(moderate, ['op', ('haveOp', _('moderate the channel'))]) + @internationalizeDocstring def unmoderate(self, irc, msg, args, channel): """[] @@ -104,8 +110,10 @@ class Channel(callbacks.Plugin): message isn't sent in the channel itself. """ self._sendMsg(irc, ircmsgs.mode(channel, ['-m'])) - unmoderate = wrap(unmoderate, ['op', ('haveOp', 'unmoderate the channel')]) + unmoderate = wrap(unmoderate, ['op', ('haveOp', + _('unmoderate the channel'))]) + @internationalizeDocstring def key(self, irc, msg, args, channel, key): """[] [] @@ -119,9 +127,10 @@ class Channel(callbacks.Plugin): self._sendMsg(irc, ircmsgs.mode(channel, ['+k', key])) else: self._sendMsg(irc, ircmsgs.mode(channel, ['-k'])) - key = wrap(key, ['op', ('haveOp', 'change the keyword'), + key = wrap(key, ['op', ('haveOp', _('change the keyword')), additional('somethingWithoutSpaces', '')]) + @internationalizeDocstring def op(self, irc, msg, args, channel, nicks): """[] [ ...] @@ -135,8 +144,9 @@ class Channel(callbacks.Plugin): def f(L): return ircmsgs.ops(channel, L) self._sendMsgs(irc, nicks, f) - op = wrap(op, ['op', ('haveOp', 'op someone'), any('nickInChannel')]) + op = wrap(op, ['op', ('haveOp', _('op someone')), any('nickInChannel')]) + @internationalizeDocstring def halfop(self, irc, msg, args, channel, nicks): """[] [ ...] @@ -150,9 +160,10 @@ class Channel(callbacks.Plugin): def f(L): return ircmsgs.halfops(channel, L) self._sendMsgs(irc, nicks, f) - halfop = wrap(halfop, ['halfop', ('haveOp', 'halfop someone'), + halfop = wrap(halfop, ['halfop', ('haveOp', _('halfop someone')), any('nickInChannel')]) + @internationalizeDocstring def voice(self, irc, msg, args, channel, nicks): """[] [ ...] @@ -176,9 +187,10 @@ class Channel(callbacks.Plugin): self._sendMsgs(irc, nicks, f) else: irc.errorNoCapability(capability) - voice = wrap(voice, ['channel', ('haveOp', 'voice someone'), + voice = wrap(voice, ['channel', ('haveOp', _('voice someone')), any('nickInChannel')]) + @internationalizeDocstring def deop(self, irc, msg, args, channel, nicks): """[] [ ...] @@ -187,17 +199,18 @@ class Channel(callbacks.Plugin): operator privileges from the person sending the message. """ if irc.nick in nicks: - irc.error('I cowardly refuse to deop myself. If you really want ' - 'me deopped, tell me to op you and then deop me ' - 'yourself.', Raise=True) + irc.error(_('I cowardly refuse to deop myself. If you really ' + 'want me deopped, tell me to op you and then deop me ' + 'yourself.'), Raise=True) if not nicks: nicks = [msg.nick] def f(L): return ircmsgs.deops(channel, L) self._sendMsgs(irc, nicks, f) - deop = wrap(deop, ['op', ('haveOp', 'deop someone'), + deop = wrap(deop, ['op', ('haveOp', _('deop someone')), any('nickInChannel')]) + @internationalizeDocstring def dehalfop(self, irc, msg, args, channel, nicks): """[] [ ...] @@ -206,17 +219,18 @@ class Channel(callbacks.Plugin): half-operator privileges from the person sending the message. """ if irc.nick in nicks: - irc.error('I cowardly refuse to dehalfop myself. If you really ' + irc.error(_('I cowardly refuse to dehalfop myself. If you really ' 'want me dehalfopped, tell me to op you and then ' - 'dehalfop me yourself.', Raise=True) + 'dehalfop me yourself.'), Raise=True) if not nicks: nicks = [msg.nick] def f(L): return ircmsgs.dehalfops(channel, L) self._sendMsgs(irc, nicks, f) - dehalfop = wrap(dehalfop, ['halfop', ('haveOp', 'dehalfop someone'), + dehalfop = wrap(dehalfop, ['halfop', ('haveOp', _('dehalfop someone')), any('nickInChannel')]) + @internationalizeDocstring def devoice(self, irc, msg, args, channel, nicks): """[] [ ...] @@ -225,9 +239,9 @@ class Channel(callbacks.Plugin): sending the message. """ if irc.nick in nicks: - irc.error('I cowardly refuse to devoice myself. If you really ' + irc.error(_('I cowardly refuse to devoice myself. If you really ' 'want me devoiced, tell me to op you and then devoice ' - 'me yourself.', Raise=True) + 'me yourself.'), Raise=True) if not nicks: nicks = [msg.nick] def f(L): @@ -236,6 +250,7 @@ class Channel(callbacks.Plugin): devoice = wrap(devoice, ['voice', ('haveOp', 'devoice someone'), any('nickInChannel')]) + @internationalizeDocstring def cycle(self, irc, msg, args, channel): """[] @@ -248,6 +263,7 @@ class Channel(callbacks.Plugin): self._sendMsg(irc, networkGroup.channels.join(channel)) cycle = wrap(cycle, ['op']) + @internationalizeDocstring def kick(self, irc, msg, args, channel, nicks, reason): """[] [, , ...] [] @@ -257,19 +273,20 @@ class Channel(callbacks.Plugin): itself. """ if utils.iter.any(lambda n: ircutils.strEqual(n, irc.nick), nicks): - irc.error('I cowardly refuse to kick myself.', Raise=True) + irc.error(_('I cowardly refuse to kick myself.'), Raise=True) if not reason: reason = msg.nick kicklen = irc.state.supported.get('kicklen', sys.maxint) if len(reason) > kicklen: - irc.error('The reason you gave is longer than the allowed ' - 'length for a KICK reason on this server.', + irc.error(_('The reason you gave is longer than the allowed ' + 'length for a KICK reason on this server.'), Raise=True) for nick in nicks: self._sendMsg(irc, ircmsgs.kick(channel, nick, reason)) - kick = wrap(kick, ['op', ('haveOp', 'kick someone'), + kick = wrap(kick, ['op', ('haveOp', _('kick someone')), commalist('nickInChannel'), additional('text')]) + @internationalizeDocstring def kban(self, irc, msg, args, channel, optlist, bannedNick, expiry, reason): """[] [--{exact,nick,user,host}] [] [] @@ -291,14 +308,14 @@ class Channel(callbacks.Plugin): raise callbacks.ArgumentError elif bannedNick == irc.nick: self.log.warning('%q tried to make me kban myself.', msg.prefix) - irc.error('I cowardly refuse to kickban myself.') + irc.error(_('I cowardly refuse to kickban myself.')) return if not reason: reason = msg.nick try: bannedHostmask = irc.state.nickToHostmask(bannedNick) except KeyError: - irc.error(format('I haven\'t seen %s.', bannedNick), Raise=True) + irc.error(format(_('I haven\'t seen %s.'), bannedNick), Raise=True) capability = ircdb.makeChannelCapability(channel, 'op') banmaskstyle = conf.supybot.protocols.irc.banmask banmask = banmaskstyle.makeBanmask(bannedHostmask, [o[0] for o in optlist]) @@ -306,7 +323,7 @@ class Channel(callbacks.Plugin): if ircutils.hostmaskPatternEqual(banmask, irc.prefix): if ircutils.hostmaskPatternEqual(bannedHostmask, irc.prefix): self.log.warning('%q tried to make me kban myself.',msg.prefix) - irc.error('I cowardly refuse to ban myself.') + irc.error(_('I cowardly refuse to ban myself.')) return else: self.log.warning('Using exact hostmask since banmask would ' @@ -332,8 +349,8 @@ class Channel(callbacks.Plugin): if ircdb.checkCapability(bannedHostmask, capability): self.log.warning('%s tried to ban %q, but both have %s', msg.prefix, bannedHostmask, capability) - irc.error(format('%s has %s too, you can\'t ban him/her/it.', - bannedNick, capability)) + irc.error(format(_('%s has %s too, you can\'t ban ' + 'him/her/it.'), bannedNick, capability)) else: doBan() else: @@ -344,11 +361,12 @@ class Channel(callbacks.Plugin): kban = wrap(kban, ['op', getopts({'exact':'', 'nick':'', 'user':'', 'host':''}), - ('haveOp', 'kick or ban someone'), + ('haveOp', _('kick or ban someone')), 'nickInChannel', optional('expiry', 0), additional('text')]) + @internationalizeDocstring def unban(self, irc, msg, args, channel, hostmask): """[] [] @@ -367,16 +385,17 @@ class Channel(callbacks.Plugin): bans.append(banmask) if bans: irc.queueMsg(ircmsgs.unbans(channel, bans)) - irc.replySuccess(format('All bans on %s matching %s ' - 'have been removed.', + irc.replySuccess(format(_('All bans on %s matching %s ' + 'have been removed.'), channel, msg.prefix)) else: - irc.error('No bans matching %s were found on %s.' % + irc.error(_('No bans matching %s were found on %s.') % (msg.prefix, channel)) unban = wrap(unban, ['op', - ('haveOp', 'unban someone'), + ('haveOp', _('unban someone')), additional('hostmask')]) + @internationalizeDocstring def invite(self, irc, msg, args, channel, nick): """[] @@ -387,7 +406,7 @@ class Channel(callbacks.Plugin): nick = nick or msg.nick self._sendMsg(irc, ircmsgs.invite(nick, channel)) self.invites[(irc.getRealIrc(), ircutils.toLower(nick))] = irc - invite = wrap(invite, ['op', ('haveOp', 'invite someone'), + invite = wrap(invite, ['op', (_('haveOp'), _('invite someone')), additional('nick')]) def do341(self, irc, msg): @@ -406,14 +425,14 @@ class Channel(callbacks.Plugin): nick = ircutils.toLower(nick) replyIrc = self.invites.pop((irc, nick), None) if replyIrc is not None: - replyIrc.error(format('%s is already in %s.', nick, channel)) + replyIrc.error(format(_('%s is already in %s.'), nick, channel)) def do401(self, irc, msg): nick = msg.args[1] nick = ircutils.toLower(nick) replyIrc = self.invites.pop((irc, nick), None) if replyIrc is not None: - replyIrc.error(format('There is no %s on this network.', nick)) + replyIrc.error(format(_('There is no %s on this network.'), nick)) def do504(self, irc, msg): nick = msg.args[1] @@ -423,6 +442,7 @@ class Channel(callbacks.Plugin): replyIrc.error(format('There is no %s on this server.', nick)) class lobotomy(callbacks.Commands): + @internationalizeDocstring def add(self, irc, msg, args, channel): """[] @@ -437,6 +457,7 @@ class Channel(callbacks.Plugin): irc.replySuccess() add = wrap(add, ['op']) + @internationalizeDocstring def remove(self, irc, msg, args, channel): """[] @@ -451,6 +472,7 @@ class Channel(callbacks.Plugin): irc.replySuccess() remove = wrap(remove, ['op']) + @internationalizeDocstring def list(self, irc, msg, args): """takes no arguments @@ -467,14 +489,15 @@ class Channel(callbacks.Plugin): L.append(channel) if L: L.sort() - s = format('I\'m currently lobotomized in %L.', L) + s = format(_('I\'m currently lobotomized in %L.'), L) irc.reply(s) else: - irc.reply('I\'m not currently lobotomized in any channels ' - 'that you\'re in.') + irc.reply(_('I\'m not currently lobotomized in any channels ' + 'that you\'re in.')) list = wrap(list) class ban(callbacks.Commands): + @internationalizeDocstring def add(self, irc, msg, args, channel, banmask, expires): """[] [] @@ -494,6 +517,7 @@ class Channel(callbacks.Plugin): irc.replySuccess() add = wrap(add, ['op', 'banmask', additional('expiry', 0)]) + @internationalizeDocstring def remove(self, irc, msg, args, channel, banmask): """[] @@ -507,9 +531,10 @@ class Channel(callbacks.Plugin): ircdb.channels.setChannel(channel, c) irc.replySuccess() except KeyError: - irc.error('There are no persistent bans for that hostmask.') + irc.error(_('There are no persistent bans for that hostmask.')) remove = wrap(remove, ['op', 'hostmask']) + @internationalizeDocstring def list(self, irc, msg, args, channel): """[] @@ -521,18 +546,19 @@ class Channel(callbacks.Plugin): bans = [] for ban in c.bans: if c.bans[ban]: - bans.append(format('%q (expires %t)', + bans.append(format(_('%q (expires %t)'), ban, c.bans[ban])) else: - bans.append(format('%q (never expires)', + bans.append(format(_('%q (never expires)'), ban, c.bans[ban])) irc.reply(format('%L', bans)) else: - irc.reply(format('There are no persistent bans on %s.', + irc.reply(format(_('There are no persistent bans on %s.'), channel)) list = wrap(list, ['op']) class ignore(callbacks.Commands): + @internationalizeDocstring def add(self, irc, msg, args, channel, banmask, expires): """[] [] @@ -550,6 +576,7 @@ class Channel(callbacks.Plugin): irc.replySuccess() add = wrap(add, ['op', 'banmask', additional('expiry', 0)]) + @internationalizeDocstring def remove(self, irc, msg, args, channel, banmask): """[] @@ -563,9 +590,10 @@ class Channel(callbacks.Plugin): ircdb.channels.setChannel(channel, c) irc.replySuccess() except KeyError: - irc.error('There are no ignores for that hostmask.') + irc.error(_('There are no ignores for that hostmask.')) remove = wrap(remove, ['op', 'hostmask']) + @internationalizeDocstring def list(self, irc, msg, args, channel): """[] @@ -576,8 +604,8 @@ class Channel(callbacks.Plugin): # XXX Add the expirations. c = ircdb.channels.getChannel(channel) if len(c.ignores) == 0: - s = format('I\'m not currently ignoring any hostmasks in %q', - channel) + s = format(_('I\'m not currently ignoring any hostmasks in ' + '%q'), channel) irc.reply(s) else: L = sorted(c.ignores) @@ -585,6 +613,7 @@ class Channel(callbacks.Plugin): list = wrap(list, ['op']) class capability(callbacks.Commands): + @internationalizeDocstring def add(self, irc, msg, args, channel, user, capabilities): """[] [ ...] @@ -600,6 +629,7 @@ class Channel(callbacks.Plugin): irc.replySuccess() add = wrap(add, ['op', 'otherUser', 'capability']) + @internationalizeDocstring def remove(self, irc, msg, args, channel, user, capabilities): """[] [ ...] @@ -620,13 +650,14 @@ class Channel(callbacks.Plugin): s = 'capability' if len(fail) > 1: s = utils.str.pluralize(s) - irc.error(format('That user didn\'t have the %L %s.', fail, s), - Raise=True) + irc.error(format(_('That user didn\'t have the %L %s.'), fail, + s), Raise=True) irc.replySuccess() remove = wrap(remove, ['op', 'otherUser', 'capability']) # XXX This needs to be fix0red to be like Owner.defaultcapability. Or # something else. This is a horrible interface. + @internationalizeDocstring def setdefault(self, irc, msg, args, channel, v): """[] {True|False} @@ -644,6 +675,7 @@ class Channel(callbacks.Plugin): irc.replySuccess() setdefault = wrap(setdefault, ['op', 'boolean']) + @internationalizeDocstring def set(self, irc, msg, args, channel, capabilities): """[] [ ...] @@ -658,6 +690,7 @@ class Channel(callbacks.Plugin): irc.replySuccess() set = wrap(set, ['op', many('capability')]) + @internationalizeDocstring def unset(self, irc, msg, args, channel, capabilities): """[] [ ...] @@ -675,14 +708,15 @@ class Channel(callbacks.Plugin): fail.append(c) ircdb.channels.setChannel(channel, chan) if fail: - s = 'capability' + s = _('capability') if len(fail) > 1: s = utils.str.pluralize(s) - irc.error(format('I do not know about the %L %s.', fail, s), + irc.error(format(_('I do not know about the %L %s.'), fail, s), Raise=True) irc.replySuccess() unset = wrap(unset, ['op', many('capability')]) + @internationalizeDocstring def list(self, irc, msg, args, channel): """[] @@ -694,6 +728,7 @@ class Channel(callbacks.Plugin): irc.reply(' '.join(L)) list = wrap(list, ['channel']) + @internationalizeDocstring def disable(self, irc, msg, args, channel, plugin, command): """[] [] [] @@ -711,15 +746,15 @@ class Channel(callbacks.Plugin): if plugin.isCommand(command): s = '-%s.%s' % (plugin.name(), command) else: - failMsg = format('The %s plugin does not have a command ' - 'called %s.', plugin.name(), command) + failMsg = format(_('The %s plugin does not have a command ' + 'called %s.'), plugin.name(), command) elif command: # findCallbackForCommand if filter(None, irc.findCallbacksForArgs([command])): s = '-%s' % command else: - failMsg = format('No plugin or command named %s could be ' - 'found.', command) + failMsg = format(_('No plugin or command named %s could be ' + 'found.'), command) else: raise callbacks.ArgumentError if failMsg: @@ -732,6 +767,7 @@ class Channel(callbacks.Plugin): optional(('plugin', False)), additional('commandName')]) + @internationalizeDocstring def enable(self, irc, msg, args, channel, plugin, command): """[] [] [] @@ -749,15 +785,15 @@ class Channel(callbacks.Plugin): if plugin.isCommand(command): s = '-%s.%s' % (plugin.name(), command) else: - failMsg = format('The %s plugin does not have a command ' - 'called %s.', plugin.name(), command) + failMsg = format(_('The %s plugin does not have a command ' + 'called %s.'), plugin.name(), command) elif command: # findCallbackForCommand if filter(None, irc.findCallbacksForArgs([command])): s = '-%s' % command else: - failMsg = format('No plugin or command named %s could be ' - 'found.', command) + failMsg = format(_('No plugin or command named %s could be ' + 'found.'), command) else: raise callbacks.ArgumentError if failMsg: @@ -770,13 +806,14 @@ class Channel(callbacks.Plugin): fail.append(s) ircdb.channels.setChannel(channel, chan) if fail: - irc.error(format('%s was not disabled.', s[1:])) + irc.error(format(_('%s was not disabled.'), s[1:])) else: irc.replySuccess() enable = wrap(enable, ['op', optional(('plugin', False)), additional('commandName')]) + @internationalizeDocstring def nicks(self, irc, msg, args, channel): """[] @@ -789,24 +826,26 @@ class Channel(callbacks.Plugin): msg.args[0] != channel and \ (ircutils.isChannel(msg.args[0]) or \ msg.nick not in irc.state.channels[channel].users): - irc.error('You don\'t have access to that information.') + irc.error(_('You don\'t have access to that information.')) L = list(irc.state.channels[channel].users) utils.sortBy(str.lower, L) irc.reply(utils.str.commaAndify(L)) nicks = wrap(nicks, ['inChannel']) + @internationalizeDocstring def alertOps(self, irc, channel, s, frm=None): """Internal message for notifying all the #channel,ops in a channel of a given situation.""" capability = ircdb.makeChannelCapability(channel, 'op') - s = format('Alert to all %s ops: %s', channel, s) + s = format(_('Alert to all %s ops: %s'), channel, s) if frm is not None: - s += format(' (from %s)', frm) + s += format(_(' (from %s)'), frm) for nick in irc.state.channels[channel].users: hostmask = irc.state.nickToHostmask(nick) if ircdb.checkCapability(hostmask, capability): irc.reply(s, to=nick, private=True) + @internationalizeDocstring def alert(self, irc, msg, args, channel, text): """[]