i18n: localize post layout

This commit is contained in:
Xylight committed 2024-06-03 16:31:46 -07:00
1 parent 3d76bb7330
commit b626ea34f9
2 files changed
+34 -21

No files matched your search

+16 -1
View File
@@ -115,7 +115,22 @@
"credentials": "Credentials", "credentials": "Credentials",
"moderates": "Moderates" "moderates": "Moderates"
}, },
"accounts": "Accounts" "accounts": "Accounts",
"post": {
"crosspostCount": "crossposts",
"commentCount": "comments",
"addComment": "Add a comment",
"scrollToTop": "Scroll to top",
"instanceWarning": "This post was requested from a different server than your account's. Many actions won't work.",
"remoteView": "Remote View",
"localView": "Local View",
"thread": {
"single": "You're viewing a single thread.",
"allComments": "All Comments",
"part": "You're viewing part of a thread.",
"context": "Show Context"
}
}
}, },
"cards": { "cards": {
"site": { "site": {
@@ -42,6 +42,7 @@
import Expandable from '$lib/components/ui/Expandable.svelte' import Expandable from '$lib/components/ui/Expandable.svelte'
import { addResumable } from '$lib/lemmy/item.js' import { addResumable } from '$lib/lemmy/item.js'
import { Popover } from 'mono-svelte' import { Popover } from 'mono-svelte'
import { t } from '$lib/translations.js'
export let data export let data
@@ -161,11 +162,10 @@
slot="target" slot="target"
class="bg-slate-200 dark:bg-zinc-700 p-0.5 rounded-full text-primary-900 dark:text-primary-100" class="bg-slate-200 dark:bg-zinc-700 p-0.5 rounded-full text-primary-900 dark:text-primary-100"
/> />
This post was fetched from a different server than your account's. Many actions {$t('routes.post.instanceWarning')}
won't work.
</Popover> </Popover>
<span class="text-primary-900 dark:text-primary-100 font-bold"> <span class="text-primary-900 dark:text-primary-100 font-bold">
Remote View {$t('routes.post.remoteView')}
</span> </span>
{#if $profile?.jwt} {#if $profile?.jwt}
<Button <Button
@@ -177,7 +177,7 @@
}} }}
> >
<Icon src={Home} mini size="16" /> <Icon src={Home} mini size="16" />
Local View {$t('routes.post.localView')}
</Button> </Button>
{/if} {/if}
</div> </div>
@@ -243,7 +243,7 @@
class="inline-block w-full text-left text-base font-normal" class="inline-block w-full text-left text-base font-normal"
> >
<span class="font-bold">{post.cross_posts.length}</span> <span class="font-bold">{post.cross_posts.length}</span>
crossposts {$t('routes.post.crosspostCount')}
</div> </div>
<div <div
class="!divide-y divide-slate-200 dark:divide-zinc-800 flex flex-col" class="!divide-y divide-slate-200 dark:divide-zinc-800 flex flex-col"
@@ -265,14 +265,14 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
> >
<p class="font-medium text-sm flex items-center gap-2"> <p class="font-medium text-sm flex items-center gap-2">
<Icon src={InformationCircle} mini size="20" /> <Icon src={InformationCircle} mini size="20" />
You're viewing part of a thread. {$t('routes.post.thread.part')}
</p> </p>
<Button <Button
{loading} {loading}
disabled={loading} disabled={loading}
href="/comment/{$page.params.instance}/{data.thread.showContext}" href="/comment/{$page.params.instance}/{data.thread.showContext}"
> >
Show Context {$t('routes.post.thread.context')}
</Button> </Button>
</Material> </Material>
{:else if data.thread.singleThread} {:else if data.thread.singleThread}
@@ -285,10 +285,10 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
> >
<p class="font-medium text-sm flex items-center gap-2"> <p class="font-medium text-sm flex items-center gap-2">
<Icon src={InformationCircle} mini size="20" /> <Icon src={InformationCircle} mini size="20" />
You're viewing a single thread. {$t('routes.post.thread.single')}
</p> </p>
<Button {loading} disabled={loading} on:click={reloadComments}> <Button {loading} disabled={loading} on:click={reloadComments}>
All comments {$t('routes.post.thread.allComments')}
</Button> </Button>
</Material> </Material>
{/if} {/if}
@@ -298,7 +298,7 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
<span class="font-bold"> <span class="font-bold">
<FormattedNumber number={post.post_view.counts.comments} /> <FormattedNumber number={post.post_view.counts.comments} />
</span> </span>
comments {$t('routes.post.commentCount')}
</div> </div>
<div class="gap-2 flex items-center h-8"> <div class="gap-2 flex items-center h-8">
<Select <Select
@@ -307,13 +307,11 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
bind:value={commentSort} bind:value={commentSort}
on:change={reloadComments} on:change={reloadComments}
> >
<option value="Hot">Hot</option> <option value="Hot">{$t('filter.sort.hot')}</option>
<option value="Top">Top</option> <option value="Top">{$t('filter.sort.top.label')}</option>
<option value="New">New</option> <option value="New">{$t('filter.sort.new')}</option>
<option value="Old">Old</option> <option value="Old">{$t('filter.sort.old')}</option>
{#if feature('controversialSort', $page.params.instance == $instance ? $site?.version : '0.0.0')} <option value="Controversial">{$t('filter.sort.controversial')}</option>
<option value="Controversial">Controversial</option>
{/if}
</Select> </Select>
<Button size="square-md" on:click={reloadComments}> <Button size="square-md" on:click={reloadComments}>
<Icon src={ArrowPath} size="16" mini slot="prefix" /> <Icon src={ArrowPath} size="16" mini slot="prefix" />
@@ -333,7 +331,7 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
on:focus={() => (commenting = true)} on:focus={() => (commenting = true)}
tools={commenting} tools={commenting}
preview={commenting} preview={commenting}
placeholder={commenting ? undefined : 'Add a comment'} placeholder={commenting ? undefined : $t('routes.post.addComment')}
rows={commenting ? 7 : 1} rows={commenting ? 7 : 1}
/> />
{/if} {/if}
@@ -355,7 +353,7 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
<span class="text-black dark:text-white font-bold"> <span class="text-black dark:text-white font-bold">
{post.post_view.counts.comments} {post.post_view.counts.comments}
</span> </span>
comments {$t('routes.post.commentCount')}
<Button <Button
color="tertiary" color="tertiary"
@@ -363,7 +361,7 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
slot="action" slot="action"
> >
<Icon src={ChevronDoubleUp} mini size="16" slot="prefix" /> <Icon src={ChevronDoubleUp} mini size="16" slot="prefix" />
Scroll to top {$t('routes.post.scrollToTop')}
</Button> </Button>
</EndPlaceholder> </EndPlaceholder>
{/if} {/if}