i18n: localize profile page
This commit is contained in:
1 parent
f9935cee32
commit
ae0800b8b7
4 files changed
+78
-59
No files matched your search
+12
-2
@@ -82,7 +82,8 @@
|
|||||||
"list": "List",
|
"list": "List",
|
||||||
"compact": "Compact",
|
"compact": "Compact",
|
||||||
"legacy": "Legacy"
|
"legacy": "Legacy"
|
||||||
}
|
},
|
||||||
|
"type": "Type"
|
||||||
},
|
},
|
||||||
"form": {
|
"form": {
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
@@ -99,7 +100,14 @@
|
|||||||
},
|
},
|
||||||
"modlog": "Modlog",
|
"modlog": "Modlog",
|
||||||
"instances": "Instances",
|
"instances": "Instances",
|
||||||
"legal": "Legal"
|
"legal": "Legal",
|
||||||
|
"profile": {
|
||||||
|
"user": "User",
|
||||||
|
"settings": "Settings",
|
||||||
|
"blocks": "Blocks",
|
||||||
|
"credentials": "Credentials",
|
||||||
|
"moderates": "Moderates"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"cards": {
|
"cards": {
|
||||||
"site": {
|
"site": {
|
||||||
@@ -109,8 +117,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"content": {
|
"content": {
|
||||||
|
"all": "All",
|
||||||
"users": "Users",
|
"users": "Users",
|
||||||
"posts": "Posts",
|
"posts": "Posts",
|
||||||
|
"comments": "Comments",
|
||||||
"communities": "Communities"
|
"communities": "Communities"
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
|
|||||||
@@ -110,7 +110,9 @@
|
|||||||
},
|
},
|
||||||
"content": {
|
"content": {
|
||||||
"users": "Utilisateurs",
|
"users": "Utilisateurs",
|
||||||
|
"all": "Tout",
|
||||||
"posts": "Posts",
|
"posts": "Posts",
|
||||||
|
"comments": "Commentaires",
|
||||||
"communities": "Communautés"
|
"communities": "Communautés"
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
|
|
||||||
import MultiSelect from '$lib/components/input/Switch.svelte'
|
import MultiSelect from '$lib/components/input/Switch.svelte'
|
||||||
|
import { t } from '$lib/translations'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -17,7 +18,12 @@
|
|||||||
'/profile/blocks',
|
'/profile/blocks',
|
||||||
'/profile/password',
|
'/profile/password',
|
||||||
]}
|
]}
|
||||||
optionNames={['User', 'Settings', 'Blocks', 'Credentials']}
|
optionNames={[
|
||||||
|
$t('routes.profile.user'),
|
||||||
|
$t('routes.profile.settings'),
|
||||||
|
$t('routes.profile.blocks'),
|
||||||
|
$t('routes.profile.credentials'),
|
||||||
|
]}
|
||||||
selected={$page.url.pathname}
|
selected={$page.url.pathname}
|
||||||
on:select={(e) => {
|
on:select={(e) => {
|
||||||
goto(e.detail)
|
goto(e.detail)
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||||
import { communityLink } from '$lib/lemmy/generic.js'
|
import { communityLink } from '$lib/lemmy/generic.js'
|
||||||
import ItemList from '$lib/components/lemmy/generic/ItemList.svelte'
|
import ItemList from '$lib/components/lemmy/generic/ItemList.svelte'
|
||||||
|
import { t } from '$lib/translations.js'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -158,59 +159,7 @@
|
|||||||
alt="User banner"
|
alt="User banner"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex flex-col-reverse gap-4 max-w-full w-full">
|
<div class="flex flex-col gap-4 max-w-full w-full">
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
|
||||||
<div class="flex flex-row gap-4 flex-wrap justify-between">
|
|
||||||
<Select
|
|
||||||
bind:value={data.sort}
|
|
||||||
on:change={() => searchParam($page.url, 'sort', data.sort, 'page')}
|
|
||||||
>
|
|
||||||
<span slot="label" class="flex items-center gap-1">
|
|
||||||
<Icon src={ChartBar} size="14" mini />
|
|
||||||
Sort
|
|
||||||
</span>
|
|
||||||
<option value="New">New</option>
|
|
||||||
<option value="TopAll">Top</option>
|
|
||||||
<option value="Old">Old</option>
|
|
||||||
</Select>
|
|
||||||
<Select
|
|
||||||
bind:value={data.type}
|
|
||||||
on:change={() => searchParam($page.url, 'type', data.type, 'page')}
|
|
||||||
>
|
|
||||||
<span slot="label" class="flex items-center gap-1">
|
|
||||||
<Icon src={AdjustmentsHorizontal} size="15" mini />
|
|
||||||
Type
|
|
||||||
</span>
|
|
||||||
<option value="all">All</option>
|
|
||||||
<option value="posts">Posts</option>
|
|
||||||
<option value="comments">Comments</option>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
{#if data.items.length == 0}
|
|
||||||
<Placeholder
|
|
||||||
icon={PencilSquare}
|
|
||||||
title="No submissions"
|
|
||||||
description="This user has no submissions that match this filter."
|
|
||||||
/>
|
|
||||||
{:else}
|
|
||||||
<div
|
|
||||||
class="!divide-y divide-slate-200 dark:divide-zinc-800 flex flex-col"
|
|
||||||
>
|
|
||||||
{#each data.items as item}
|
|
||||||
{#if isCommentView(item) && (data.type == 'all' || data.type == 'comments')}
|
|
||||||
<CommentItem comment={item} />
|
|
||||||
{:else if !isCommentView(item) && (data.type == 'all' || data.type == 'posts')}
|
|
||||||
<Post post={item} />
|
|
||||||
{/if}
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
<Pageination
|
|
||||||
page={data.page}
|
|
||||||
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<Avatar
|
<Avatar
|
||||||
width={64}
|
width={64}
|
||||||
@@ -237,12 +186,12 @@
|
|||||||
<LabelStat
|
<LabelStat
|
||||||
content={data.person_view.counts.post_count.toString()}
|
content={data.person_view.counts.post_count.toString()}
|
||||||
formatted
|
formatted
|
||||||
label="Posts"
|
label={$t('content.posts')}
|
||||||
/>
|
/>
|
||||||
<LabelStat
|
<LabelStat
|
||||||
content={data.person_view.counts.comment_count.toString()}
|
content={data.person_view.counts.comment_count.toString()}
|
||||||
formatted
|
formatted
|
||||||
label="Comments"
|
label={$t('content.comments')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{#if (data.moderates ?? []).length > 0}
|
{#if (data.moderates ?? []).length > 0}
|
||||||
@@ -252,7 +201,7 @@
|
|||||||
>
|
>
|
||||||
<span slot="title" class="flex items-center gap-1">
|
<span slot="title" class="flex items-center gap-1">
|
||||||
<ShieldIcon width={14} filled />
|
<ShieldIcon width={14} filled />
|
||||||
Moderates
|
{$t('routes.profile.moderates')}
|
||||||
</span>
|
</span>
|
||||||
<ItemList
|
<ItemList
|
||||||
items={data.moderates.map((m) => ({
|
items={data.moderates.map((m) => ({
|
||||||
@@ -324,4 +273,56 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||||
|
<div class="flex flex-row gap-4 flex-wrap justify-between">
|
||||||
|
<Select
|
||||||
|
bind:value={data.sort}
|
||||||
|
on:change={() => searchParam($page.url, 'sort', data.sort, 'page')}
|
||||||
|
>
|
||||||
|
<span slot="label" class="flex items-center gap-1">
|
||||||
|
<Icon src={ChartBar} size="14" mini />
|
||||||
|
{$t('filter.sort.label')}
|
||||||
|
</span>
|
||||||
|
<option value="New">{$t('filter.sort.new')}</option>
|
||||||
|
<option value="TopAll">{$t('filter.sort.top.label')}</option>
|
||||||
|
<option value="Old">{$t('filter.sort.old')}</option>
|
||||||
|
</Select>
|
||||||
|
<Select
|
||||||
|
bind:value={data.type}
|
||||||
|
on:change={() => searchParam($page.url, 'type', data.type, 'page')}
|
||||||
|
>
|
||||||
|
<span slot="label" class="flex items-center gap-1">
|
||||||
|
<Icon src={AdjustmentsHorizontal} size="15" mini />
|
||||||
|
{$t('filter.type')}
|
||||||
|
</span>
|
||||||
|
<option value="all">{$t('content.all')}</option>
|
||||||
|
<option value="posts">{$t('content.posts')}</option>
|
||||||
|
<option value="comments">{$t('content.comments')}</option>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
{#if data.items.length == 0}
|
||||||
|
<Placeholder
|
||||||
|
icon={PencilSquare}
|
||||||
|
title="No submissions"
|
||||||
|
description="This user has no submissions that match this filter."
|
||||||
|
/>
|
||||||
|
{:else}
|
||||||
|
<div
|
||||||
|
class="!divide-y divide-slate-200 dark:divide-zinc-800 flex flex-col"
|
||||||
|
>
|
||||||
|
{#each data.items as item}
|
||||||
|
{#if isCommentView(item) && (data.type == 'all' || data.type == 'comments')}
|
||||||
|
<CommentItem comment={item} />
|
||||||
|
{:else if !isCommentView(item) && (data.type == 'all' || data.type == 'posts')}
|
||||||
|
<Post post={item} />
|
||||||
|
{/if}
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
<Pageination
|
||||||
|
page={data.page}
|
||||||
|
on:change={(p) => searchParam($page.url, 'page', p.detail.toString())}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Reference in new issue
Block a user