From 4dcea63f86a1b4bc9af33d69102ce45ded24ef5b Mon Sep 17 00:00:00 2001 From: Frisk Date: Mon, 27 Apr 2020 18:06:48 +0200 Subject: [PATCH] German translation by Markus, small fixes from initial testing --- discussions.py | 15 ++++++----- locale/de/LC_MESSAGES/discussions.mo | Bin 985 -> 1428 bytes locale/de/LC_MESSAGES/discussions.po | 37 ++++++++++++++++++++++----- 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/discussions.py b/discussions.py index d073d9f..2e69ec6 100644 --- a/discussions.py +++ b/discussions.py @@ -59,11 +59,14 @@ def embed_formatter(post, post_type): embed["url"] = "{wikiurl}f/p/{threadId}".format(wikiurl=settings["fandom_discussions"]["wiki_url"], threadId=post["threadId"]) if settings["fandom_discussions"]["appearance"]["embed"]["show_content"]: - npost = DiscussionsFromHellParser(post) - embed["description"] = npost.parse() - if npost.image_only: - embed["image"]["url"] = embed["description"].strip() - embed["description"] = "" + if post.get("jsonModel") is not None: + npost = DiscussionsFromHellParser(post) + embed["description"] = npost.parse() + if npost.image_only: + embed["image"]["url"] = embed["description"].strip() + embed["description"] = "" + else: # Fallback when model is not available + embed["description"] = post.get("rawContent", "") elif post_type == "POLL": embed.event_type = "discussion/poll" poll = post["poll"] @@ -198,7 +201,7 @@ class DiscussionsFromHellParser: for mark in marks: if mark["type"] == "mention": prefix += "[" - suffix = "]({wiki}f/u/{userid}){suffix}".format(wiki=WIKI_SCRIPT_PATH, userid=mark["attrs"]["userId"], suffix=suffix) + suffix = "]({wiki}f/u/{userid}){suffix}".format(wiki=settings["fandom_discussions"]["wiki_url"], userid=mark["attrs"]["userId"], suffix=suffix) elif mark["type"] == "strong": prefix += "**" suffix = "**{suffix}".format(suffix=suffix) diff --git a/locale/de/LC_MESSAGES/discussions.mo b/locale/de/LC_MESSAGES/discussions.mo index 75a22cd6e6cc8b45b7d01a65a4915918c0494da9..290c27a51efefeb0cf0825b9a268f6222a301106 100644 GIT binary patch delta 543 zcmZ9HO-lkn7{_PTvebfJz>C&k9SRXtB0)M8;U(x|9eQCI*ijb7Rdz>0WYKGfAXy`b z=o54cqI>6{YaOEe3K0Yy>hC79_`sjv%=7-d1iRtZ+ic*1z$T#>q(M{AE!4MnXa@R# z7NJk5pF5`zG7rYV127Aof@dHDqdvsI21wz%1f%#r_z77CpF#9#kuN;@gMYyzFcu)> z9BhC(7#jN@EJ5^f4WXf-FBykW?k*M_L?%F#5VB=*Cb>ovO{q)4?ZnW-Xlx+&~cRdu>bVI!NPnOuHt zJ(8ti z3P3y+h{b{YZA=hz&H?EdApbRxo&cmhm>C#=N*I7#FaX)d!oVQS02GG+=c3falGGFh zrRtK*lAP39rO7gkzb8*;a+5VMS1>fRGBwsVFfuUU@=44~FHKBO)eT8a%(YUOEXiCf z=#yAnq8n0_m{**WSdw1^6zyi#QH80rQb) created [{title}](<{url}f/p/{threadId}>) " @@ -37,7 +51,7 @@ msgstr "" "[{author}](<{url}f/u/{creatorId}>) erstellte [{title}](<{url}f/p/{threadId}" ">) in {forumName}" -#: discussions.py:76 +#: discussions.py:92 #, python-brace-format msgid "" "[{author}](<{url}f/u/{creatorId}>) created a [reply](<{url}f/p/{threadId}/r/" @@ -45,3 +59,12 @@ msgid "" msgstr "" "[{author}](<{url}f/u/{creatorId}>) erstellte eine [Antwork](<{url}f/p/" "{threadId}/r/{postId}>) zu [{title}](<{url}f/p/{threadId}>) in {forumName}" + +#: discussions.py:97 +#, python-brace-format +msgid "" +"[{author}](<{url}f/u/{creatorId}>) created a poll [{title}](<{url}f/p/" +"{threadId}>) in {forumName}" +msgstr "" +"[{author}](<{url}f/u/{creatorId}>) erstellte eine Umfrage [{title}](<{url}f/" +"p/{threadId}>) in {forumName}"