Skip to content

Commit 9d5ccb3

Browse files
committed
adding first Language pack
1 parent 32e16e4 commit 9d5ccb3

14 files changed

+32
-33
lines changed

Diff for: plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def __init__(self, config=None):
88
# meta
99
#
1010

11-
def help_text(self):
11+
def help_text(self, bot):
1212
return ""
1313

1414
# irc event handlers

Diff for: plugins/alive.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from plugin import Plugin
22

33
class Alive(Plugin):
4-
def help_text(self):
5-
return "!gt - Guten Tag wuenschen."
4+
def help_text(self, bot):
5+
return bot.translate("alive_help")
66

77
def on_msg(self, bot, user_nick, host, channel, message):
88
if message.lower().startswith('!gt'):
9-
bot.send_message(channel, "Ich lebe noch, {nick}".format(nick=user_nick))
9+
bot.send_message(channel, bot.translate("alive_str1").format(nick=user_nick))
1010

1111
def on_privmsg(self, bot, user_nick, host, message):
1212
if message.lower().startswith('!gt'):
13-
bot.send_message(user_nick, "Ich lebe noch, {nick}".format(nick=user_nick))
13+
bot.send_message(user_nick, bot.translate("alive_str1").format(nick=user_nick))
1414

Diff for: plugins/eightball.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from plugin import Plugin
33

44
class Eightball(Plugin):
5-
def help_text(self):
6-
return "fragen beantworten in Form: <soll/kann/darf/muss> ich * [<oder> *]"
5+
def help_text(self, bot):
6+
return bot.translate("eightball_help")
77

88
def answer(self, bot, msg, recipient, nick=None):
99
keywords = ["kann ich", "darf ich", "soll ich", "muss ich"]

Diff for: plugins/flatter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from plugin import Plugin
33

44
class Flatter(Plugin):
5-
def help_text(self):
6-
return "!schmeichle <nick> - Jemandem ein Kompliment machen."
5+
def help_text(self, bot):
6+
return bot.translate("flatter_help")
77

88
def on_msg(self, bot, user_nick, host, channel, message):
99
if message.lower().startswith('!schmeichle'):

Diff for: plugins/help.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
class Help(Plugin):
44
def on_msg(self, bot, user_nick, host, channel, message):
55
if message.lower().startswith('!help'):
6-
bot.send_message(user_nick, "Erzaehl mir doch was du brauchst, mein Junge.")
7-
bot.send_message(user_nick, "Ich kann bisher:")
6+
bot.send_message(user_nick, bot.translate("help_hello"))
7+
bot.send_message(user_nick, bot.translate("help_intro"))
88
for plugin in bot.plugins:
99
text = plugin.help_text()
1010
if text != "":

Diff for: plugins/insult.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from plugin import Plugin
33

44
class Insult(Plugin):
5-
def help_text(self):
6-
return "!beleidige <nick> - Jemanden beleidigen."
5+
def help_text(self, bot):
6+
return bot.translate("insult_help")
77

88
def on_msg(self, bot, user_nick, host, channel, message):
99
if message.lower().startswith('!beleidige'):

Diff for: plugins/istheinternetonfire.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
class istheinternetonfire(Plugin):
55

6-
def help_text(self):
7-
return ("!security - Aktuelle Sicherheitsprobleme im Internetz anzeigen")
6+
def help_text(self, bot):
7+
return bot.translate("security_help")
88

99
def on_msg(self, bot, user_nick, host, channel, message):
1010
url = "https://istheinternetonfire.com/status.txt"

Diff for: plugins/lineart.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from plugin import Plugin
33

44
class Insult(Plugin):
5-
def help_text(self):
6-
return "!lineart - Zeige eine lineart"
5+
def help_text(self, bot):
6+
return bot.translate("lineart_help")
77

88
def on_msg(self, bot, user_nick, host, channel, message):
99
if message.lower().startswith('!lineart'):

Diff for: plugins/openstatus.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ def __init__(self, config=None):
1212
print "OpenStatus was not properly configured in your config.ini"
1313
super(OpenStatus, self).__init__()
1414

15-
def help_text(self):
16-
return ("!offen - Aktuelle Geraete in der K4CG anzeigen lassen")
15+
def help_text(self, bot):
16+
return bot.translate("openstatus_help")
1717

1818
def on_privmsg(self, bot, user_nick, host, channel, message):
19-
if message.startswith("!offen"):
19+
if message.startswith("!offen") or message.startswith("!open"):
2020
if hasattr(self, "openstatus"):
2121
msg = bot.sanitize(self.get_status())
2222
msg = json.loads(msg)

Diff for: plugins/playlist.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
class Playlist(Plugin):
44

5-
def help_text(self):
6-
return "!np - Dir sagen welche Musik so laeuft."
5+
def help_text(self, bot):
6+
return bot.translate("playlist_help")
77

88
def on_msg(self, bot, user_nick, host, channel, message):
99
if message.lower().startswith('!np'):

Diff for: plugins/tell.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def __init__(self, config=None):
1616
super(Tell, self).__init__()
1717

1818

19-
def help_text(self):
20-
return "!sage <nick> <nachricht> - Einem Benutzer eine Nachricht ausrichten wenn er das naechste mal auftaucht."
19+
def help_text(self, bot):
20+
return bot.translate("tell_help")
2121

2222
def tell(self, bot, user_nick, receiver, message):
2323
reply_to = user_nick if receiver == bot.nick else receiver

Diff for: plugins/temperature.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from plugin import Plugin
77

88
class Temperature(Plugin):
9-
def help_text(self):
10-
return "!kt - Zeige aktuelle Temperatur in der K4CG."
9+
def help_text(self, bot):
10+
return bot.translate("temp_help")
1111

1212
def on_msg(self, bot, user_nick, host, channel, message):
1313
if message.lower().startswith('!kt'):

Diff for: plugins/urls.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from plugin import Plugin
22

33
class Urls(Plugin):
4-
def help_text(self):
5-
return ("!private <link> - Einen Link teilen ohne dass er im Wiki gelistet wird. (alternativ: !pr, !nsfw)\n" +
6-
"oder dir den Titel von URLs sagen die du in den Channel postest")
4+
def help_text(self, bot):
5+
return (bot.translate("url_help"+"\n") + bot.translate("url_help2"))
76

87
def on_msg(self, bot, user_nick, host, channel, message):
98
if bot.httpregex.search(message.lower()) is not None:

Diff for: rezeptionistin.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def __init__(self):
4343
self.port=int(self.config.get('IRC', 'port'))
4444
self.nick=self.config.get('IRC', 'nick')
4545
self.ircchan=self.config.get('IRC', 'ircchan').split(",")
46-
self.debugchan=self.config.get('IRC', 'debugchan')
46+
#self.debugchan=self.config.get('IRC', 'debugchan')
4747
self.useragent=self.config.get('HTTP', 'useragent')
48-
self.language=config.get('Language','language')
48+
self.language=self.config.get('Language','language')
4949

5050
# load translation keys
5151

@@ -63,7 +63,7 @@ def __init__(self):
6363
# Helper Methods
6464
#
6565

66-
def translate(language_key):
66+
def translate(language_key, nothing=""):
6767
return self.translations.get(self.language, language_key)
6868

6969
def nickserv_identify():
@@ -159,7 +159,7 @@ def run(self):
159159
self.irc.start()
160160
for channel in self.ircchan:
161161
self.irc.join(channel)
162-
self.irc.join(self.debugchan)
162+
# self.irc.join(self.debugchan)
163163

164164
# Run Eventloop
165165
try:

0 commit comments

Comments
 (0)