From b7b54bbde0b98b7d5f8d9858aabd78df4e24d87d Mon Sep 17 00:00:00 2001 From: elpamplina Date: Tue, 25 Feb 2025 18:01:34 +0100 Subject: [PATCH] German translation. Fix broken credential encryption when using foreign charsets. --- CHANGELOG.md | 17 ++++++++++++++ README.md | 3 ++- encrypt.ts | 2 +- lang/de.json | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ main.ts | 3 +++ manifest.json | 2 +- package.json | 2 +- versions.json | 3 ++- 8 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 lang/de.json diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a2a49b2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +## [1.0.8](https://github.com/elpamplina/mastodon-threading/compare/1.0.7...1.0.8) + +### Languages + +* German translation, thanks to [platypusgit](https://github.com/platypusgit). + +### Bug fixes + +* Fix broken credential encryption when using foreign charsets. + +> You MAY need to log in again in your server to get new credentials after this update is applied. + +## [1.0.7](https://github.com/elpamplina/mastodon-threading/releases/tag/1.0.7) + +First release on Obsidian repository. diff --git a/README.md b/README.md index 6c6a8e6..d1eca98 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ Please note that this is a side project I'm working on in my spare time. I canno ## Internationalization -Language definitions are in the `lang` folder. Currently only English (default) and Spanish are supported. Constributions in other languages are GREATLY APPRECIATED!! +Language definitions are in the `lang` folder. Currently only some languages are supported. Constributions in other languages are GREATLY APPRECIATED!! Please send your language definitions via Pull Request on Github, or contact me at for further instructions. @@ -149,6 +149,7 @@ This plugin is free software, released under the [General Public License version This plugin is made and maintained as a side project for amusement only. - Many thanks to Ulises Lafuente (@Rataunderground@paquita.masto.host) for adapting the Mastodon icon. +- Thanks to [platypusgit](https://github.com/platypusgit) for the German translation. - Thanks to Eugen Rochko and all the Mastodon team for creating the best open and free social network ruled by the people. - Thanks to Ryō Igarashi for maintaining the masto.js library. - Thanks to the people at Obsidian for this great software. diff --git a/encrypt.ts b/encrypt.ts index 469b35c..643202e 100644 --- a/encrypt.ts +++ b/encrypt.ts @@ -63,7 +63,7 @@ const decrypt = async (cipher: ArrayBuffer, key: CryptoKey, iv: ArrayBuffer) => return decode(encoded) } -const generateKey = (seed: string) => window.crypto.subtle.digest('SHA-256', unpack(seed)); +const generateKey = (seed: string) => window.crypto.subtle.digest('SHA-256', unpack(encodeURIComponent(seed))); const encryptText = async (key: ArrayBuffer, text: string) => { const cryptoKey = await importKey(key); diff --git a/lang/de.json b/lang/de.json new file mode 100644 index 0000000..603b655 --- /dev/null +++ b/lang/de.json @@ -0,0 +1,61 @@ +{ + "settings": { + "server": "Mastodon Server", + "server_desc": "z.B. mastodon.social", + "server_hint": "Domain Name", + "connect_status": "Mit Mastodon auf {{server}} verbunden", + "disconnect": "Verbindung trennen", + "logged_out": "Vom Server ausgeloggt", + "connect_to": "Mit Mastodon verbinden", + "connect": "Verbinden", + "error": "Fehler beim Verbinden mit dem Server!", + "max_post": "Zeichenbegrenzung", + "max_post_desc": "{{server}} erlaubt Beiträge mit {{max}} Zeichen.", + "visibility_first": "Sichtbarkeit des ersten Beitrags", + "visibility_first_desc": "Erster Beitrag im Thread (oder einzelner Beitrag).", + "visibility_rest": "Sichtbarkeit der folgenden Beiträge", + "visibility_rest_desc": "Darauffolgende Beiträge im Thread.", + "visibility_warning": "Einen gesamten Thread öffentlich zu posten, wird häufig als unhöflich wahrgenommen. Bitte überprüfe, ob dies laut deinen Server-Regeln erlaubt ist.", + "post_counter": "Beitragszähler", + "post_counter_desc": "Füge einen Beitragszähler (z.B. 1/10) am Ende der einzelnen Beiträge des Threads ein.", + "visibility": { + "public": "Öffentlich", + "public_not_recommended": "Öffentlich (Nicht empfohlen)", + "unlisted": "Öffentlich (still) (ungelistet und nicht im Such-Algorithmus)", + "private": "Follower (nur Personen, die dir folgen)" + } + }, + "modal": { + "send_thread_count": "Versende einen Thread an Mastodon mit {{count}} Beiträgen", + "visibility_single": "Sichtbarkeit", + "visibility_first": "Sichtbarkeit des ersten Beitrags", + "visibility_rest": "Sichtbarkeit der folgenden Beiträge im Thread", + "submit": "Versenden", + "no_description": "WARNUNG: Es sind Dateien ohne Beschreibung vorhanden. Trotzdem versenden?" + }, + "command": { + "single_post": "Versende einen einzelnen Beitrag an Mastodon", + "send_thread": "Versende einen Thread an Mastodon", + "insert_separator": "Thread-Trenner manuell einfügen", + "create_fragments": "Thread-Trenner automatisch einfügen", + "remove_separators": "Alle Thread-Trenner entfernen" + }, + "ok": { + "message_posted": "Beitrag versendet", + "thread_posted": "Thread versendet" + }, + "error": { + "session_lost": "Die Mastodon-Session wurde getrennt!", + "not_logged": "Du bist nicht mit Mastodon verbunden. Bitte überprüfe die Plugin-Einstellungen.", + "not_posted": "FEHLER: Dieser Beitrag wurde nicht versendet!", + "no_selection": "Kein Text ausgewählt!", + "no_text": "Kein Text zum Versenden!", + "size_exceeded": "NICHT VERSENDET: Mehr als {{max}} Zeichen in einem Beitrag.", + "file_size_exceeded": "NICHT VERSENDET: Größe der Anhänge wurde überschritten.", + "alt_exceeded": "NICHT VERSENDET: Mehr als {{max}} Zeichen in der Beschreibung.", + "attachment_exceeded": "NICHT VERSENDET: Mehr als {{max}} angehängte Dateien in einem Beitrag.", + "void_fragment": "NICHT VERSENDET: Leere Fragmente können nicht versendet werden! (z.B. Leerzeilen außerhalb des Threads)", + "file_not_found": "FEHLER: Angehängte Dateien konnten nicht gefunden werden.", + "filetype_not_allowed": "FEHLER: Typ des Anhangs wird nicht unterstützt." + } +} diff --git a/main.ts b/main.ts index 5f58642..4268d1d 100644 --- a/main.ts +++ b/main.ts @@ -15,6 +15,7 @@ import {createApp, getAuthToken, getAuthURL, getClient} from "./auth"; import {mastodon} from "masto"; import * as lang_en from 'lang/en.json'; import * as lang_es from 'lang/es.json'; +import * as lang_de from 'lang/de.json'; import { pattern_image, pattern_quote, @@ -79,6 +80,8 @@ export default class MastodonThreading extends Plugin { i18next.addResourceBundle('en', 'plugin-mastodon-threading', lang_en); // @ts-ignore i18next.addResourceBundle('es', 'plugin-mastodon-threading', lang_es); + // @ts-ignore + i18next.addResourceBundle('de', 'plugin-mastodon-threading', lang_de); addIcon('mastodon', ''); await this.loadSettings(); diff --git a/manifest.json b/manifest.json index 2ad90a6..1cd617a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "mastodon-threading", "name": "Mastodon Threading", - "version": "1.0.7", + "version": "1.0.8", "minAppVersion": "1.7.7", "description": "Compose and post threads to Mastodon.", "author": "El Pamplina de Cai", diff --git a/package.json b/package.json index b063309..9db0def 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mastodon-threading", - "version": "1.0.7", + "version": "1.0.8", "description": "Obsidian plugin to compose and post threads to Mastodon", "main": "main.js", "scripts": { diff --git a/versions.json b/versions.json index e70ef73..61d3f9a 100644 --- a/versions.json +++ b/versions.json @@ -3,5 +3,6 @@ "1.0.4": "1.7.7", "1.0.5": "1.7.7", "1.0.6": "1.7.7", - "1.0.7": "1.7.7" + "1.0.7": "1.7.7", + "1.0.8": "1.7.7" } \ No newline at end of file