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 ""
msgstr ""
"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"
"Last-Translator: Valentin Lorentz <progval@gmail.com>\n"
"Language-Team: Supybot-fr <progval@gmail.com>\n"
@ -101,7 +101,7 @@ msgstr ""
" "
#: plugin.py:141
#: plugin.py:192
#: plugin.py:200
msgid "We broke The Google!"
msgstr "Google est toukassay !"
@ -111,20 +111,21 @@ msgstr "Aucune correspondance."
#: plugin.py:167
msgid ""
"<search>\n"
"[--snippet] <search>\n"
"\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 ""
"<recherche>\n"
"[--snippet] <recherche>\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."
msgstr "Google n'a rien trouvé."
#: plugin.py:181
#: plugin.py:189
msgid ""
"<search> [--{filter,language} <value>]\n"
"\n"
@ -137,7 +138,7 @@ msgstr ""
"\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')."
#: plugin.py:204
#: plugin.py:212
msgid ""
"<url>\n"
"\n"
@ -148,11 +149,11 @@ msgstr ""
"\n"
"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."
msgstr "Google semble ne pas avoir de cache pour ce site."
#: plugin.py:220
#: plugin.py:228
msgid ""
"<search string> <search string> [<search string> ...]\n"
"\n"
@ -164,7 +165,7 @@ msgstr ""
"\n"
"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 ""
"<from-language> [to] <to-language> <text>\n"
"\n"
@ -176,24 +177,24 @@ msgstr ""
"<langue de départ> [to] <langue finale> <texte>\n"
"\n"
#: plugin.py:263
#: plugin.py:271
msgid "from language"
msgstr "de la langue"
#: plugin.py:264
#: plugin.py:273
#: plugin.py:272
#: plugin.py:281
msgid "Valid languages are: %L"
msgstr "Les langues valides sont : %L"
#: plugin.py:272
#: plugin.py:280
msgid "to language"
msgstr "vers la langue"
#: plugin.py:289
#: plugin.py:297
msgid "^google\\s+(.*)$"
msgstr "^google\\s+(.*)$"
#: plugin.py:311
#: plugin.py:320
msgid ""
"<expression>\n"
"\n"
@ -204,11 +205,11 @@ msgstr ""
"\n"
"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."
msgstr "La calculatrice Google ne donne aucun résultat."
#: plugin.py:331
#: plugin.py:343
msgid ""
"<phone number>\n"
"\n"
@ -219,7 +220,7 @@ msgstr ""
"\n"
"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."
msgstr "L'annuaire téléphonique de Google ne donne aucun résultat."

View File

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -95,7 +95,7 @@ msgid ""
" "
msgstr ""
#: plugin.py:141 plugin.py:192
#: plugin.py:141 plugin.py:200
msgid "We broke The Google!"
msgstr ""
@ -106,17 +106,18 @@ msgstr ""
#: plugin.py:167
#, docstring
msgid ""
"<search>\n"
"[--snippet] <search>\n"
"\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 ""
#: plugin.py:176
#: plugin.py:184
msgid "Google found nothing."
msgstr ""
#: plugin.py:181
#: plugin.py:189
#, docstring
msgid ""
"<search> [--{filter,language} <value>]\n"
@ -127,7 +128,7 @@ msgid ""
" "
msgstr ""
#: plugin.py:204
#: plugin.py:212
#, docstring
msgid ""
"<url>\n"
@ -136,11 +137,11 @@ msgid ""
" "
msgstr ""
#: plugin.py:215
#: plugin.py:223
msgid "Google seems to have no cache for that site."
msgstr ""
#: plugin.py:220
#: plugin.py:228
#, docstring
msgid ""
"<search string> <search string> [<search string> ...]\n"
@ -150,7 +151,7 @@ msgid ""
" "
msgstr ""
#: plugin.py:244
#: plugin.py:252
#, docstring
msgid ""
"<from-language> [to] <to-language> <text>\n"
@ -161,24 +162,24 @@ msgid ""
" "
msgstr ""
#: plugin.py:263
#: plugin.py:271
msgid "from language"
msgstr ""
#: plugin.py:264 plugin.py:273
#: plugin.py:272 plugin.py:281
msgid "Valid languages are: %L"
msgstr ""
#: plugin.py:272
#: plugin.py:280
msgid "to language"
msgstr ""
#: plugin.py:289
#: plugin.py:297
#, docstring
msgid "^google\\s+(.*)$"
msgstr ""
#: plugin.py:311
#: plugin.py:320
#, docstring
msgid ""
"<expression>\n"
@ -187,11 +188,11 @@ msgid ""
" "
msgstr ""
#: plugin.py:325
#: plugin.py:337
msgid "Google's calculator didn't come up with anything."
msgstr ""
#: plugin.py:331
#: plugin.py:343
#, docstring
msgid ""
"<phone number>\n"
@ -200,7 +201,7 @@ msgid ""
" "
msgstr ""
#: plugin.py:345
#: plugin.py:357
msgid "Google's phonebook didn't come up with anything."
msgstr ""

View File

@ -163,18 +163,26 @@ class Google(callbacks.PluginRegexp):
return format('; '.join(results))
@internationalizeDocstring
def lucky(self, irc, msg, args, text):
"""<search>
def lucky(self, irc, msg, args, opts, text):
"""[--snippet] <search>
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})
if data['responseData']['results']:
url = data['responseData']['results'][0]['unescapedUrl']
irc.reply(url.encode('utf-8'))
url = data['responseData']['results'][0]['unescapedUrl'].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:
irc.reply(_('Google found nothing.'))
lucky = wrap(lucky, ['text'])
lucky = wrap(lucky, [getopts({'snippet':'',}), 'text'])
@internationalizeDocstring
def google(self, irc, msg, args, optlist, text):