Added #20 maybe?

This commit is contained in:
Frisk 2018-07-08 18:44:27 +02:00
parent 13d8dd171d
commit a988aae663
No known key found for this signature in database
GPG key ID: 0E9A7D3C0A01586C
2 changed files with 101 additions and 58 deletions

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: 2018-07-05 20:21+0200\n" "POT-Creation-Date: 2018-07-08 18:43+0200\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"
@ -173,191 +173,227 @@ msgstr ""
msgid "Changed group membership for {target}" msgid "Changed group membership for {target}"
msgstr "" msgstr ""
#: rcgcdw.py:251 rcgcdw.py:253 #: rcgcdw.py:257 rcgcdw.py:259
msgid "none" msgid "none"
msgstr "" msgstr ""
#: rcgcdw.py:254 rcgcdw.py:376 #: rcgcdw.py:260 rcgcdw.py:381
msgid "No description provided" msgid "No description provided"
msgstr "" msgstr ""
#: rcgcdw.py:255 #: rcgcdw.py:261
msgid "Groups changed from {old_groups} to {new_groups}{reason}" msgid "Groups changed from {old_groups} to {new_groups}{reason}"
msgstr "" msgstr ""
#: rcgcdw.py:258 #: rcgcdw.py:264
msgid "Protected {target}" msgid "Protected {target}"
msgstr "" msgstr ""
#: rcgcdw.py:262 #: rcgcdw.py:268
msgid "Changed protection level for {article}" msgid "Changed protection level for {article}"
msgstr "" msgstr ""
#: rcgcdw.py:266 #: rcgcdw.py:272
msgid "Removed protection from {article}" msgid "Removed protection from {article}"
msgstr "" msgstr ""
#: rcgcdw.py:269 #: rcgcdw.py:275
msgid "Changed visibility of revision(s) on page {article} " msgid "Changed visibility of revision(s) on page {article} "
msgstr "" msgstr ""
#: rcgcdw.py:272 #: rcgcdw.py:278
msgid "Imported {article} with {count} revision(s)" msgid "Imported {article} with {count} revision(s)"
msgstr "" msgstr ""
#: rcgcdw.py:275 #: rcgcdw.py:281
msgid "Restored {article}" msgid "Restored {article}"
msgstr "" msgstr ""
#: rcgcdw.py:278 #: rcgcdw.py:284
msgid "Changed visibility of log events" msgid "Changed visibility of log events"
msgstr "" msgstr ""
#: rcgcdw.py:281 #: rcgcdw.py:287
msgid "Imported interwiki" msgid "Imported interwiki"
msgstr "" msgstr ""
#: rcgcdw.py:284 #: rcgcdw.py:290
msgid "Edited abuse filter number {number}" msgid "Edited abuse filter number {number}"
msgstr "" msgstr ""
#: rcgcdw.py:287 #: rcgcdw.py:293
msgid "Merged revision histories of {article} into {dest}" msgid "Merged revision histories of {article} into {dest}"
msgstr "" msgstr ""
#: rcgcdw.py:290 #: rcgcdw.py:296
msgid "Added an entry to the interwiki table" msgid "Added an entry to the interwiki table"
msgstr "" msgstr ""
#: rcgcdw.py:291 rcgcdw.py:295 #: rcgcdw.py:297 rcgcdw.py:301
msgid "Prefix: {prefix}, website: {website} | {desc}" msgid "Prefix: {prefix}, website: {website} | {desc}"
msgstr "" msgstr ""
#: rcgcdw.py:294 #: rcgcdw.py:300
msgid "Edited an entry in interwiki table" msgid "Edited an entry in interwiki table"
msgstr "" msgstr ""
#: rcgcdw.py:298 #: rcgcdw.py:304
msgid "Deleted an entry in interwiki table" msgid "Deleted an entry in interwiki table"
msgstr "" msgstr ""
#: rcgcdw.py:299 #: rcgcdw.py:305
msgid "Prefix: {prefix} | {desc}" msgid "Prefix: {prefix} | {desc}"
msgstr "" msgstr ""
#: rcgcdw.py:302 #: rcgcdw.py:308
msgid "Changed the content model of the page {article}" msgid "Changed the content model of the page {article}"
msgstr "" msgstr ""
#: rcgcdw.py:303 #: rcgcdw.py:309
msgid "Model changed from {old} to {new}: {reason}" msgid "Model changed from {old} to {new}: {reason}"
msgstr "" msgstr ""
#: rcgcdw.py:306 #: rcgcdw.py:312
msgid "Edited the sprite for {article}" msgid "Edited the sprite for {article}"
msgstr "" msgstr ""
#: rcgcdw.py:309 #: rcgcdw.py:315
msgid "Created the sprite sheet for {article}" msgid "Created the sprite sheet for {article}"
msgstr "" msgstr ""
#: rcgcdw.py:312 #: rcgcdw.py:318
msgid "Edited the slice for {article}" msgid "Edited the slice for {article}"
msgstr "" msgstr ""
#: rcgcdw.py:315 #: rcgcdw.py:321
msgid "Created a tag \"{tag}\"" msgid "Created a tag \"{tag}\""
msgstr "" msgstr ""
#: rcgcdw.py:319 #: rcgcdw.py:325
msgid "Deleted a tag \"{tag}\"" msgid "Deleted a tag \"{tag}\""
msgstr "" msgstr ""
#: rcgcdw.py:323 #: rcgcdw.py:329
msgid "Activated a tag \"{tag}\"" msgid "Activated a tag \"{tag}\""
msgstr "" msgstr ""
#: rcgcdw.py:326 #: rcgcdw.py:332
msgid "Deactivated a tag \"{tag}\"" msgid "Deactivated a tag \"{tag}\""
msgstr "" msgstr ""
#: rcgcdw.py:347 #: rcgcdw.py:353
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
#: rcgcdw.py:469 #: rcgcdw.py:474
msgid "Unable to process the event" msgid "Unable to process the event"
msgstr "" msgstr ""
#: rcgcdw.py:469 #: rcgcdw.py:474
msgid "error" msgid "error"
msgstr "" msgstr ""
#: rcgcdw.py:549 #: rcgcdw.py:554
msgid "Daily overview" msgid "Daily overview"
msgstr "" msgstr ""
#: rcgcdw.py:565 #: rcgcdw.py:570
msgid " ({} actions)" msgid " ({} actions)"
msgstr "" msgstr ""
#: rcgcdw.py:566 #: rcgcdw.py:571
msgid " UTC ({} actions)" msgid " UTC ({} actions)"
msgstr "" msgstr ""
#: rcgcdw.py:568 rcgcdw.py:569 #: rcgcdw.py:573 rcgcdw.py:574
msgid "But nobody came" msgid "But nobody came"
msgstr "" msgstr ""
#: rcgcdw.py:573 #: rcgcdw.py:578
msgid "Admin actions" msgid "Admin actions"
msgstr "" msgstr ""
#: rcgcdw.py:573 #: rcgcdw.py:578
msgid "Bytes changed" msgid "Bytes changed"
msgstr "" msgstr ""
#: rcgcdw.py:573 #: rcgcdw.py:578
msgid "Day score" msgid "Day score"
msgstr "" msgstr ""
#: rcgcdw.py:573 #: rcgcdw.py:578
msgid "Edits made" msgid "Edits made"
msgstr "" msgstr ""
#: rcgcdw.py:573 #: rcgcdw.py:578
msgid "Most active hours" msgid "Most active hours"
msgstr "" msgstr ""
#: rcgcdw.py:573 #: rcgcdw.py:578
msgid "Most active users" msgid "Most active users"
msgstr "" msgstr ""
#: rcgcdw.py:573 #: rcgcdw.py:578
msgid "New articles" msgid "New articles"
msgstr "" msgstr ""
#: rcgcdw.py:573 #: rcgcdw.py:578
msgid "New files" msgid "New files"
msgstr "" msgstr ""
#: rcgcdw.py:573 #: rcgcdw.py:578
msgid "Unique contributors" msgid "Unique contributors"
msgstr "" msgstr ""
#: rcgcdw.py:662 #: rcgcdw.py:668
msgid "Connection to {wiki} seems to be stable now." msgid "Connection to {wiki} seems to be stable now."
msgstr "" msgstr ""
#: rcgcdw.py:662 rcgcdw.py:715 #: rcgcdw.py:668 rcgcdw.py:723
msgid "Connection status" msgid "Connection status"
msgstr "" msgstr ""
#: rcgcdw.py:715 #: rcgcdw.py:723
msgid "{wiki} seems to be down or unreachable." msgid "{wiki} seems to be down or unreachable."
msgstr "" msgstr ""
#: rcgcdw.py:737 #: rcgcdw.py:745
msgid "{wiki} is back up!" msgid "autopatrol"
msgstr ""
#: rcgcdw.py:745
msgid "autoreview"
msgstr ""
#: rcgcdw.py:745
msgid "bot"
msgstr ""
#: rcgcdw.py:745
msgid "bureaucrat"
msgstr ""
#: rcgcdw.py:745
msgid "director"
msgstr ""
#: rcgcdw.py:745
msgid "directors"
msgstr ""
#: rcgcdw.py:745
msgid "editor"
msgstr ""
#: rcgcdw.py:745
msgid "reviewer"
msgstr ""
#: rcgcdw.py:745
msgid "sysop"
msgstr ""
#: rcgcdw.py:745
msgid "wiki_guardian"
msgstr "" msgstr ""

View file

@ -245,14 +245,20 @@ def webhook_formatter(action, STATIC, **params):
elif action == 20: elif action == 20:
link = "https://{wiki}.gamepedia.com/User:".format(wiki=settings["wiki"])+params["title"].split(":")[1] link = "https://{wiki}.gamepedia.com/User:".format(wiki=settings["wiki"])+params["title"].split(":")[1]
embed["title"] = _("Changed group membership for {target}").format(target=params["title"].split(":")[1]) embed["title"] = _("Changed group membership for {target}").format(target=params["title"].split(":")[1])
if params["old_groups"].count(' ') < params["new_groups"].count(' ') or params["old_groups"] == "none": #TODO Hardcoded value, depends on translation if len(params["old_groups"]) < len(params["new_groups"]):
embed["thumbnail"]["url"] = "https://i.imgur.com/WnGhF5g.gif" embed["thumbnail"]["url"] = "https://i.imgur.com/WnGhF5g.gif"
if len(params["old_groups"]) < 4: old_groups = []
params["old_groups"] = _("none") new_groups = []
if len(params["new_groups"]) < 4: for name in params["old_groups"]:
params["new_groups"] = _("none") old_groups.append(_(name))
for name in params["new_groups"]:
new_groups.append(_(name))
if len(old_groups) == 0:
old_groups = _("none")
if len(new_groups) == 0:
new_groups = _("none")
reason = ": {desc}".format(desc=params["desc"]) if params["desc"]!=_("No description provided") else "" reason = ": {desc}".format(desc=params["desc"]) if params["desc"]!=_("No description provided") else ""
params["desc"] = _("Groups changed from {old_groups} to {new_groups}{reason}").format(old_groups=params["old_groups"], new_groups=params["new_groups"], reason=reason) params["desc"] = _("Groups changed from {old_groups} to {new_groups}{reason}").format(old_groups=", ".join(old_groups), new_groups=', '.join(new_groups), reason=reason)
elif action == 2: elif action == 2:
link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_")) link = "https://{wiki}.gamepedia.com/{article}".format(wiki=settings["wiki"], article=params["title"].replace(" ", "_"))
embed["title"] = _("Protected {target}").format(target=params["title"]) embed["title"] = _("Protected {target}").format(target=params["title"])
@ -425,7 +431,7 @@ def first_pass(change): #I've decided to split the embed formatter and change ha
elif logtype=="block": elif logtype=="block":
webhook_formatter(19, STATIC_VARS, user=change["user"], blocked_user=change["title"], desc=parsedcomment) webhook_formatter(19, STATIC_VARS, user=change["user"], blocked_user=change["title"], desc=parsedcomment)
elif logtype=="rights": elif logtype=="rights":
webhook_formatter(20, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, old_groups=', '.join(change["logparams"]["oldgroups"]), new_groups=', '.join(change["logparams"]["newgroups"])) webhook_formatter(20, STATIC_VARS, user=change["user"], title=change["title"], desc=parsedcomment, old_groups=change["logparams"]["oldgroups"], new_groups=change["logparams"]["newgroups"])
elif logtype=="abusefilter": elif logtype=="abusefilter":
webhook_formatter(21, STATIC_VARS, user=change["user"], desc=parsedcomment, filternr=change["logparams"]['1']) webhook_formatter(21, STATIC_VARS, user=change["user"], desc=parsedcomment, filternr=change["logparams"]['1'])
elif logtype=="interwiki" and logaction=="iw_add": elif logtype=="interwiki" and logaction=="iw_add":
@ -588,6 +594,7 @@ class recent_changes_class(object):
last_downtime = 0 last_downtime = 0
clock = 0 clock = 0
tags = {} tags = {}
groups = {}
unsent_messages = [] unsent_messages = []
streak = -1 streak = -1
if settings["limitrefetch"] != -1: if settings["limitrefetch"] != -1:
@ -735,7 +742,7 @@ recent_changes.fetch(amount=settings["limitrefetch" ] if settings["limitrefetch"
schedule.every(settings["cooldown"]).seconds.do(recent_changes.fetch) schedule.every(settings["cooldown"]).seconds.do(recent_changes.fetch)
if 1==2: #dummy for future translations if 1==2: #dummy for future translations
print (_("{wiki} is back up!")) print (_("director"), _("bot"), _("editor"), _("directors"), _("sysop"), _("bureaucrat"), _("reviewer"), _("autoreview"), _("autopatrol"), _("wiki_guardian"))
if settings["overview"]: if settings["overview"]:
schedule.every().day.at("{}:{}".format(time.strptime(settings["overview_time"], '%H:%M').tm_hour, time.strptime(settings["overview_time"], '%H:%M').tm_min)).do(day_overview) schedule.every().day.at("{}:{}".format(time.strptime(settings["overview_time"], '%H:%M').tm_hour, time.strptime(settings["overview_time"], '%H:%M').tm_min)).do(day_overview)