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 75a22cd..290c27a 100644 Binary files a/locale/de/LC_MESSAGES/discussions.mo and b/locale/de/LC_MESSAGES/discussions.mo differ diff --git a/locale/de/LC_MESSAGES/discussions.po b/locale/de/LC_MESSAGES/discussions.po index 8dd56f1..093c6dd 100644 --- a/locale/de/LC_MESSAGES/discussions.po +++ b/locale/de/LC_MESSAGES/discussions.po @@ -7,28 +7,42 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-06 18:55+0200\n" -"PO-Revision-Date: 2020-04-07 11:53+0200\n" +"POT-Creation-Date: 2020-04-26 22:05+0200\n" +"PO-Revision-Date: 2020-04-27 17:46+0200\n" +"Last-Translator: \n" "Language-Team: \n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.3\n" -"Last-Translator: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"Language: de\n" #: discussions.py:53 #, python-brace-format msgid "Replied to \"{title}\"" msgstr "Antwortete auf „{title}“" -#: discussions.py:56 +#: discussions.py:58 #, python-brace-format msgid "Created \"{title}\"" msgstr "Erstellte „{title}“" -#: discussions.py:73 +#: discussions.py:70 +#, python-brace-format +msgid "Created a poll titled \"{title}\"" +msgstr "Erstellte eine Umfrage „{title}“" + +#: discussions.py:75 +msgid "Option {}" +msgstr "Option {}" + +#: discussions.py:76 +#, python-brace-format +msgid "__[View image]({image_url})__" +msgstr "__[Bild öffnen]({image_url})__" + +#: discussions.py:89 #, python-brace-format msgid "" "[{author}](<{url}f/u/{creatorId}>) 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}"