From 4a5c92f0e924c0027e2febd6acfbc19a92224742 Mon Sep 17 00:00:00 2001 From: h Date: Mon, 19 Oct 2026 03:27:04 +0000 Subject: [PATCH] feat(frontend): storage, trash, policy, stories, shares, jobs, bots, media, login and notes speak russian and english --- .../src/lib/components/LoginScreen.svelte | 10 +- .../src/lib/components/MediaViewer.svelte | 39 +-- frontend/src/lib/components/TrackChat.svelte | 25 +- .../annotations/AnnotationEditor.svelte | 13 +- .../annotations/AnnotationList.svelte | 7 +- .../annotations/AnnotationsPanel.svelte | 3 +- .../src/lib/components/bots/BotsPanel.svelte | 48 ++-- .../src/lib/components/disk/ScopeFiles.svelte | 67 +++-- .../lib/components/disk/StorageChatRow.svelte | 4 +- .../lib/components/disk/StoragePanel.svelte | 113 +++++---- .../src/lib/components/disk/StorageRow.svelte | 5 +- .../src/lib/components/disk/TrashPanel.svelte | 115 +++++---- .../src/lib/components/jobs/JobList.svelte | 64 ++--- .../src/lib/components/jobs/JobsPanel.svelte | 51 ++-- .../src/lib/components/media/AlbumTile.svelte | 7 +- .../src/lib/components/media/AudioFile.svelte | 8 +- .../src/lib/components/media/FileChip.svelte | 7 +- .../src/lib/components/media/VideoNote.svelte | 5 +- .../lib/components/media/VoiceMessage.svelte | 11 +- .../lib/components/policy/PolicyCard.svelte | 45 ++-- .../lib/components/policy/PolicyDialog.svelte | 5 +- .../lib/components/policy/PolicyEditor.svelte | 60 +++-- .../settings/AddAccountDialog.svelte | 47 ++-- .../lib/components/shares/ShareDialog.svelte | 121 ++++----- .../components/shares/ShareLinkField.svelte | 3 +- .../lib/components/shares/SharesPanel.svelte | 62 +++-- .../components/social/CallbacksPanel.svelte | 7 +- .../lib/components/social/LinksPanel.svelte | 5 +- .../components/social/ReactionsPanel.svelte | 9 +- .../stories/AllStoriesArchive.svelte | 11 +- .../components/stories/StoriesArchive.svelte | 17 +- .../lib/components/stories/StoryTile.svelte | 18 +- .../lib/components/stories/StoryViewer.svelte | 32 ++- frontend/src/lib/format/media.ts | 14 +- frontend/src/lib/format/policy.ts | 107 ++++---- frontend/src/lib/format/shares.ts | 25 +- frontend/src/lib/format/storage.ts | 24 +- frontend/src/lib/i18n/messages.ts | 24 ++ frontend/src/lib/i18n/messages/bots.ts | 29 +++ frontend/src/lib/i18n/messages/jobs.ts | 84 +++++++ frontend/src/lib/i18n/messages/login.ts | 49 ++++ frontend/src/lib/i18n/messages/media.ts | 51 ++++ frontend/src/lib/i18n/messages/notes.ts | 11 + frontend/src/lib/i18n/messages/policy.ts | 146 +++++++++++ frontend/src/lib/i18n/messages/shares.ts | 139 +++++++++++ frontend/src/lib/i18n/messages/social.ts | 17 ++ frontend/src/lib/i18n/messages/storage.ts | 234 ++++++++++++++++++ frontend/src/lib/i18n/messages/stories.ts | 39 +++ frontend/src/lib/i18n/messages/track.ts | 24 ++ frontend/src/lib/i18n/messages/ui.ts | 27 ++ frontend/src/lib/stores/shares.svelte.ts | 4 +- 51 files changed, 1504 insertions(+), 588 deletions(-) create mode 100644 frontend/src/lib/i18n/messages/bots.ts create mode 100644 frontend/src/lib/i18n/messages/jobs.ts create mode 100644 frontend/src/lib/i18n/messages/login.ts create mode 100644 frontend/src/lib/i18n/messages/media.ts create mode 100644 frontend/src/lib/i18n/messages/notes.ts create mode 100644 frontend/src/lib/i18n/messages/policy.ts create mode 100644 frontend/src/lib/i18n/messages/shares.ts create mode 100644 frontend/src/lib/i18n/messages/social.ts create mode 100644 frontend/src/lib/i18n/messages/storage.ts create mode 100644 frontend/src/lib/i18n/messages/stories.ts create mode 100644 frontend/src/lib/i18n/messages/track.ts create mode 100644 frontend/src/lib/i18n/messages/ui.ts diff --git a/frontend/src/lib/components/LoginScreen.svelte b/frontend/src/lib/components/LoginScreen.svelte index d37de4a..09ff7b4 100644 --- a/frontend/src/lib/components/LoginScreen.svelte +++ b/frontend/src/lib/components/LoginScreen.svelte @@ -1,6 +1,7 @@
-
Здесь пока нет сообщений
+
{t("track.empty")}

- {#if tracked} - {title} - отслеживается — новые сообщения и статистика собираются автоматически. - {:else} - Включите отслеживание, чтобы собирать сообщения, медиа и статистику по - этому чату. - {/if} + {tracked ? t("track.tracked", { title }) : t("track.hint")}

{#if tracked} {:else} {/if}
diff --git a/frontend/src/lib/components/annotations/AnnotationEditor.svelte b/frontend/src/lib/components/annotations/AnnotationEditor.svelte index bdadd9e..6962c9f 100644 --- a/frontend/src/lib/components/annotations/AnnotationEditor.svelte +++ b/frontend/src/lib/components/annotations/AnnotationEditor.svelte @@ -1,5 +1,6 @@ {#if chatId === null || messageId === null} - + {:else}
diff --git a/frontend/src/lib/components/bots/BotsPanel.svelte b/frontend/src/lib/components/bots/BotsPanel.svelte index 36153a8..c152c4a 100644 --- a/frontend/src/lib/components/bots/BotsPanel.svelte +++ b/frontend/src/lib/components/bots/BotsPanel.svelte @@ -8,6 +8,8 @@ import Button from "#lib/components/ui/Button.svelte"; import Icon from "#lib/components/ui/Icon.svelte"; import Spinner from "#lib/components/ui/Spinner.svelte"; + import { t } from "#lib/i18n/locale.svelte.js"; + import type { MessageKey } from "#lib/i18n/messages.js"; import { accounts } from "#lib/stores/accounts.svelte.js"; import { toasts } from "#lib/stores/toasts.svelte.js"; import { ui } from "#lib/stores/ui.svelte.js"; @@ -17,14 +19,19 @@ let token = $state(""); let adding = $state(false); - const statusLabels: Record = { - error: "ошибка", - ok: "слушает", - pending: "подключается", - removed: "отключён", - unauthorized: "токен отклонён", + const STATUS_KEYS: Record = { + error: "bots.status.error", + ok: "bots.status.ok", + pending: "bots.status.pending", + removed: "bots.status.removed", + unauthorized: "bots.status.unauthorized", }; + function statusLabel(status: string): string { + const key = STATUS_KEYS[status]; + return key ? t(key) : status; + } + async function load() { loading = true; try { @@ -49,7 +56,7 @@ await load(); await accounts.load(); } catch { - toasts.error("Не похоже на токен бота"); + toasts.error(t("bots.badToken")); } finally { adding = false; } @@ -81,7 +88,7 @@ {#if loading} {:else if bots.length === 0} -

Ботов пока нет.

+

{t("bots.empty")}

{:else}
    {#each bots as bot (bot.bot_id)} @@ -94,9 +101,9 @@ > {botName(bot)} - {statusLabels[bot.status] ?? bot.status} + {statusLabel(bot.status)} {#if bot.account_id !== null} - · аккаунт {bot.account_id} + · {t("bots.account", { id: bot.account_id })} {/if} {#if bot.status_detail} @@ -105,7 +112,7 @@ {#if bot.enabled} +
-

- Бот входит по MTProto отдельной авторизацией — это не отнимает getUpdates у - того, кто держит того же бота через Bot API, и не требует вебхука. Дальше он - становится обычным аккаунтом архива: чаты, сообщения, медиа и участники - групп видны там же, где переписка остальных аккаунтов. -

-

- Прошлое подтягивается из очереди недоставленных апдейтов, которую Telegram - держит для бота; история диалогов боту запрещена, глубже этой очереди - заглянуть нельзя. В личке бот видит каждого, кто ему написал; в группах всё - — только при выключенном privacy mode. Отключение убирает токен и сессию, - архив остаётся. -

+

{t("bots.login")}

+

{t("bots.history")}