feat(frontend): profile media, files and links tabs speak russian and english
This commit is contained in:
1 parent
cff493f5dd
commit
0cd34f3037
4 files changed
+29
-14
No files matched your search
@@ -7,6 +7,7 @@
|
||||
import Spinner from "#lib/components/ui/Spinner.svelte";
|
||||
import { formatListDate } from "#lib/format/datetime.js";
|
||||
import { safeHref } from "#lib/format/url.js";
|
||||
import { t } from "#lib/i18n/locale.svelte.js";
|
||||
import { accounts } from "#lib/stores/accounts.svelte.js";
|
||||
import { ui } from "#lib/stores/ui.svelte.js";
|
||||
import { goto } from "$app/navigation";
|
||||
@@ -83,7 +84,7 @@
|
||||
{#if loading}
|
||||
<div class="center"><Spinner /></div>
|
||||
{:else}
|
||||
<EmptyState title="Нет ссылок" />
|
||||
<EmptyState title={t("social.links.empty")} />
|
||||
{/if}
|
||||
{:else}
|
||||
<ul class="list">
|
||||
@@ -122,7 +123,7 @@
|
||||
onclick={() => loadMore()}
|
||||
type="button"
|
||||
>
|
||||
{loading ? "Загрузка…" : "Показать ещё"}
|
||||
{loading ? t("ui.loading") : t("ui.showMore")}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
import Spinner from "#lib/components/ui/Spinner.svelte";
|
||||
import { formatListDate } from "#lib/format/datetime.js";
|
||||
import { formatBytes, mediaKindLabel } from "#lib/format/media.js";
|
||||
import { t } from "#lib/i18n/locale.svelte.js";
|
||||
import { poster } from "#lib/media/poster.js";
|
||||
import { accounts } from "#lib/stores/accounts.svelte.js";
|
||||
import { shareUi } from "#lib/stores/shares.svelte.js";
|
||||
@@ -56,14 +57,16 @@
|
||||
);
|
||||
|
||||
function displayName(item: MediaView): string {
|
||||
return item.file_name ?? mediaKindLabel(item.kind) ?? "Файл";
|
||||
return (
|
||||
item.file_name ?? mediaKindLabel(item.kind) ?? t("media.kind.document")
|
||||
);
|
||||
}
|
||||
|
||||
async function save(item: MediaView) {
|
||||
try {
|
||||
await downloadMedia(item.id);
|
||||
} catch {
|
||||
toasts.error("Не удалось скачать файл");
|
||||
toasts.error(t("ui.downloadFailed"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +178,7 @@
|
||||
{#if loading}
|
||||
<div class="center"><Spinner /></div>
|
||||
{:else}
|
||||
<EmptyState title="Пусто" />
|
||||
<EmptyState title={t("shared.media.empty")} />
|
||||
{/if}
|
||||
{:else if layout === "grid"}
|
||||
<div class="grid">
|
||||
@@ -217,17 +220,17 @@
|
||||
{/snippet}
|
||||
{#snippet menu()}
|
||||
<ContextMenuItem icon="open-in-new-tab" onselect={() => open(index)}
|
||||
>Открыть на весь экран</ContextMenuItem
|
||||
>{t("shared.media.fullscreen")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem icon="reply" onselect={() => jump(item.message_id)}
|
||||
>Перейти к сообщению</ContextMenuItem
|
||||
>{t("ui.jumpToMessage")}</ContextMenuItem
|
||||
>
|
||||
{#if item.downloaded}
|
||||
<ContextMenuItem icon="download" onselect={() => save(item)}
|
||||
>Скачать файл</ContextMenuItem
|
||||
>{t("ui.downloadFile")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem icon="allow-share" onselect={() => share(item)}
|
||||
>Доступ по ссылке</ContextMenuItem
|
||||
>{t("ui.shareLink")}</ContextMenuItem
|
||||
>
|
||||
{/if}
|
||||
{/snippet}
|
||||
@@ -262,17 +265,17 @@
|
||||
{/snippet}
|
||||
{#snippet menu()}
|
||||
<ContextMenuItem icon="open-in-new-tab" onselect={() => open(index)}
|
||||
>Открыть</ContextMenuItem
|
||||
>{t("ui.open")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem icon="reply" onselect={() => jump(item.message_id)}
|
||||
>Перейти к сообщению</ContextMenuItem
|
||||
>{t("ui.jumpToMessage")}</ContextMenuItem
|
||||
>
|
||||
{#if item.downloaded}
|
||||
<ContextMenuItem icon="download" onselect={() => save(item)}
|
||||
>Скачать файл</ContextMenuItem
|
||||
>{t("ui.downloadFile")}</ContextMenuItem
|
||||
>
|
||||
<ContextMenuItem icon="allow-share" onselect={() => share(item)}
|
||||
>Доступ по ссылке</ContextMenuItem
|
||||
>{t("ui.shareLink")}</ContextMenuItem
|
||||
>
|
||||
{/if}
|
||||
{/snippet}
|
||||
@@ -289,7 +292,7 @@
|
||||
onclick={() => loadMore()}
|
||||
type="button"
|
||||
>
|
||||
{loading ? "Загрузка…" : "Показать ещё"}
|
||||
{loading ? t("ui.loading") : t("ui.showMore")}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
|
||||
Reference in new issue
Block a user