diff --git a/mastodon_email_bridge/mastodon_email_bridge.py b/mastodon_email_bridge/mastodon_email_bridge.py index 325638a..281f3eb 100755 --- a/mastodon_email_bridge/mastodon_email_bridge.py +++ b/mastodon_email_bridge/mastodon_email_bridge.py @@ -275,7 +275,8 @@ class MastodonEmailBridge: return data fields_to_translate = [ 'spoiler', - 'content' + 'content', + 'description' ] counter = 0 for field in fields_to_translate: @@ -305,7 +306,7 @@ class MastodonEmailBridge: "source": source_language, "target": destination_language, "api_key": self.config['libretranslate_token'], - "format": "text", + "format": "html", } response = self.translate_session.post( url=f"{self.config['libretranslate_url']}", diff --git a/templates/new_post.html.j2 b/templates/new_post.html.j2 index a80f814..ac3ca8d 100644 --- a/templates/new_post.html.j2 +++ b/templates/new_post.html.j2 @@ -219,6 +219,8 @@ {{ data['reblog']['translated_spoiler'] }} (Original spoiler) + {% else %} + {% endif %}
{{ data['reblog']['spoiler'] }} @@ -232,6 +234,8 @@ {{ data['reblog']['translated_content'] }}
(Original content) + {% else %} + {% endif %}
{{ data['reblog']['content'] }}