diff --git a/plugins/Conditional/config.py b/plugins/Conditional/config.py index ab69968bd..f64814015 100644 --- a/plugins/Conditional/config.py +++ b/plugins/Conditional/config.py @@ -31,6 +31,16 @@ import supybot.conf as conf import supybot.registry as registry +try: + from supybot.i18n import PluginInternationalization + from supybot.i18n import internationalizeDocstring + _ = PluginInternationalization('Conditional') +except: + # This are useless functions that's allow to run the plugin on a bot + # without the i18n plugin + _ = lambda x:x + internationalizeDocstring = lambda x:x + def configure(advanced): # This will be called by supybot to configure this module. advanced is # a bool that specifies whether the user identified himself as an advanced diff --git a/plugins/Conditional/locale/fr.po b/plugins/Conditional/locale/fr.po new file mode 100644 index 000000000..91f8d1cbf --- /dev/null +++ b/plugins/Conditional/locale/fr.po @@ -0,0 +1,229 @@ +msgid "" +msgstr "" +"Project-Id-Version: Gribble\n" +"POT-Creation-Date: 2010-11-02 11:39+CET\n" +"PO-Revision-Date: \n" +"Last-Translator: Valentin Lorentz \n" +"Language-Team: Supybot-fr \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Français\n" +"X-Poedit-Country: France\n" +"X-Poedit-SourceCharset: ASCII\n" + +#: plugin.py:64 +msgid "" +"Add the help for \"@plugin help Conditional\" here\n" +" This should describe *how* to use this plugin." +msgstr "" + +#: plugin.py:71 +msgid "Run a command from message, as if command was sent over IRC." +msgstr "" + +#: plugin.py:80 +msgid "" +" \n" +" \n" +" Runs if evaluates to true, runs \n" +" if it evaluates to false.\n" +" \n" +" Use other logical operators defined in this plugin and command nesting\n" +" to your advantage here.\n" +" " +msgstr "" +" \n" +"\n" +"Exécute la si la est évaluée à true, lance la si elle est évaluée à false. Utilisez d'autres opérateurs logiques définis dans ce plugin et l'imbrication de commandes à votre avantage." + +#: plugin.py:97 +msgid "" +" [ ... ]\n" +" \n" +" Returns true if all conditions supplied evaluate to true.\n" +" " +msgstr "" +" [ ... ]\n" +"\n" +"Retourne True si toutes les conditions sont évaluées à true." + +#: plugin.py:109 +msgid "" +" [ ... ]\n" +" \n" +" Returns true if any one of conditions supplied evaluates to true.\n" +" " +msgstr "" +" [ ... ]\n" +"\n" +"Retourne True si une au moins des conditions est évaluée à true." + +#: plugin.py:121 +msgid "" +" [ ... ]\n" +" \n" +" Returns true if only one of conditions supplied evaluates to true.\n" +" " +msgstr "" +" [ ... ]\n" +"\n" +"Retourne True si une seule des conditions est évaluée à true." + +#: plugin.py:133 +msgid "" +" \n" +" \n" +" Does a string comparison on and . \n" +" Returns true if they are equal.\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison de chaîne entre <élément1> et <élément2>. Retourne true si ils sont égaux." + +#: plugin.py:146 +msgid "" +" \n" +" \n" +" Does a string comparison on and . \n" +" Returns true if they are not equal.\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison de chaîne entre <élément1> et <élément2>. Retourne true si ils sont inégaux." + +#: plugin.py:159 +msgid "" +" \n" +" \n" +" Does a string comparison on and . \n" +" Returns true if is greater than .\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison de chaîne entre <élément1> et <élément2>. Retourne true si <élément1> est plus grand que <élément2>" + +#: plugin.py:172 +msgid "" +" \n" +" \n" +" Does a string comparison on and . \n" +" Returns true if is greater than or equal to .\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison de chaîne entre <élément1> et <élément2>. Retourne true si <élément1> est plus grand ou égal à <élément2>" + +#: plugin.py:185 +msgid "" +" \n" +" \n" +" Does a string comparison on and . \n" +" Returns true if is less than .\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison de chaîne entre <élément1> et <élément2>. Retourne true si <élément1> est plus petit que <élément2>" + +#: plugin.py:198 +msgid "" +" \n" +" \n" +" Does a string comparison on and . \n" +" Returns true if is less than or equal to .\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison de chaîne entre <élément1> et <élément2>. Retourne true si <élément1> est plus petit ou égal à <élément2>" + +#: plugin.py:211 +msgid "" +" \n" +" \n" +" Determines if is a substring of . \n" +" Returns true if is contained in .\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Détermine si <élément1> est une sous-chaîne de <élément2>. Retourne true si <élément1> est contenu dans <élément2>" + +#: plugin.py:224 +msgid "" +" \n" +" \n" +" Does a numeric comparison on and . \n" +" Returns true if they are equal.\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison numérique entre <élément1> et <élément2>. Retourne true si ils sont égaux." + +#: plugin.py:237 +msgid "" +" \n" +" \n" +" Does a numeric comparison on and . \n" +" Returns true if they are not equal.\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison numérique entre <élément1> et <élément2>. Retourne true si ils sont inégaux." + +#: plugin.py:250 +msgid "" +" \n" +" \n" +" Does a numeric comparison on and . \n" +" Returns true if they is greater than .\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison numérique entre <élément1> et <élément2>. Retourne true si <élément1> est plus grand que <élément2>" + +#: plugin.py:263 +msgid "" +" \n" +" \n" +" Does a numeric comparison on and . \n" +" Returns true if is greater than or equal to .\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison numérique entre <élément1> et <élément2>. Retourne true si <élément1> est plus grand ou égal à <élément2>" + +#: plugin.py:276 +msgid "" +" \n" +" \n" +" Does a numeric comparison on and . \n" +" Returns true if is less than .\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison numérique entre <élément1> et <élément2>. Retourne true si <élément1> est plus petit que <élément2>" + +#: plugin.py:289 +msgid "" +" \n" +" \n" +" Does a numeric comparison on and . \n" +" Returns true if is less than or equal to .\n" +" " +msgstr "" +"<élément1> <élément2>\n" +"\n" +"Fait une comparaison numérique entre <élément1> et <élément2>. Retourne true si <élément1> est plus petit ou égal à <élément2>" + diff --git a/plugins/Conditional/messages.pot b/plugins/Conditional/messages.pot index 2eb00e392..0fd941dbd 100644 --- a/plugins/Conditional/messages.pot +++ b/plugins/Conditional/messages.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2011-02-26 09:49+CET\n" +"POT-Creation-Date: 2010-11-02 11:39+CET\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,19 +15,19 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: plugin.py:54 +#: plugin.py:64 #, docstring msgid "" "Add the help for \"@plugin help Conditional\" here\n" " This should describe *how* to use this plugin." msgstr "" -#: plugin.py:61 +#: plugin.py:71 #, docstring msgid "Run a command from message, as if command was sent over IRC." msgstr "" -#: plugin.py:69 +#: plugin.py:80 #, docstring msgid "" " \n" @@ -40,7 +40,7 @@ msgid "" " " msgstr "" -#: plugin.py:85 +#: plugin.py:97 #, docstring msgid "" " [ ... ]\n" @@ -49,7 +49,7 @@ msgid "" " " msgstr "" -#: plugin.py:96 +#: plugin.py:109 #, docstring msgid "" " [ ... ]\n" @@ -58,7 +58,7 @@ msgid "" " " msgstr "" -#: plugin.py:107 +#: plugin.py:121 #, docstring msgid "" " [ ... ]\n" @@ -67,7 +67,7 @@ msgid "" " " msgstr "" -#: plugin.py:118 +#: plugin.py:133 #, docstring msgid "" " \n" @@ -77,7 +77,7 @@ msgid "" " " msgstr "" -#: plugin.py:130 +#: plugin.py:146 #, docstring msgid "" " \n" @@ -87,7 +87,7 @@ msgid "" " " msgstr "" -#: plugin.py:142 +#: plugin.py:159 #, docstring msgid "" " \n" @@ -97,7 +97,7 @@ msgid "" " " msgstr "" -#: plugin.py:154 +#: plugin.py:172 #, docstring msgid "" " \n" @@ -107,7 +107,7 @@ msgid "" " " msgstr "" -#: plugin.py:166 +#: plugin.py:185 #, docstring msgid "" " \n" @@ -117,7 +117,7 @@ msgid "" " " msgstr "" -#: plugin.py:178 +#: plugin.py:198 #, docstring msgid "" " \n" @@ -127,7 +127,7 @@ msgid "" " " msgstr "" -#: plugin.py:190 +#: plugin.py:211 #, docstring msgid "" " \n" @@ -137,7 +137,7 @@ msgid "" " " msgstr "" -#: plugin.py:202 +#: plugin.py:224 #, docstring msgid "" " \n" @@ -147,7 +147,7 @@ msgid "" " " msgstr "" -#: plugin.py:214 +#: plugin.py:237 #, docstring msgid "" " \n" @@ -157,7 +157,7 @@ msgid "" " " msgstr "" -#: plugin.py:226 +#: plugin.py:250 #, docstring msgid "" " \n" @@ -167,7 +167,7 @@ msgid "" " " msgstr "" -#: plugin.py:238 +#: plugin.py:263 #, docstring msgid "" " \n" @@ -177,7 +177,7 @@ msgid "" " " msgstr "" -#: plugin.py:250 +#: plugin.py:276 #, docstring msgid "" " \n" @@ -187,7 +187,7 @@ msgid "" " " msgstr "" -#: plugin.py:262 +#: plugin.py:289 #, docstring msgid "" " \n" diff --git a/plugins/Conditional/plugin.py b/plugins/Conditional/plugin.py index 6f9422152..d349f2103 100644 --- a/plugins/Conditional/plugin.py +++ b/plugins/Conditional/plugin.py @@ -36,6 +36,16 @@ import supybot.callbacks as callbacks import re +try: + from supybot.i18n import PluginInternationalization + from supybot.i18n import internationalizeDocstring + _ = PluginInternationalization('Conditional') +except: + # This are useless functions that's allow to run the plugin on a bot + # without the i18n plugin + _ = lambda x:x + internationalizeDocstring = lambda x:x + # builtin any is overwritten by callbacks... and python2.4 doesn't have it def _any(iterable): for element in iterable: @@ -65,6 +75,7 @@ class Conditional(callbacks.Plugin): except Exception, e: log.exception('Uncaught exception in requested function:') + @internationalizeDocstring def cif(self, irc, msg, args, condition, ifcommand, elsecommand): """ @@ -81,6 +92,7 @@ class Conditional(callbacks.Plugin): irc.noReply() cif = wrap(cif, ['boolean', 'something', 'something']) + @internationalizeDocstring def cand(self, irc, msg, args, conds): """ [ ... ] @@ -92,6 +104,7 @@ class Conditional(callbacks.Plugin): irc.reply("false") cand = wrap(cand, [many('boolean'),]) + @internationalizeDocstring def cor(self, irc, msg, args, conds): """ [ ... ] @@ -103,6 +116,7 @@ class Conditional(callbacks.Plugin): irc.reply("false") cor = wrap(cor, [many('boolean'),]) + @internationalizeDocstring def cxor(self, irc, msg, args, conds): """ [ ... ] @@ -114,6 +128,7 @@ class Conditional(callbacks.Plugin): irc.reply("false") cxor = wrap(cxor, [many('boolean'),]) + @internationalizeDocstring def ceq(self, irc, msg, args, item1, item2): """ @@ -126,6 +141,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') ceq = wrap(ceq, ['anything', 'anything']) + @internationalizeDocstring def ne(self, irc, msg, args, item1, item2): """ @@ -138,6 +154,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') ne = wrap(ne, ['anything', 'anything']) + @internationalizeDocstring def gt(self, irc, msg, args, item1, item2): """ @@ -150,6 +167,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') gt = wrap(gt, ['anything', 'anything']) + @internationalizeDocstring def ge(self, irc, msg, args, item1, item2): """ @@ -162,6 +180,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') ge = wrap(ge, ['anything', 'anything']) + @internationalizeDocstring def lt(self, irc, msg, args, item1, item2): """ @@ -174,6 +193,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') lt = wrap(lt, ['anything', 'anything']) + @internationalizeDocstring def le(self, irc, msg, args, item1, item2): """ @@ -186,6 +206,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') le = wrap(le, ['anything', 'anything']) + @internationalizeDocstring def match(self, irc, msg, args, item1, item2): """ @@ -198,6 +219,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') match = wrap(match, ['something', 'something']) + @internationalizeDocstring def nceq(self, irc, msg, args, item1, item2): """ @@ -210,6 +232,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') nceq = wrap(nceq, ['float', 'float']) + @internationalizeDocstring def nne(self, irc, msg, args, item1, item2): """ @@ -222,6 +245,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') nne = wrap(nne, ['float', 'float']) + @internationalizeDocstring def ngt(self, irc, msg, args, item1, item2): """ @@ -234,6 +258,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') ngt = wrap(ngt, ['float', 'float']) + @internationalizeDocstring def nge(self, irc, msg, args, item1, item2): """ @@ -246,6 +271,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') nge = wrap(nge, ['float', 'float']) + @internationalizeDocstring def nlt(self, irc, msg, args, item1, item2): """ @@ -258,6 +284,7 @@ class Conditional(callbacks.Plugin): irc.reply('false') nlt = wrap(nlt, ['float', 'float']) + @internationalizeDocstring def nle(self, irc, msg, args, item1, item2): """ @@ -269,6 +296,7 @@ class Conditional(callbacks.Plugin): else: irc.reply('false') nle = wrap(nle, ['float', 'float']) +Condition = internationalizeDocstring(Conditional) Class = Conditional