+ >
+ );
+}
+
type CustomThemeDraft = { id: string | null; name: string; baseTheme: DesignTheme; css: string };
/** Shared stroke-icon wrapper for the custom-theme-card action row, so all
@@ -8141,6 +8443,8 @@ function OptionsDialog({
) : active.id === "sicherheit" ? (
+ ) : active.id === "konto" ? (
+
) : active.id === "meldungen" ? (
) : (
diff --git a/web/src/locales/cs-CZ.json b/web/src/locales/cs-CZ.json
index 3a80e7d..1bef152 100644
--- a/web/src/locales/cs-CZ.json
+++ b/web/src/locales/cs-CZ.json
@@ -289,6 +289,7 @@
"options.cancel": "Zrušit",
"options.notImplemented": "Toto nastavení zatím není implementováno.",
"options.section.anwendung": "Aplikace",
+ "options.section.konto": "Účet",
"options.section.wiedergabe": "Přehrávání",
"options.section.aufnahme": "Snímání",
"options.section.design": "Vzhled",
@@ -930,5 +931,68 @@
"securitySettings.masterNew": "Nové hlavní heslo",
"securitySettings.masterRepeat": "Zopakovat",
"securitySettings.masterMismatch": "Hesla se neshodují.",
- "securitySettings.masterNote": "Dobře si ho zapamatujte: bez něj přijdete o identity a uložená hesla."
+ "securitySettings.masterNote": "Dobře si ho zapamatujte: bez něj přijdete o identity a uložená hesla.",
+ "sync.subtitle": "Tvá data na všech zařízeních",
+ "sync.intro": "Účet je jen náhodné číslo, volitelně s heslem. Žádný e-mail, žádné jméno. Vše se před nahráním zašifruje na tvém zařízení. Server vidí jen nečitelná data.",
+ "sync.create.title": "Nový účet",
+ "sync.create.withPassword": "Vygenerovat i náhodné heslo (doporučeno)",
+ "sync.create.withPasswordHint": "Bez hesla stačí k tvým datům samotné číslo účtu.",
+ "sync.create.button": "Vytvořit účet",
+ "sync.create.busy": "Účet se vytváří …",
+ "sync.login.title": "Existující účet",
+ "sync.number": "Číslo účtu",
+ "sync.password": "Heslo",
+ "sync.passwordOptional": "Heslo (pokud existuje)",
+ "sync.login.hint": "Data účtu pak nahradí data na tomto zařízení.",
+ "sync.login.button": "Přihlásit",
+ "sync.server": "Synchronizační server",
+ "sync.serverHint": "Účet existuje jen na serveru, na kterém byl vytvořen.",
+ "sync.account.title": "Tvůj účet",
+ "sync.copy": "Kopírovat",
+ "sync.copied": "Zkopírováno",
+ "sync.show": "Zobrazit",
+ "sync.hide": "Skrýt",
+ "sync.noPassword": "Bez hesla",
+ "sync.keepSafe": "Číslo a heslo dobře uschovej. Když je ztratíš, nikdo tvá data neobnoví, ani my.",
+ "sync.recoveryFile": "Stáhnout soubor pro obnovení",
+ "sync.qr.show": "Zobrazit QR kód",
+ "sync.qr.hide": "Skrýt QR kód",
+ "sync.qr.hint": "Naskenuj ho druhým zařízením a přihlas se tam. Kdo kód uvidí, má přístup k tvému účtu.",
+ "sync.password.add": "Přidat heslo",
+ "sync.password.remove": "Odebrat heslo",
+ "sync.password.addConfirm": "Vygenerovat nové náhodné heslo? Ostatní zařízení se pak musí znovu přihlásit číslem a heslem.",
+ "sync.password.removeConfirm": "Odebrat heslo? Pak bude stačit samotné číslo účtu. Ostatní zařízení se musí znovu přihlásit.",
+ "sync.categories": "Synchronizovat",
+ "sync.category.identities": "Identity (včetně soukromých klíčů)",
+ "sync.category.favorites": "Oblíbené, hesla kanálů a kontakty",
+ "sync.category.settings": "Nastavení",
+ "sync.category.designs": "Vzhledy a balíčky ikon",
+ "sync.category.whisper": "Seznamy šeptání",
+ "sync.categoriesHint": "Zvuková zařízení, hlasitosti, klávesa PTT a záznamy chatu zůstávají vždy na zařízení.",
+ "sync.status": "Stav",
+ "sync.status.syncing": "Synchronizuje se …",
+ "sync.status.last": "Naposledy synchronizováno: {time}",
+ "sync.status.never": "Zatím nesynchronizováno",
+ "sync.conflict.title": "Synchronizace",
+ "sync.conflict.text": "Od poslední synchronizace se změnilo něco na tomto zařízení i v účtu. Který stav má platit?",
+ "sync.conflict.local": "Nahrát stav tohoto zařízení",
+ "sync.conflict.server": "Načíst stav z účtu",
+ "sync.syncNow": "Synchronizovat teď",
+ "sync.serverInfo": "Server: {server}",
+ "sync.logout": "Odhlásit",
+ "sync.logoutConfirm": "Odhlásit toto zařízení z účtu? Účet i data zůstanou zachovány.",
+ "sync.delete": "Smazat účet",
+ "sync.deleteConfirm": "Trvale smazat účet a všechna jeho data na serveru? Data na tomto zařízení zůstanou.",
+ "sync.link.title": "Připojit k účtu",
+ "sync.link.prompt": "Připojit toto zařízení k účtu {number}? Data účtu nahradí data na tomto zařízení.",
+ "sync.link.connect": "Připojit",
+ "sync.error.password_required": "Tento účet má heslo.",
+ "sync.error.unreachable": "Synchronizační server není dostupný.",
+ "sync.error.not_found": "Účet nenalezen nebo špatné heslo. Pokud bylo heslo změněno na jiném zařízení, přihlas se znovu.",
+ "sync.error.rate_limited": "Příliš mnoho požadavků, zkus to později.",
+ "sync.error.full": "Synchronizační server teď nepřijímá nové účty.",
+ "sync.error.pow_required": "Bezpečnostní kontrola selhala, zkus to znovu.",
+ "sync.error.conflict": "Jiné zařízení mezitím něco změnilo.",
+ "sync.error.payload_too_large": "Příliš mnoho dat pro synchronizaci (max. 1 MB).",
+ "sync.error.generic": "Synchronizace selhala."
}
diff --git a/web/src/locales/de.json b/web/src/locales/de.json
index cee278a..213ff1c 100644
--- a/web/src/locales/de.json
+++ b/web/src/locales/de.json
@@ -289,6 +289,7 @@
"options.cancel": "Abbrechen",
"options.notImplemented": "Diese Einstellungen sind noch nicht implementiert.",
"options.section.anwendung": "Anwendung",
+ "options.section.konto": "Konto",
"options.section.wiedergabe": "Wiedergabe",
"options.section.aufnahme": "Aufnahme",
"options.section.design": "Design",
@@ -930,5 +931,68 @@
"securitySettings.masterNew": "Neues Master Passwort",
"securitySettings.masterRepeat": "Wiederholen",
"securitySettings.masterMismatch": "Die Passwörter stimmen nicht überein.",
- "securitySettings.masterNote": "Merk es dir gut: Ohne das Passwort sind Identitäten und gespeicherte Passwörter weg."
+ "securitySettings.masterNote": "Merk es dir gut: Ohne das Passwort sind Identitäten und gespeicherte Passwörter weg.",
+ "sync.subtitle": "Deine Daten auf allen Geräten",
+ "sync.intro": "Ein Konto besteht nur aus einer zufälligen Nummer, optional mit Passwort. Keine Mail, kein Name. Alles wird auf deinem Gerät verschlüsselt, bevor es hochgeladen wird. Der Server sieht nur unlesbare Daten.",
+ "sync.create.title": "Neues Konto",
+ "sync.create.withPassword": "Zusätzlich ein zufälliges Passwort erzeugen (empfohlen)",
+ "sync.create.withPasswordHint": "Ohne Passwort reicht die Kontonummer allein, um an deine Daten zu kommen.",
+ "sync.create.button": "Konto erstellen",
+ "sync.create.busy": "Konto wird erstellt …",
+ "sync.login.title": "Bestehendes Konto",
+ "sync.number": "Kontonummer",
+ "sync.password": "Passwort",
+ "sync.passwordOptional": "Passwort (falls vorhanden)",
+ "sync.login.hint": "Die Daten des Kontos ersetzen danach die auf diesem Gerät.",
+ "sync.login.button": "Anmelden",
+ "sync.server": "Sync-Server",
+ "sync.serverHint": "Ein Konto gibt es nur auf dem Server, auf dem es erstellt wurde.",
+ "sync.account.title": "Dein Konto",
+ "sync.copy": "Kopieren",
+ "sync.copied": "Kopiert",
+ "sync.show": "Anzeigen",
+ "sync.hide": "Verbergen",
+ "sync.noPassword": "Kein Passwort",
+ "sync.keepSafe": "Bewahre Nummer und Passwort gut auf. Gehen sie verloren, kann niemand deine Daten wiederherstellen, auch wir nicht.",
+ "sync.recoveryFile": "Wiederherstellungsdatei herunterladen",
+ "sync.qr.show": "QR-Code anzeigen",
+ "sync.qr.hide": "QR-Code verbergen",
+ "sync.qr.hint": "Mit dem anderen Gerät scannen, um es dort anzumelden. Wer den Code sieht, hat Zugriff auf dein Konto.",
+ "sync.password.add": "Passwort hinzufügen",
+ "sync.password.remove": "Passwort entfernen",
+ "sync.password.addConfirm": "Ein neues zufälliges Passwort erzeugen? Andere Geräte müssen sich danach mit Nummer und Passwort neu anmelden.",
+ "sync.password.removeConfirm": "Passwort entfernen? Dann reicht die Kontonummer allein. Andere Geräte müssen sich neu anmelden.",
+ "sync.categories": "Synchronisieren",
+ "sync.category.identities": "Identitäten (inkl. privater Schlüssel)",
+ "sync.category.favorites": "Favoriten, Channel-Passwörter und Kontakte",
+ "sync.category.settings": "Einstellungen",
+ "sync.category.designs": "Designs und Icon Packs",
+ "sync.category.whisper": "Whisper-Listen",
+ "sync.categoriesHint": "Audiogeräte, Lautstärken, PTT-Taste und Chatprotokolle bleiben immer auf dem Gerät.",
+ "sync.status": "Status",
+ "sync.status.syncing": "Wird synchronisiert …",
+ "sync.status.last": "Zuletzt synchronisiert: {time}",
+ "sync.status.never": "Noch nicht synchronisiert",
+ "sync.conflict.title": "Synchronisierung",
+ "sync.conflict.text": "Auf diesem Gerät und im Konto wurde seit dem letzten Abgleich etwas geändert. Welcher Stand soll gelten?",
+ "sync.conflict.local": "Diesen Stand hochladen",
+ "sync.conflict.server": "Stand aus dem Konto laden",
+ "sync.syncNow": "Jetzt synchronisieren",
+ "sync.serverInfo": "Server: {server}",
+ "sync.logout": "Abmelden",
+ "sync.logoutConfirm": "Dieses Gerät vom Konto abmelden? Konto und Daten bleiben erhalten.",
+ "sync.delete": "Konto löschen",
+ "sync.deleteConfirm": "Konto mit allen Daten auf dem Server endgültig löschen? Die Daten auf diesem Gerät bleiben.",
+ "sync.link.title": "Mit Konto verbinden",
+ "sync.link.prompt": "Dieses Gerät mit dem Konto {number} verbinden? Die Daten des Kontos ersetzen die auf diesem Gerät.",
+ "sync.link.connect": "Verbinden",
+ "sync.error.password_required": "Dieses Konto hat ein Passwort.",
+ "sync.error.unreachable": "Sync-Server nicht erreichbar.",
+ "sync.error.not_found": "Konto nicht gefunden oder Passwort falsch. Wurde das Passwort auf einem anderen Gerät geändert, melde dich neu an.",
+ "sync.error.rate_limited": "Zu viele Anfragen, bitte später nochmal.",
+ "sync.error.full": "Der Sync-Server nimmt gerade keine neuen Konten an.",
+ "sync.error.pow_required": "Sicherheitsprüfung fehlgeschlagen, bitte nochmal versuchen.",
+ "sync.error.conflict": "Ein anderes Gerät hat inzwischen etwas geändert.",
+ "sync.error.payload_too_large": "Zu viele Daten für die Synchronisierung (max. 1 MB).",
+ "sync.error.generic": "Synchronisierung fehlgeschlagen."
}
diff --git a/web/src/locales/en.json b/web/src/locales/en.json
index 36b22c5..e480e0e 100644
--- a/web/src/locales/en.json
+++ b/web/src/locales/en.json
@@ -289,6 +289,7 @@
"options.cancel": "Cancel",
"options.notImplemented": "This setting isn't implemented yet.",
"options.section.anwendung": "Application",
+ "options.section.konto": "Account",
"options.section.wiedergabe": "Playback",
"options.section.aufnahme": "Capture",
"options.section.design": "Appearance",
@@ -930,5 +931,68 @@
"securitySettings.masterNew": "New master password",
"securitySettings.masterRepeat": "Repeat",
"securitySettings.masterMismatch": "The passwords don't match.",
- "securitySettings.masterNote": "Remember it well: without it, identities and saved passwords are lost."
+ "securitySettings.masterNote": "Remember it well: without it, identities and saved passwords are lost.",
+ "sync.subtitle": "Your data on all your devices",
+ "sync.intro": "An account is just a random number, optionally with a password. No email, no name. Everything is encrypted on your device before it is uploaded. The server only sees unreadable data.",
+ "sync.create.title": "New account",
+ "sync.create.withPassword": "Also generate a random password (recommended)",
+ "sync.create.withPasswordHint": "Without a password, the account number alone gives access to your data.",
+ "sync.create.button": "Create account",
+ "sync.create.busy": "Creating account …",
+ "sync.login.title": "Existing account",
+ "sync.number": "Account number",
+ "sync.password": "Password",
+ "sync.passwordOptional": "Password (if any)",
+ "sync.login.hint": "The account's data then replaces the data on this device.",
+ "sync.login.button": "Log in",
+ "sync.server": "Sync server",
+ "sync.serverHint": "An account only exists on the server it was created on.",
+ "sync.account.title": "Your account",
+ "sync.copy": "Copy",
+ "sync.copied": "Copied",
+ "sync.show": "Show",
+ "sync.hide": "Hide",
+ "sync.noPassword": "No password",
+ "sync.keepSafe": "Keep the number and password safe. If you lose them, nobody can recover your data, not even us.",
+ "sync.recoveryFile": "Download recovery file",
+ "sync.qr.show": "Show QR code",
+ "sync.qr.hide": "Hide QR code",
+ "sync.qr.hint": "Scan it with the other device to log in there. Anyone who sees this code can access your account.",
+ "sync.password.add": "Add password",
+ "sync.password.remove": "Remove password",
+ "sync.password.addConfirm": "Generate a new random password? Other devices will have to log in again with number and password.",
+ "sync.password.removeConfirm": "Remove the password? The account number alone will then be enough. Other devices will have to log in again.",
+ "sync.categories": "Sync",
+ "sync.category.identities": "Identities (including private keys)",
+ "sync.category.favorites": "Favorites, channel passwords and contacts",
+ "sync.category.settings": "Settings",
+ "sync.category.designs": "Designs and icon packs",
+ "sync.category.whisper": "Whisper lists",
+ "sync.categoriesHint": "Audio devices, volumes, PTT key and chat logs always stay on the device.",
+ "sync.status": "Status",
+ "sync.status.syncing": "Syncing …",
+ "sync.status.last": "Last synced: {time}",
+ "sync.status.never": "Not synced yet",
+ "sync.conflict.title": "Sync",
+ "sync.conflict.text": "Both this device and the account changed since the last sync. Which one should win?",
+ "sync.conflict.local": "Upload this device's data",
+ "sync.conflict.server": "Load the account's data",
+ "sync.syncNow": "Sync now",
+ "sync.serverInfo": "Server: {server}",
+ "sync.logout": "Log out",
+ "sync.logoutConfirm": "Log this device out of the account? The account and its data are kept.",
+ "sync.delete": "Delete account",
+ "sync.deleteConfirm": "Permanently delete the account and all its data on the server? The data on this device stays.",
+ "sync.link.title": "Connect to account",
+ "sync.link.prompt": "Connect this device to account {number}? The account's data replaces the data on this device.",
+ "sync.link.connect": "Connect",
+ "sync.error.password_required": "This account has a password.",
+ "sync.error.unreachable": "Sync server not reachable.",
+ "sync.error.not_found": "Account not found or wrong password. If the password was changed on another device, log in again.",
+ "sync.error.rate_limited": "Too many requests, please try again later.",
+ "sync.error.full": "The sync server isn't accepting new accounts right now.",
+ "sync.error.pow_required": "Security check failed, please try again.",
+ "sync.error.conflict": "Another device changed something in the meantime.",
+ "sync.error.payload_too_large": "Too much data to sync (max. 1 MB).",
+ "sync.error.generic": "Sync failed."
}
diff --git a/web/src/locales/fa.json b/web/src/locales/fa.json
index 8bb682f..e7cf32c 100644
--- a/web/src/locales/fa.json
+++ b/web/src/locales/fa.json
@@ -289,6 +289,7 @@
"options.cancel": "لغو",
"options.notImplemented": "این تنظیم هنوز پیادهسازی نشده است.",
"options.section.anwendung": "برنامه",
+ "options.section.konto": "حساب",
"options.section.wiedergabe": "پخش",
"options.section.aufnahme": "ضبط",
"options.section.design": "ظاهر",
@@ -929,5 +930,68 @@
"securitySettings.masterNew": "رمز اصلی جدید",
"securitySettings.masterRepeat": "تکرار",
"securitySettings.masterMismatch": "رمزها یکسان نیستند.",
- "securitySettings.masterNote": "آن را به خاطر بسپارید: بدون آن، هویتها و رمزهای ذخیرهشده از دست میروند."
+ "securitySettings.masterNote": "آن را به خاطر بسپارید: بدون آن، هویتها و رمزهای ذخیرهشده از دست میروند.",
+ "sync.subtitle": "دادههای تو روی همه دستگاهها",
+ "sync.intro": "حساب فقط یک شماره تصادفی است، در صورت تمایل با رمز عبور. بدون ایمیل، بدون نام. همه چیز پیش از بارگذاری روی دستگاه تو رمزگذاری میشود. سرور فقط دادههای ناخوانا میبیند.",
+ "sync.create.title": "حساب جدید",
+ "sync.create.withPassword": "یک رمز عبور تصادفی هم بساز (پیشنهادی)",
+ "sync.create.withPasswordHint": "بدون رمز عبور، شماره حساب بهتنهایی برای دسترسی به دادههایت کافی است.",
+ "sync.create.button": "ساخت حساب",
+ "sync.create.busy": "در حال ساخت حساب …",
+ "sync.login.title": "حساب موجود",
+ "sync.number": "شماره حساب",
+ "sync.password": "رمز عبور",
+ "sync.passwordOptional": "رمز عبور (در صورت وجود)",
+ "sync.login.hint": "پس از آن دادههای حساب جایگزین دادههای این دستگاه میشوند.",
+ "sync.login.button": "ورود",
+ "sync.server": "سرور همگامسازی",
+ "sync.serverHint": "هر حساب فقط روی سروری وجود دارد که روی آن ساخته شده است.",
+ "sync.account.title": "حساب تو",
+ "sync.copy": "کپی",
+ "sync.copied": "کپی شد",
+ "sync.show": "نمایش",
+ "sync.hide": "پنهان",
+ "sync.noPassword": "بدون رمز عبور",
+ "sync.keepSafe": "شماره و رمز عبور را در جای امن نگه دار. اگر گم شوند، هیچکس نمیتواند دادههایت را بازیابی کند، حتی ما.",
+ "sync.recoveryFile": "دانلود فایل بازیابی",
+ "sync.qr.show": "نمایش کد QR",
+ "sync.qr.hide": "پنهان کردن کد QR",
+ "sync.qr.hint": "با دستگاه دیگر اسکن کن تا آنجا وارد شوی. هر کسی این کد را ببیند به حسابت دسترسی دارد.",
+ "sync.password.add": "افزودن رمز عبور",
+ "sync.password.remove": "حذف رمز عبور",
+ "sync.password.addConfirm": "یک رمز عبور تصادفی جدید ساخته شود؟ دستگاههای دیگر باید با شماره و رمز عبور دوباره وارد شوند.",
+ "sync.password.removeConfirm": "رمز عبور حذف شود؟ آنگاه شماره حساب بهتنهایی کافی است. دستگاههای دیگر باید دوباره وارد شوند.",
+ "sync.categories": "همگامسازی",
+ "sync.category.identities": "هویتها (شامل کلیدهای خصوصی)",
+ "sync.category.favorites": "علاقهمندیها، رمز کانالها و مخاطبان",
+ "sync.category.settings": "تنظیمات",
+ "sync.category.designs": "طرحها و بستههای آیکون",
+ "sync.category.whisper": "فهرستهای نجوا",
+ "sync.categoriesHint": "دستگاههای صوتی، حجم صدا، کلید PTT و گزارشهای چت همیشه روی دستگاه میمانند.",
+ "sync.status": "وضعیت",
+ "sync.status.syncing": "در حال همگامسازی …",
+ "sync.status.last": "آخرین همگامسازی: {time}",
+ "sync.status.never": "هنوز همگامسازی نشده",
+ "sync.conflict.title": "همگامسازی",
+ "sync.conflict.text": "از آخرین همگامسازی، هم این دستگاه و هم حساب تغییر کردهاند. کدام معتبر باشد؟",
+ "sync.conflict.local": "بارگذاری دادههای این دستگاه",
+ "sync.conflict.server": "بارگیری دادههای حساب",
+ "sync.syncNow": "همگامسازی اکنون",
+ "sync.serverInfo": "سرور: {server}",
+ "sync.logout": "خروج",
+ "sync.logoutConfirm": "این دستگاه از حساب خارج شود؟ حساب و دادههایش حفظ میشوند.",
+ "sync.delete": "حذف حساب",
+ "sync.deleteConfirm": "حساب و همه دادههایش روی سرور برای همیشه حذف شود؟ دادههای این دستگاه باقی میمانند.",
+ "sync.link.title": "اتصال به حساب",
+ "sync.link.prompt": "این دستگاه به حساب {number} متصل شود؟ دادههای حساب جایگزین دادههای این دستگاه میشوند.",
+ "sync.link.connect": "اتصال",
+ "sync.error.password_required": "این حساب رمز عبور دارد.",
+ "sync.error.unreachable": "سرور همگامسازی در دسترس نیست.",
+ "sync.error.not_found": "حساب پیدا نشد یا رمز عبور اشتباه است. اگر رمز عبور روی دستگاه دیگری تغییر کرده، دوباره وارد شو.",
+ "sync.error.rate_limited": "درخواستها بیش از حد است، لطفاً بعداً دوباره امتحان کن.",
+ "sync.error.full": "سرور همگامسازی فعلاً حساب جدید نمیپذیرد.",
+ "sync.error.pow_required": "بررسی امنیتی ناموفق بود، دوباره امتحان کن.",
+ "sync.error.conflict": "دستگاه دیگری در این فاصله چیزی را تغییر داده است.",
+ "sync.error.payload_too_large": "داده برای همگامسازی بیش از حد است (حداکثر ۱ مگابایت).",
+ "sync.error.generic": "همگامسازی ناموفق بود."
}
diff --git a/web/src/locales/zh-CN.json b/web/src/locales/zh-CN.json
index 2e285ad..626fd75 100644
--- a/web/src/locales/zh-CN.json
+++ b/web/src/locales/zh-CN.json
@@ -228,6 +228,7 @@
"options.cancel": "取消",
"options.notImplemented": "此设置尚未实现。",
"options.section.anwendung": "应用",
+ "options.section.konto": "账户",
"options.section.wiedergabe": "播放",
"options.section.aufnahme": "录音",
"options.section.design": "外观",
@@ -929,5 +930,68 @@
"securitySettings.masterNew": "新主密码",
"securitySettings.masterRepeat": "重复",
"securitySettings.masterMismatch": "两次密码不一致。",
- "securitySettings.masterNote": "请牢记:没有它,身份和已保存的密码将丢失。"
+ "securitySettings.masterNote": "请牢记:没有它,身份和已保存的密码将丢失。",
+ "sync.subtitle": "在所有设备上使用你的数据",
+ "sync.intro": "账户只是一个随机号码,可选附加密码。无需邮箱,无需姓名。所有数据在上传前都会在你的设备上加密,服务器只能看到无法读取的数据。",
+ "sync.create.title": "新账户",
+ "sync.create.withPassword": "同时生成随机密码(推荐)",
+ "sync.create.withPasswordHint": "没有密码时,仅凭账户号码就能访问你的数据。",
+ "sync.create.button": "创建账户",
+ "sync.create.busy": "正在创建账户 …",
+ "sync.login.title": "已有账户",
+ "sync.number": "账户号码",
+ "sync.password": "密码",
+ "sync.passwordOptional": "密码(如有)",
+ "sync.login.hint": "之后账户中的数据将替换此设备上的数据。",
+ "sync.login.button": "登录",
+ "sync.server": "同步服务器",
+ "sync.serverHint": "账户只存在于创建它的服务器上。",
+ "sync.account.title": "你的账户",
+ "sync.copy": "复制",
+ "sync.copied": "已复制",
+ "sync.show": "显示",
+ "sync.hide": "隐藏",
+ "sync.noPassword": "无密码",
+ "sync.keepSafe": "请妥善保管号码和密码。一旦丢失,任何人都无法恢复你的数据,包括我们。",
+ "sync.recoveryFile": "下载恢复文件",
+ "sync.qr.show": "显示二维码",
+ "sync.qr.hide": "隐藏二维码",
+ "sync.qr.hint": "用另一台设备扫描即可在那里登录。看到此二维码的人都能访问你的账户。",
+ "sync.password.add": "添加密码",
+ "sync.password.remove": "移除密码",
+ "sync.password.addConfirm": "生成新的随机密码?其他设备之后需要用号码和密码重新登录。",
+ "sync.password.removeConfirm": "移除密码?之后仅凭账户号码即可访问。其他设备需要重新登录。",
+ "sync.categories": "同步内容",
+ "sync.category.identities": "身份(包括私钥)",
+ "sync.category.favorites": "收藏、频道密码和联系人",
+ "sync.category.settings": "设置",
+ "sync.category.designs": "主题和图标包",
+ "sync.category.whisper": "悄悄话列表",
+ "sync.categoriesHint": "音频设备、音量、按键通话键和聊天记录始终保留在本设备上。",
+ "sync.status": "状态",
+ "sync.status.syncing": "正在同步 …",
+ "sync.status.last": "上次同步:{time}",
+ "sync.status.never": "尚未同步",
+ "sync.conflict.title": "同步",
+ "sync.conflict.text": "自上次同步以来,此设备和账户都有更改。以哪个为准?",
+ "sync.conflict.local": "上传此设备的数据",
+ "sync.conflict.server": "加载账户中的数据",
+ "sync.syncNow": "立即同步",
+ "sync.serverInfo": "服务器:{server}",
+ "sync.logout": "退出登录",
+ "sync.logoutConfirm": "将此设备退出账户?账户及其数据会保留。",
+ "sync.delete": "删除账户",
+ "sync.deleteConfirm": "永久删除服务器上的账户及其所有数据?此设备上的数据会保留。",
+ "sync.link.title": "连接账户",
+ "sync.link.prompt": "将此设备连接到账户 {number}?账户中的数据将替换此设备上的数据。",
+ "sync.link.connect": "连接",
+ "sync.error.password_required": "此账户设有密码。",
+ "sync.error.unreachable": "无法连接同步服务器。",
+ "sync.error.not_found": "账户不存在或密码错误。如果密码已在其他设备上更改,请重新登录。",
+ "sync.error.rate_limited": "请求过多,请稍后再试。",
+ "sync.error.full": "同步服务器暂不接受新账户。",
+ "sync.error.pow_required": "安全检查失败,请重试。",
+ "sync.error.conflict": "另一台设备在此期间做了更改。",
+ "sync.error.payload_too_large": "同步数据过多(最多 1 MB)。",
+ "sync.error.generic": "同步失败。"
}
diff --git a/web/src/main.tsx b/web/src/main.tsx
index 78509eb..4bf9337 100644
--- a/web/src/main.tsx
+++ b/web/src/main.tsx
@@ -1,17 +1,31 @@
import './storageFallback'
-import { StrictMode, useState, type FormEvent } from 'react'
+import { StrictMode, useState, type FormEvent, type ReactNode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import './styles/greenteaspeak.css'
import './App.css'
import { LanguageProvider, useT } from './i18n'
import { discardVault, hasVault, unlockVault } from './vault'
+import {
+ SYNC_CATEGORIES,
+ accountInfo,
+ formatAccountNumber,
+ loginSyncAccount,
+ normalizePassword,
+ pullAtStartup,
+ resolveConflict,
+ startAutoSync,
+ syncErrorKey,
+ takeSyncLink,
+} from './sync'
const root = createRoot(document.getElementById('root')!)
-// App reads its stored identities/favorites while loading, so it's imported only after the vault is open.
+// App reads its stored identities/favorites while loading, so it's imported only after the vault is open
+// and the sync account (Options -> Konto) had its chance to bring in newer data.
async function start() {
const { default: App } = await import('./App.tsx')
+ startAutoSync()
root.render(
@@ -19,6 +33,103 @@ async function start() {
)
}
+const dialog = (node: ReactNode) => root.render({node})
+
+async function boot() {
+ const link = takeSyncLink()
+ if (link) return dialog()
+ // Don't hold the client hostage to a slow sync server.
+ const deadline = Date.now() + 5000
+ const result = await Promise.race([
+ pullAtStartup(deadline),
+ new Promise<'ok'>((resolve) => setTimeout(() => resolve('ok'), 5000)),
+ ])
+ if (result === 'conflict') return dialog()
+ void start()
+}
+
+/** Opened through the QR code / link from Options -> Konto on another device. */
+function SyncLinkDialog({ link }: { link: { number: string; password?: string; server: string } }) {
+ const t = useT()
+ const [password, setPassword] = useState(link.password ?? '')
+ const [askPassword, setAskPassword] = useState(false)
+ const [error, setError] = useState('')
+ const [busy, setBusy] = useState(false)
+ const submit = async (e: FormEvent) => {
+ e.preventDefault()
+ setBusy(true)
+ setError('')
+ try {
+ if (!password) {
+ const info = await accountInfo(link.number, link.server)
+ if (!info.exists) throw new Error('not_found')
+ if (info.hasPassword) {
+ setAskPassword(true)
+ setBusy(false)
+ return
+ }
+ }
+ await loginSyncAccount(link.number, password ? normalizePassword(password) : undefined, link.server, SYNC_CATEGORIES)
+ void start()
+ } catch (err) {
+ setError(t(syncErrorKey(err)))
+ setBusy(false)
+ }
+ }
+ return (
+