diff --git a/src/rc_formatters.py b/src/rc_formatters.py index 600b177..ec0d9f3 100644 --- a/src/rc_formatters.py +++ b/src/rc_formatters.py @@ -474,12 +474,22 @@ def compact_formatter(action, change, parsed_comment, categories, recent_changes author=author, author_url=author_url, wiki_name=change["logparams"].get("wiki", _("Unknown")), comment=parsed_comment ) + elif action == "datadump/generate": + content = "🏅 " + _("[{author}]({author_url}) generated *{file}* dump{comment}").format( + author=author, author_url=author_url, file=change["logparams"]["filename"], + comment=parsed_comment + ) + elif action == "datadump/delete": + content = "🏅 " + _("[{author}]({author_url}) deleted *{file}* dump{comment}").format( + author=author, author_url=author_url, file=change["logparams"]["filename"], + comment=parsed_comment + ) elif action == "pagetranslation/mark": link = create_article_path(change["title"]) if "?" in link: - link = link + "&oldid=" + change["logparams"]["revision"] + link = link + "&oldid={}".format(change["logparams"]["revision"]) else: - link = link + "?oldid=" + change["logparams"]["revision"] + link = link + "?oldid={}".format(change["logparams"]["revision"]) link = link_formatter(link) content = "🌐 " + _("[{author}]({author_url}) marked [{article}]({article_url}) for translation{comment}").format( author=author, author_url=author_url, @@ -594,9 +604,9 @@ def compact_formatter(action, change, parsed_comment, categories, recent_changes elif action == "translationreview/message": link = create_article_path(change["title"]) if "?" in link: - link = link + "&oldid=" + change["logparams"]["revision"] + link = link + "&oldid={}".format(change["logparams"]["revision"]) else: - link = link + "?oldid=" + change["logparams"]["revision"] + link = link + "?oldid={}".format(change["logparams"]["revision"]) link = link_formatter(link) content = "🌐 " + _("[{author}]({author_url}) reviewed translation [{article}]({article_url}){comment}").format( author=author, author_url=author_url, @@ -1095,41 +1105,47 @@ def embed_formatter(action, change, parsed_comment, categories, recent_changes): link = create_article_path("Special:Tags") embed["title"] = _("Deactivated a tag \"{tag}\"").format(tag=change["logparams"]["tag"]) elif action == "managewiki/settings": # Miraheze's ManageWiki extension https://github.com/miraheze/ManageWiki - link = create_article_path("") + link = create_article_path(change["title"]) embed["title"] = _("Changed wiki settings") if change["logparams"].get("changes", ""): embed.add_field("Setting", change["logparams"].get("changes")) elif action == "managewiki/delete": embed["title"] = _("Deleted a \"{wiki}\" wiki").format(wiki=change["logparams"].get("wiki", _("Unknown"))) - link = create_article_path("") + link = create_article_path(change["title"]) elif action == "managewiki/lock": embed["title"] = _("Locked a \"{wiki}\" wiki").format(wiki=change["logparams"].get("wiki", _("Unknown"))) - link = create_article_path("") + link = create_article_path(change["title"]) elif action == "managewiki/namespaces": embed["title"] = _("Modified a \"{namespace_name}\" namespace").format(namespace_name=change["logparams"].get("namespace", _("Unknown"))) - link = create_article_path("") + link = create_article_path(change["title"]) embed.add_field(_('Wiki'), change["logparams"].get("wiki", _("Unknown"))) elif action == "managewiki/namespaces-delete": embed["title"] = _("Deleted a \"{namespace_name}\" namespace").format( namespace_name=change["logparams"].get("namespace", _("Unknown"))) - link = create_article_path("") + link = create_article_path(change["title"]) embed.add_field(_('Wiki'), change["logparams"].get("wiki", _("Unknown"))) elif action == "managewiki/rights": group_name = change["title"].split("/permissions/", 1)[1] embed["title"] = _("Modified \"{usergroup_name}\" usergroup").format(usergroup_name=group_name) - link = create_article_path("") + link = create_article_path(change["title"]) elif action == "managewiki/undelete": embed["title"] = _("Restored a \"{wiki}\" wiki").format(wiki=change["logparams"].get("wiki", _("Unknown"))) - link = create_article_path("") + link = create_article_path(change["title"]) elif action == "managewiki/unlock": embed["title"] = _("Unlocked a \"{wiki}\" wiki").format(wiki=change["logparams"].get("wiki", _("Unknown"))) - link = create_article_path("") + link = create_article_path(change["title"]) + elif action == "datadump/generate": + embed["title"] = _("Generated {file} dump").format(file=change["logparams"]["filename"]) + link = create_article_path(change["title"]) + elif action == "datadump/delete": + embed["title"] = _("Deleted {file} dump").format(file=change["logparams"]["filename"]) + link = create_article_path(change["title"]) elif action == "pagetranslation/mark": link = create_article_path(change["title"]) if "?" in link: - link = link + "&oldid=" + change["logparams"]["revision"] + link = link + "&oldid={}".format(change["logparams"]["revision"]) else: - link = link + "?oldid=" + change["logparams"]["revision"] + link = link + "?oldid={}".format(change["logparams"]["revision"]) embed["title"] = _("Marked \"{article}\" for translation").format(article=change["title"]) elif action == "pagetranslation/unmark": link = create_article_path(change["title"]) @@ -1177,9 +1193,9 @@ def embed_formatter(action, change, parsed_comment, categories, recent_changes): elif action == "translationreview/message": link = create_article_path(change["title"]) if "?" in link: - link = link + "&oldid=" + change["logparams"]["revision"] + link = link + "&oldid={}".format(change["logparams"]["revision"]) else: - link = link + "?oldid=" + change["logparams"]["revision"] + link = link + "?oldid={}".format(change["logparams"]["revision"]) embed["title"] = _("Reviewed translation \"{article}\"").format(article=change["title"]) elif action == "translationreview/group": link = create_article_path(change["title"])