Various fixes, added polish translation

This commit is contained in:
Frisk 2020-03-16 01:20:20 +01:00
parent 6e1c7f987a
commit 2b4719212c
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
8 changed files with 707 additions and 581 deletions

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-19 16:31+0100\n" "POT-Creation-Date: 2020-03-16 00:49+0100\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"

View file

@ -75,7 +75,7 @@ def weighted_average(value, weight, new_value):
def link_formatter(link): def link_formatter(link):
"""Formats a link to not embed it""" """Formats a link to not embed it"""
return "<" + re.sub(r"([ )])", "\\\\\\1", link) + ">" return "<" + re.sub(r"([)])", "\\\\\\1", link).replace(" ", "_") + ">"
class ContentParser(HTMLParser): class ContentParser(HTMLParser):

File diff suppressed because it is too large Load diff

View file

@ -226,7 +226,7 @@ def compact_formatter(action, change, parsed_comment, categories):
author = change["user"] author = change["user"]
parsed_comment = "" if parsed_comment is None else " *("+parsed_comment+")*" parsed_comment = "" if parsed_comment is None else " *("+parsed_comment+")*"
if action in ["edit", "new"]: if action in ["edit", "new"]:
edit_link = link_formatter("{wiki}/index.php?title={article}&curid={pageid}&diff={diff}&oldid={oldrev}".format( edit_link = link_formatter("{wiki}index.php?title={article}&curid={pageid}&diff={diff}&oldid={oldrev}".format(
wiki=WIKI_SCRIPT_PATH, pageid=change["pageid"], diff=change["revid"], oldrev=change["old_revid"], wiki=WIKI_SCRIPT_PATH, pageid=change["pageid"], diff=change["revid"], oldrev=change["old_revid"],
article=change["title"])) article=change["title"]))
edit_size = change["newlen"] - change["oldlen"] edit_size = change["newlen"] - change["oldlen"]
@ -300,23 +300,23 @@ def compact_formatter(action, change, parsed_comment, categories):
if "sitewide" not in change["logparams"]: if "sitewide" not in change["logparams"]:
restriction_description = "" restriction_description = ""
if change["logparams"]["restrictions"]["pages"]: if change["logparams"]["restrictions"]["pages"]:
restriction_description = _(" on pages: *") restriction_description = _(" on pages: ")
for page in change["logparams"]["restrictions"]["pages"]: for page in change["logparams"]["restrictions"]["pages"]:
restricted_pages = [i["page_title"] for i in change["logparams"]["restrictions"]["pages"]] restricted_pages = ["*{page}*".format(page=i["page_title"]) for i in change["logparams"]["restrictions"]["pages"]]
restriction_description = restriction_description + "*, *".join(restricted_pages) restriction_description = restriction_description + ", ".join(restricted_pages)
if change["logparams"]["restrictions"]["namespaces"]: if change["logparams"]["restrictions"]["namespaces"]:
namespaces = [] namespaces = []
if restriction_description: if restriction_description:
restriction_description = restriction_description + _("* and namespaces: *") restriction_description = restriction_description + _(" and namespaces: ")
else: else:
restriction_description = _(" on namespaces: *") restriction_description = _(" on namespaces: ")
for namespace in change["logparams"]["restrictions"]["namespaces"]: for namespace in change["logparams"]["restrictions"]["namespaces"]:
if str(namespace) in recent_changes.namespaces: # if we have cached namespace name for given namespace number, add its name to the list if str(namespace) in recent_changes.namespaces: # if we have cached namespace name for given namespace number, add its name to the list
namespaces.append(recent_changes.namespaces[str(namespace)]["*"]) namespaces.append("*{ns}*".format(ns=recent_changes.namespaces[str(namespace)]["*"]))
else: else:
namespaces.append(namespace) namespaces.append("*{ns}*".format(ns=namespace))
restriction_description = restriction_description + "*, *".join(namespaces) restriction_description = restriction_description + ", ".join(namespaces)
restriction_description = restriction_description + "*." restriction_description = restriction_description + "."
if len(restriction_description) > 1020: if len(restriction_description) > 1020:
logger.debug(restriction_description) logger.debug(restriction_description)
restriction_description = restriction_description[:1020] + "" restriction_description = restriction_description[:1020] + ""
@ -696,7 +696,7 @@ def embed_formatter(action, change, parsed_comment, categories):
if "sitewide" not in change["logparams"]: if "sitewide" not in change["logparams"]:
restriction_description = "" restriction_description = ""
if change["logparams"]["restrictions"]["pages"]: if change["logparams"]["restrictions"]["pages"]:
restriction_description = _("Block from editing the following pages: ") restriction_description = _("Blocked from editing the following pages: ")
for page in change["logparams"]["restrictions"]["pages"]: for page in change["logparams"]["restrictions"]["pages"]:
restricted_pages = ["*"+i["page_title"]+"*" for i in change["logparams"]["restrictions"]["pages"]] restricted_pages = ["*"+i["page_title"]+"*" for i in change["logparams"]["restrictions"]["pages"]]
restriction_description = restriction_description + ", ".join(restricted_pages) restriction_description = restriction_description + ", ".join(restricted_pages)
@ -705,7 +705,7 @@ def embed_formatter(action, change, parsed_comment, categories):
if restriction_description: if restriction_description:
restriction_description = restriction_description + _(" and namespaces: ") restriction_description = restriction_description + _(" and namespaces: ")
else: else:
restriction_description = _("Block from editing pages on following namespaces: ") restriction_description = _("Blocked from editing pages on following namespaces: ")
for namespace in change["logparams"]["restrictions"]["namespaces"]: for namespace in change["logparams"]["restrictions"]["namespaces"]:
if str(namespace) in recent_changes.namespaces: # if we have cached namespace name for given namespace number, add its name to the list if str(namespace) in recent_changes.namespaces: # if we have cached namespace name for given namespace number, add its name to the list
namespaces.append("*{ns}*".format(ns=recent_changes.namespaces[str(namespace)]["*"])) namespaces.append("*{ns}*".format(ns=recent_changes.namespaces[str(namespace)]["*"]))