Merge branch 'testing'

This commit is contained in:
Valentin Lorentz 2011-02-14 18:52:51 +01:00
commit bfd2204863
3 changed files with 52 additions and 42 deletions

View File

@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Supybot-fr\n" "Project-Id-Version: Supybot-fr\n"
"POT-Creation-Date: 2010-10-17 14:50+CEST\n" "POT-Creation-Date: 2011-02-14 18:30+CET\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: Valentin Lorentz <progval@gmail.com>\n" "Last-Translator: Valentin Lorentz <progval@gmail.com>\n"
"Language-Team: Supybot-fr <progval@gmail.com>\n" "Language-Team: Supybot-fr <progval@gmail.com>\n"
@ -101,7 +101,7 @@ msgstr ""
" " " "
#: plugin.py:141 #: plugin.py:141
#: plugin.py:192 #: plugin.py:200
msgid "We broke The Google!" msgid "We broke The Google!"
msgstr "Google est toukassay !" msgstr "Google est toukassay !"
@ -111,20 +111,21 @@ msgstr "Aucune correspondance."
#: plugin.py:167 #: plugin.py:167
msgid "" msgid ""
"<search>\n" "[--snippet] <search>\n"
"\n" "\n"
" Does a google search, but only returns the first result.\n" " Does a google search, but only returns the first result.\n"
" If option --snippet is given, returns also the page text snippet.\n"
" " " "
msgstr "" msgstr ""
"<recherche>\n" "[--snippet] <recherche>\n"
"\n" "\n"
"Effectue une recherche google, mais ne retourne que le premier résultat." "Effectue une recherche google, mais ne retourne que le premier résultat. Si l'option --snippet est donnée, retournera également un fragment de la page."
#: plugin.py:176 #: plugin.py:184
msgid "Google found nothing." msgid "Google found nothing."
msgstr "Google n'a rien trouvé." msgstr "Google n'a rien trouvé."
#: plugin.py:181 #: plugin.py:189
msgid "" msgid ""
"<search> [--{filter,language} <value>]\n" "<search> [--{filter,language} <value>]\n"
"\n" "\n"
@ -137,7 +138,7 @@ msgstr ""
"\n" "\n"
"Rercherche la chaîne donnée sur Google. Autant de résultats que possible sont donnés. --language accepte une abbréviation de langue ; --filter accepte un niveau de filtrage ('active', 'moderate', 'off')." "Rercherche la chaîne donnée sur Google. Autant de résultats que possible sont donnés. --language accepte une abbréviation de langue ; --filter accepte un niveau de filtrage ('active', 'moderate', 'off')."
#: plugin.py:204 #: plugin.py:212
msgid "" msgid ""
"<url>\n" "<url>\n"
"\n" "\n"
@ -148,11 +149,11 @@ msgstr ""
"\n" "\n"
"Retourne un lien vers la version en cache de l'<url>, si elle est disponible." "Retourne un lien vers la version en cache de l'<url>, si elle est disponible."
#: plugin.py:215 #: plugin.py:223
msgid "Google seems to have no cache for that site." msgid "Google seems to have no cache for that site."
msgstr "Google semble ne pas avoir de cache pour ce site." msgstr "Google semble ne pas avoir de cache pour ce site."
#: plugin.py:220 #: plugin.py:228
msgid "" msgid ""
"<search string> <search string> [<search string> ...]\n" "<search string> <search string> [<search string> ...]\n"
"\n" "\n"
@ -164,7 +165,7 @@ msgstr ""
"\n" "\n"
"Retourne les résultats de chaque recherche, dans l'ordre, par ordre croissant du nombre de résultats." "Retourne les résultats de chaque recherche, dans l'ordre, par ordre croissant du nombre de résultats."
#: plugin.py:244 #: plugin.py:252
msgid "" msgid ""
"<from-language> [to] <to-language> <text>\n" "<from-language> [to] <to-language> <text>\n"
"\n" "\n"
@ -176,24 +177,24 @@ msgstr ""
"<langue de départ> [to] <langue finale> <texte>\n" "<langue de départ> [to] <langue finale> <texte>\n"
"\n" "\n"
#: plugin.py:263 #: plugin.py:271
msgid "from language" msgid "from language"
msgstr "de la langue" msgstr "de la langue"
#: plugin.py:264 #: plugin.py:272
#: plugin.py:273 #: plugin.py:281
msgid "Valid languages are: %L" msgid "Valid languages are: %L"
msgstr "Les langues valides sont : %L" msgstr "Les langues valides sont : %L"
#: plugin.py:272 #: plugin.py:280
msgid "to language" msgid "to language"
msgstr "vers la langue" msgstr "vers la langue"
#: plugin.py:289 #: plugin.py:297
msgid "^google\\s+(.*)$" msgid "^google\\s+(.*)$"
msgstr "^google\\s+(.*)$" msgstr "^google\\s+(.*)$"
#: plugin.py:311 #: plugin.py:320
msgid "" msgid ""
"<expression>\n" "<expression>\n"
"\n" "\n"
@ -204,11 +205,11 @@ msgstr ""
"\n" "\n"
"Utilise la calculatrice Google pour calculer la valeur de l'<expression>." "Utilise la calculatrice Google pour calculer la valeur de l'<expression>."
#: plugin.py:325 #: plugin.py:337
msgid "Google's calculator didn't come up with anything." msgid "Google's calculator didn't come up with anything."
msgstr "La calculatrice Google ne donne aucun résultat." msgstr "La calculatrice Google ne donne aucun résultat."
#: plugin.py:331 #: plugin.py:343
msgid "" msgid ""
"<phone number>\n" "<phone number>\n"
"\n" "\n"
@ -219,7 +220,7 @@ msgstr ""
"\n" "\n"
"Recherche le <numéro de téléphone> sur Google." "Recherche le <numéro de téléphone> sur Google."
#: plugin.py:345 #: plugin.py:357
msgid "Google's phonebook didn't come up with anything." msgid "Google's phonebook didn't come up with anything."
msgstr "L'annuaire téléphonique de Google ne donne aucun résultat." msgstr "L'annuaire téléphonique de Google ne donne aucun résultat."

View File

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2010-10-17 14:50+CEST\n" "POT-Creation-Date: 2011-02-14 18:30+CET\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -95,7 +95,7 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:141 plugin.py:192 #: plugin.py:141 plugin.py:200
msgid "We broke The Google!" msgid "We broke The Google!"
msgstr "" msgstr ""
@ -106,17 +106,18 @@ msgstr ""
#: plugin.py:167 #: plugin.py:167
#, docstring #, docstring
msgid "" msgid ""
"<search>\n" "[--snippet] <search>\n"
"\n" "\n"
" Does a google search, but only returns the first result.\n" " Does a google search, but only returns the first result.\n"
" If option --snippet is given, returns also the page text snippet.\n"
" " " "
msgstr "" msgstr ""
#: plugin.py:176 #: plugin.py:184
msgid "Google found nothing." msgid "Google found nothing."
msgstr "" msgstr ""
#: plugin.py:181 #: plugin.py:189
#, docstring #, docstring
msgid "" msgid ""
"<search> [--{filter,language} <value>]\n" "<search> [--{filter,language} <value>]\n"
@ -127,7 +128,7 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:204 #: plugin.py:212
#, docstring #, docstring
msgid "" msgid ""
"<url>\n" "<url>\n"
@ -136,11 +137,11 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:215 #: plugin.py:223
msgid "Google seems to have no cache for that site." msgid "Google seems to have no cache for that site."
msgstr "" msgstr ""
#: plugin.py:220 #: plugin.py:228
#, docstring #, docstring
msgid "" msgid ""
"<search string> <search string> [<search string> ...]\n" "<search string> <search string> [<search string> ...]\n"
@ -150,7 +151,7 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:244 #: plugin.py:252
#, docstring #, docstring
msgid "" msgid ""
"<from-language> [to] <to-language> <text>\n" "<from-language> [to] <to-language> <text>\n"
@ -161,24 +162,24 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:263 #: plugin.py:271
msgid "from language" msgid "from language"
msgstr "" msgstr ""
#: plugin.py:264 plugin.py:273 #: plugin.py:272 plugin.py:281
msgid "Valid languages are: %L" msgid "Valid languages are: %L"
msgstr "" msgstr ""
#: plugin.py:272 #: plugin.py:280
msgid "to language" msgid "to language"
msgstr "" msgstr ""
#: plugin.py:289 #: plugin.py:297
#, docstring #, docstring
msgid "^google\\s+(.*)$" msgid "^google\\s+(.*)$"
msgstr "" msgstr ""
#: plugin.py:311 #: plugin.py:320
#, docstring #, docstring
msgid "" msgid ""
"<expression>\n" "<expression>\n"
@ -187,11 +188,11 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:325 #: plugin.py:337
msgid "Google's calculator didn't come up with anything." msgid "Google's calculator didn't come up with anything."
msgstr "" msgstr ""
#: plugin.py:331 #: plugin.py:343
#, docstring #, docstring
msgid "" msgid ""
"<phone number>\n" "<phone number>\n"
@ -200,7 +201,7 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: plugin.py:345 #: plugin.py:357
msgid "Google's phonebook didn't come up with anything." msgid "Google's phonebook didn't come up with anything."
msgstr "" msgstr ""

View File

@ -163,18 +163,26 @@ class Google(callbacks.PluginRegexp):
return format('; '.join(results)) return format('; '.join(results))
@internationalizeDocstring @internationalizeDocstring
def lucky(self, irc, msg, args, text): def lucky(self, irc, msg, args, opts, text):
"""<search> """[--snippet] <search>
Does a google search, but only returns the first result. Does a google search, but only returns the first result.
If option --snippet is given, returns also the page text snippet.
""" """
opts = dict(opts)
data = self.search(text, msg.args[0], {'smallsearch': True}) data = self.search(text, msg.args[0], {'smallsearch': True})
if data['responseData']['results']: if data['responseData']['results']:
url = data['responseData']['results'][0]['unescapedUrl'] url = data['responseData']['results'][0]['unescapedUrl'].encode('utf-8')
irc.reply(url.encode('utf-8')) if opts.has_key('snippet'):
snippet = data['responseData']['results'][0]['content'].encode('utf-8')
snippet = " | " + utils.web.htmlToText(snippet, tagReplace='')
else:
snippet = ""
result = url + snippet
irc.reply(result)
else: else:
irc.reply(_('Google found nothing.')) irc.reply(_('Google found nothing.'))
lucky = wrap(lucky, ['text']) lucky = wrap(lucky, [getopts({'snippet':'',}), 'text'])
@internationalizeDocstring @internationalizeDocstring
def google(self, irc, msg, args, optlist, text): def google(self, irc, msg, args, optlist, text):