From bcc007ad615e3b3957fdf54b5e8307f1e1ceb309 Mon Sep 17 00:00:00 2001 From: Xylight Date: Mon, 3 Jun 2024 17:41:56 -0700 Subject: [PATCH] i18n: localize blocks --- src/lib/i18n/en.json | 3 +- .../profile/(local_user)/blocks/+page.svelte | 36 +++---------------- 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index 7cd1afce..9365aa7f 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -198,7 +198,8 @@ "users": "Users", "posts": "Posts", "comments": "Comments", - "communities": "Communities" + "communities": "Communities", + "instances": "Instances" }, "post": { "actions": { diff --git a/src/routes/profile/(local_user)/blocks/+page.svelte b/src/routes/profile/(local_user)/blocks/+page.svelte index 77a4489b..ff03b367 100644 --- a/src/routes/profile/(local_user)/blocks/+page.svelte +++ b/src/routes/profile/(local_user)/blocks/+page.svelte @@ -17,6 +17,7 @@ import Placeholder from '$lib/components/ui/Placeholder.svelte' import { Button } from 'mono-svelte' import Entity from '$lib/components/ui/Entity.svelte' + import { t } from '$lib/translations.js' // sveltekit doesn't feel like making types work right now export let data: PageData & { @@ -81,7 +82,7 @@ {#if data.community_blocks?.length > 0 || data.person_blocks?.length > 0 || (data.my_user?.instance_blocks?.length ?? 0) > 0} {#if data.my_user?.instance_blocks && (data.my_user?.instance_blocks?.length ?? 0) > 0}
- Instances + {$t('content.instances')} unblockInstances(i.detail)}> {#each data.my_user?.instance_blocks as block (block.instance.id)}
- {:else} - {/if} {#if data.community_blocks?.length > 0}
- Communities + {$t('content.communities')} unblockCommunity(i.detail)}> {#each data.community_blocks as block (block.community.id)}
- {:else} - {/if} {#if data.person_blocks?.length > 0}
- Users + {$t('content.users')} unblockUser(i.detail)}> {#each data.person_blocks as block (block.target.id)}
- {:else} - {/if} -{:else} -
- -
{/if}