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

View File

@@ -4,7 +4,6 @@ from collections import defaultdict
from FaustBot.Communication.Connection import Connection from FaustBot.Communication.Connection import Connection
from FaustBot.Model.UserProvider import UserProvider from FaustBot.Model.UserProvider import UserProvider
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
from ..Model.i18n import i18n
from FaustBot.Modules.UserList import UserList from FaustBot.Modules.UserList import UserList
class AllSeenObserver(PrivMsgObserverPrototype): class AllSeenObserver(PrivMsgObserverPrototype):

View File

@@ -1,10 +1,5 @@
import datetime
import time
from FaustBot.Communication.Connection import Connection from FaustBot.Communication.Connection import Connection
from FaustBot.Model.UserProvider import UserProvider
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
from ..Model.i18n import i18n
from FaustBot.Model.BlockedUsers import BlockProvider from FaustBot.Model.BlockedUsers import BlockProvider
class BlockObserver(PrivMsgObserverPrototype): class BlockObserver(PrivMsgObserverPrototype):

View File

@@ -1,10 +1,8 @@
import datetime import datetime
import time
from FaustBot.Communication.Connection import Connection from FaustBot.Communication.Connection import Connection
from FaustBot.Model.UserProvider import UserProvider from FaustBot.Model.UserProvider import UserProvider
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
from ..Model.i18n import i18n
class SeenObserver(PrivMsgObserverPrototype): class SeenObserver(PrivMsgObserverPrototype):

View File

@@ -1,6 +1,4 @@
from wikipedia import wikipedia from wikipedia import wikipedia
from FaustBot.Model.i18n import i18n
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
@@ -17,18 +15,16 @@ class WikiObserver(PrivMsgObserverPrototype):
if data['message'].find('.w ') == -1: if data['message'].find('.w ') == -1:
return return
i18n_server = i18n() w = wikipedia.set_lang('de')
w = wikipedia.set_lang(i18n_server.get_text('wiki_lang', lang=self.config.lang))
q = data['message'].split(' ') q = data['message'].split(' ')
query = '' query = ''
for word in q: for word in q:
if word.strip() != '.w': if word.strip() != '.w':
query += word + ' ' query += word + ' '
w = wikipedia.search(query) w = wikipedia.search(query)
if w.__len__() == 0: # TODO BUG BELOW, ERROR MESSAGE NOT SHOWN! if w.__len__() == 0:
connection.send_back(data['nick'] + ', ' + connection.send_back(data['nick'] + ', ' +
i18n_server.get_text('wiki_fail', 'ich habe dazu keinen eintrag gefunden!',
lang=self.config.lang),
data) data)
return return
try: try: