removed legacy i18n

This commit is contained in:
BaerbelBox
2022-08-12 10:41:11 +02:00
parent 3485441228
commit 55855b9c20
4 changed files with 3 additions and 15 deletions
-1
View File
@@ -4,7 +4,6 @@ from collections import defaultdict
from FaustBot.Communication.Connection import Connection
from FaustBot.Model.UserProvider import UserProvider
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
from ..Model.i18n import i18n
from FaustBot.Modules.UserList import UserList
class AllSeenObserver(PrivMsgObserverPrototype):
-5
View File
@@ -1,10 +1,5 @@
import datetime
import time
from FaustBot.Communication.Connection import Connection
from FaustBot.Model.UserProvider import UserProvider
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
from ..Model.i18n import i18n
from FaustBot.Model.BlockedUsers import BlockProvider
class BlockObserver(PrivMsgObserverPrototype):
-2
View File
@@ -1,10 +1,8 @@
import datetime
import time
from FaustBot.Communication.Connection import Connection
from FaustBot.Model.UserProvider import UserProvider
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
from ..Model.i18n import i18n
class SeenObserver(PrivMsgObserverPrototype):
+3 -7
View File
@@ -1,6 +1,4 @@
from wikipedia import wikipedia
from FaustBot.Model.i18n import i18n
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
@@ -17,18 +15,16 @@ class WikiObserver(PrivMsgObserverPrototype):
if data['message'].find('.w ') == -1:
return
i18n_server = i18n()
w = wikipedia.set_lang(i18n_server.get_text('wiki_lang', lang=self.config.lang))
w = wikipedia.set_lang('de')
q = data['message'].split(' ')
query = ''
for word in q:
if word.strip() != '.w':
query += word + ' '
w = wikipedia.search(query)
if w.__len__() == 0: # TODO BUG BELOW, ERROR MESSAGE NOT SHOWN!
if w.__len__() == 0:
connection.send_back(data['nick'] + ', ' +
i18n_server.get_text('wiki_fail',
lang=self.config.lang),
'ich habe dazu keinen eintrag gefunden!',
data)
return
try: