From a8319d3c6ff92d187b3ee79ca22c5158c3c97373 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 10 Oct 2010 15:11:41 +0200 Subject: [PATCH] Remove debug message and internationalize config.py in ChannelStats --- plugins/ChannelStats/config.py | 15 ++-- plugins/ChannelStats/messages.pot | 144 ------------------------------ src/i18n.py | 2 - 3 files changed, 9 insertions(+), 152 deletions(-) delete mode 100644 plugins/ChannelStats/messages.pot diff --git a/plugins/ChannelStats/config.py b/plugins/ChannelStats/config.py index 3e896e999..d8263bf26 100644 --- a/plugins/ChannelStats/config.py +++ b/plugins/ChannelStats/config.py @@ -31,6 +31,9 @@ import re import supybot.conf as conf import supybot.registry as registry +from supybot.i18n import PluginInternationalization, internationalizeDocstring + +_ = PluginInternationalization('ChannelStats') def configure(advanced): # This will be called by supybot to configure this module. advanced is @@ -54,16 +57,16 @@ class Smileys(registry.Value): ChannelStats = conf.registerPlugin('ChannelStats') conf.registerChannelValue(ChannelStats, 'selfStats', - registry.Boolean(True, """Determines whether the bot will keep channel + registry.Boolean(True, _("""Determines whether the bot will keep channel statistics on itself, possibly skewing the channel stats (especially in - cases where the bot is relaying between channels on a network).""")) + cases where the bot is relaying between channels on a network)."""))) conf.registerChannelValue(ChannelStats, 'smileys', - Smileys(':) ;) ;] :-) :-D :D :P :p (= =)'.split(), """Determines what + Smileys(':) ;) ;] :-) :-D :D :P :p (= =)'.split(), _("""Determines what words (i.e., pieces of text with no spaces in them) are considered - 'smileys' for the purposes of stats-keeping.""")) + 'smileys' for the purposes of stats-keeping."""))) conf.registerChannelValue(ChannelStats, 'frowns', - Smileys(':| :-/ :-\\ :\\ :/ :( :-( :\'('.split(), """Determines what words + Smileys(':| :-/ :-\\ :\\ :/ :( :-( :\'('.split(), _("""Determines what words (i.e., pieces of text with no spaces in them ) are considered 'frowns' for - the purposes of stats-keeping.""")) + the purposes of stats-keeping."""))) # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/plugins/ChannelStats/messages.pot b/plugins/ChannelStats/messages.pot deleted file mode 100644 index 011c2b4c5..000000000 --- a/plugins/ChannelStats/messages.pot +++ /dev/null @@ -1,144 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR ORGANIZATION -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2010-10-10 09:35+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:246 -#, docstring -msgid "" -"[] []\n" -"\n" -" Returns the statistics for on . is only\n" -" necessary if the message isn't sent on the channel itself. If \n" -" isn't given, it defaults to the user sending the command.\n" -" " -msgstr "" - -#: plugin.py:259 -msgid "I couldn't find you in my user database." -msgstr "" - -#: plugin.py:272 -msgid "%s has sent %n; a total of %n, %n, %n, and %n; %s of those messages %s. %s has joined %n, parted %n, quit %n, kicked someone %n, been kicked %n, changed the topic %n, and changed the mode %n." -msgstr "" - -#: plugin.py:279 -msgid "character" -msgstr "" - -#: plugin.py:280 plugin.py:363 -msgid "word" -msgstr "" - -#: plugin.py:281 plugin.py:364 -msgid "smiley" -msgstr "" - -#: plugin.py:282 plugin.py:365 -msgid "frown" -msgstr "" - -#: plugin.py:284 plugin.py:366 -msgid "was an ACTION" -msgstr "" - -#: plugin.py:285 plugin.py:367 -msgid "were ACTIONs" -msgstr "" - -#: plugin.py:287 plugin.py:288 plugin.py:289 plugin.py:290 plugin.py:291 -#: plugin.py:292 plugin.py:293 -msgid "time" -msgstr "" - -#: plugin.py:296 -msgid "I have no stats for that %s in %s." -msgstr "" - -#: plugin.py:304 -#, docstring -msgid "" -"[] \n" -"\n" -" Returns the ranking of users according to the given stat expression.\n" -" Valid variables in the stat expression include 'msgs', 'chars',\n" -" 'words', 'smileys', 'frowns', 'actions', 'joins', 'parts', 'quits',\n" -" 'kicks', 'kicked', 'topics', and 'modes'. Any simple mathematical\n" -" expression involving those variables is permitted.\n" -" " -msgstr "" - -#: plugin.py:315 -msgid "There's really no reason why you should have underscores or brackets in your mathematical expression. Please remove them." -msgstr "" - -#: plugin.py:319 -msgid "You can't use lambda in this command." -msgstr "" - -#: plugin.py:333 -msgid "stat variable" -msgstr "" - -#: plugin.py:349 -#, docstring -msgid "" -"[]\n" -"\n" -" Returns the statistics for . is only necessary if\n" -" the message isn't sent on the channel itself.\n" -" " -msgstr "" - -#: plugin.py:357 -msgid "On %s there %h been %i messages, containing %i characters, %n, %n, and %n; %i of those messages %s. There have been %n, %n, %n, %n, %n, and %n. There %b currently %n and the channel has peaked at %n." -msgstr "" - -#: plugin.py:368 -msgid "join" -msgstr "" - -#: plugin.py:369 -msgid "part" -msgstr "" - -#: plugin.py:370 -msgid "quit" -msgstr "" - -#: plugin.py:371 -msgid "kick" -msgstr "" - -#: plugin.py:372 -msgid "mode" -msgstr "" - -#: plugin.py:372 plugin.py:373 -msgid "change" -msgstr "" - -#: plugin.py:373 -msgid "topic" -msgstr "" - -#: plugin.py:375 plugin.py:376 -msgid "user" -msgstr "" - -#: plugin.py:379 -msgid "I've never been on %s." -msgstr "" - diff --git a/src/i18n.py b/src/i18n.py index a94116499..2500d7767 100644 --- a/src/i18n.py +++ b/src/i18n.py @@ -155,7 +155,5 @@ class PluginInternationalization: def internationalizeDocstring(obj): # FIXME: check if the plugin has an _ object internationalizedCommands.update({hash(obj): obj}) - print "----doc : " + repr(obj.__doc__) - print "----strings : " + repr(sys.modules[obj.__module__]._.translations.keys()) obj.__doc__=sys.modules[obj.__module__]._(obj.__doc__) return obj