Merge pull request #643 from Xyphyn/2.0.2-consistency

improve consistency of i18n and design
This commit is contained in:
Xylight authored and GitHub committed 2025-08-31 18:11:08 +00:00
commit e7531227d8
18 files changed
+181 -145

No files matched your search

+11 -1
View File
@@ -60,7 +60,7 @@
<div class="flex flex-col gap-1">
{#if taglines && taglines.length > 0}
<Markdown
class="pt-0!"
class="pt-0! mx-3"
source={taglines[Math.floor(Math.random() * taglines.length)].content}
/>
{/if}
@@ -98,6 +98,16 @@
content={site.counts.posts.toString()}
formatted
/>
<LabelStat
label={$t('content.comments')}
content={site.counts.comments.toString()}
formatted
/>
<LabelStat
label={$t('cards.community.activeDay')}
content={site.counts.users_active_day.toString()}
formatted
/>
<LabelStat
label={$t('content.communities')}
content={site.counts.communities.toString()}
@@ -185,7 +185,7 @@
<Icon src={Pencil} micro size="14" />
</div>
{/if}
{#if node.comment_view.comment.deleted || node.comment_view.comment.removed}
{#if node.comment_view.comment.deleted}
<Icon
src={Trash}
solid
@@ -194,6 +194,15 @@
class="text-red-600 dark:text-red-500"
/>
{/if}
{#if node.comment_view.comment.removed}
<Icon
src={Trash}
solid
size="12"
aria-label={$t('post.badges.removed')}
class="text-green-600 dark:text-green-500"
/>
{/if}
{#if node.comment_view.saved}
<Icon
src={Bookmark}
@@ -104,8 +104,9 @@
previewButton={previewAction}
>
<Menu>
{#snippet target()}
{#snippet target(attachment)}
<Button
{@attach attachment}
size="custom"
rounding="xl"
class="w-7.5 h-7.5"
@@ -1,3 +1,4 @@
import { t } from '$lib/i18n/translations'
import type { Comment, CommentView } from 'lemmy-js-client'
import { SvelteMap } from 'svelte/reactivity'
@@ -35,6 +36,9 @@ export function buildCommentsTree(
for (const comment_view of comments) {
const depthI = getDepthFromComment(comment_view.comment) ?? 0
const depth = depthI + baseDepth
if (comment_view.comment.content == '' && comment_view.comment.removed) {
comment_view.comment.content = `*Removed by Moderator — [${t.get('routes.modlog.title')}](/modlog?comment=${comment_view.comment.id})*`
}
const node: CommentNodeI = {
comment_view,
children: [],
@@ -41,6 +41,7 @@
banner?: boolean
class?: string
compact?: 'lg'
avatarCircle?: boolean
}
let {
+5 -2
View File
@@ -23,6 +23,7 @@
actions?: import('svelte').Snippet
children?: import('svelte').Snippet
compact?: 'lg'
avatarCircle?: boolean
}
let {
@@ -38,6 +39,7 @@
actions,
children,
compact,
avatarCircle = true,
...rest
}: Props = $props()
</script>
@@ -71,10 +73,11 @@
width={96}
url={avatar}
alt={name}
circle={false}
circle={avatarCircle}
class={[
'ring-slate-25 bg-slate-25 dark:bg-zinc-925 ring-6 relative dark:ring-zinc-950 rounded-3xl!',
'ring-slate-25 bg-slate-25 dark:bg-zinc-925 ring-6 relative dark:ring-zinc-950',
banner && '-mt-12 ml-4',
!avatarCircle && 'rounded-3xl!',
]}
/>
<div class="py-4 flex flex-col xl:flex-row gap-4">
+2 -2
View File
@@ -65,7 +65,7 @@
color="tertiary"
size="square-lg"
rounding="pill"
title={$t('post.actions.more.share')}
aria-label={$t('post.actions.more.share')}
>
{#snippet prefix()}
<Icon src={Share} size="20" micro />
@@ -76,7 +76,7 @@
color="tertiary"
size="square-lg"
rounding="pill"
title={$t('post.image.close')}
aria-label={$t('common.back')}
>
{#snippet prefix()}
<Icon src={XMark} size="20" micro />
@@ -392,14 +392,9 @@ export function getGroups(
actions: [
{
href: '/create/post',
name: t.get('routes.createPost'),
name: t.get('form.post.create'),
icon: PencilSquare,
},
{
href: '/create/community',
name: t.get('routes.createCommunity'),
icon: Newspaper,
},
],
},
{
+43 -63
View File
@@ -22,7 +22,7 @@
"app": "App",
"settings": "Settings",
"colorscheme": {
"label": "Color Scheme",
"label": "Color scheme",
"system": "System",
"dark": "Dark",
"light": "Light"
@@ -34,7 +34,7 @@
"instance": "Instance"
},
"commands": {
"prompt": "Command Palette",
"prompt": "Command palette",
"recents": "Recents",
"content": "Content",
"search": "Search for {{default}}",
@@ -52,15 +52,15 @@
"notifications": "Notifications"
},
"account": {
"login": "Log In",
"logout": "Log Out",
"signup": "Sign Up",
"login": "Log in",
"logout": "Log out",
"signup": "Sign up",
"accounts": "Accounts",
"changeinstance": "Change Instance",
"resetColor": "Reset Color",
"addGuest": "Add Guest",
"moveUp": "Move Up",
"moveDown": "Move Down",
"changeinstance": "Change instance",
"resetColor": "Reset color",
"addGuest": "Add guest",
"moveUp": "Move up",
"moveDown": "Move down",
"guest": "Guest",
"versionGate": "This version of Photon supports instances running {{version}} or higher."
},
@@ -121,24 +121,24 @@
"name": "Name",
"instance": "Instance URL",
"password": "Password",
"confirmPassword": "Confirm Password",
"confirmPassword": "Confirm password",
"2fa": "2FA Code",
"forgotpassword": "Forgot Password",
"forgotpassword": "Forgot password",
"submit": "Submit",
"edit": "Edit",
"preview": "Preview",
"post": {
"create": "Create Post",
"edit": "Edit Post",
"create": "Create post",
"edit": "Edit post",
"community": "Community",
"title": "Title",
"url": "URL",
"body": "Body",
"nsfw": "NSFW",
"generateTitle": "Generate Title",
"uploadImage": "Upload Image",
"generateTitle": "Generate title",
"uploadImage": "Upload image",
"selectFile": "Select a file",
"altText": "Alt Text",
"altText": "Alt text",
"addUrl": "Add URL",
"setLanguage": "Set language",
"unset": "Unset",
@@ -150,15 +150,15 @@
"avatar": "Avatar",
"banner": "Banner",
"email": "Email",
"matrix": "Matrix User",
"matrix": "Matrix user",
"showNSFW": "Show NSFW content",
"scores": "Show Scores",
"bot": "Bot Account",
"showBots": "Show Bots",
"showRead": "Show Read Posts",
"currentPassword": "Current Password",
"newPassword": "New Password",
"verifyNewPassword": "Verify New Password",
"scores": "Show scores",
"bot": "Bot account",
"showBots": "Show bots",
"showRead": "Show read posts",
"currentPassword": "Current password",
"newPassword": "New password",
"verifyNewPassword": "Verify new password",
"2fa": {
"totp": "TOTP",
"2fa": "2FA",
@@ -166,7 +166,6 @@
"disabled": "2FA is disabled"
},
"deleteAccount": {
"label": "Delete account",
"deleteContent": "Delete content",
"warning": "This will delete ALL of your submissions."
},
@@ -253,7 +252,6 @@
"download": "Download"
},
"logins": "Logins",
"welcome": "Welcome, {{default}}!",
"delete": {
"title": "Delete account",
"warning": "This is permanent. Are you sure you want to do this?"
@@ -284,8 +282,6 @@
"other": "Other results"
},
"saved": "Saved",
"createPost": "Create Post",
"createCommunity": "Create Community",
"post": {
"crosspostCount": "Crossposts",
"commentCount": "Comments",
@@ -365,15 +361,15 @@
"sidebar": "Sidebar",
"icon": "Icon",
"banner": "Banner",
"downvotesEnabled": "Enable Downvotes",
"downvotesEnabled": "Enable downvotes",
"nsfwEnabled": "Enable NSFW",
"registration": {
"label": "Registration Mode",
"label": "Registration mode",
"open": "Open",
"application": "Require Application",
"application": "Require application",
"closed": "Closed"
},
"applicationQuestion": "Application Question",
"applicationQuestion": "Application question",
"adminCommunityOnly": "Only admins can create communities",
"requireVerifyEmail": "Require email verification",
"emailAdminsOnApplication": "Email admins on receiving new applications",
@@ -389,7 +385,7 @@
"federation": "Federation enabled",
"federationDebug": "Federation debug mode",
"captcha": {
"enabled": "CAPTCHA Enabled"
"enabled": "CAPTCHA enabled"
}
},
"applications": {
@@ -405,7 +401,7 @@
"deny": "Deny",
"approve": "Approve",
"reason": "Reason",
"modalTitle": "Deny Application"
"modalTitle": "Deny application"
},
"taglines": {
"title": "Taglines",
@@ -425,10 +421,10 @@
"federation": {
"title": "Federation",
"csv": "Upload CSV",
"blocked": "Blocked Instances",
"blocked": "Blocked instances",
"block": "Block",
"blockplaceholder": "Block an instance...",
"allowed": "Whitelisted Instances",
"allowed": "Whitelisted instances",
"allow": "Whitelist",
"allowplaceholder": "Whitelist an instance",
"emptyBlock": {
@@ -449,7 +445,7 @@
"error": "Failed to verify your email."
},
"passwordChange": {
"title": "Change Password",
"title": "Change password",
"description": "Choose your new password.",
"instance": "Which instance is your account hosted on?"
},
@@ -459,25 +455,22 @@
},
"theme": {
"title": "Theme",
"import": "Import",
"export": "Export",
"reset": "Reset",
"accent": "Accent",
"resetWarning": {
"title": "Reset Theme",
"title": "Reset theme",
"description": "This will reset all of your colors to the default. It is recommended to export your theme before this."
},
"preset": {
"title": "Can't be modified",
"description": "This is a default theme, and can't be modified.",
"delete": {
"title": "Delete Theme",
"title": "Delete theme",
"confirm": "Confirm"
},
"default": "Default",
"classic": "Classic",
"imported": "Your Theme",
"new": "New Theme",
"imported": "Your theme",
"new": "New theme",
"presets": "Presets"
}
},
@@ -505,8 +498,6 @@
"block": "Block",
"unblock": "Unblock",
"blockInstance": "Block instance",
"favorite": "Favorite",
"unfavorite": "Remove Favorite",
"activeDay": "Active Today"
}
},
@@ -515,7 +506,7 @@
"instance": "Instance",
"label": "Administration",
"purgeCommunity": {
"title": "Purging Community",
"title": "Purging community",
"warning": "This will delete all posts. Are you sure? (The button will enable in 3 seconds.)"
}
},
@@ -535,25 +526,19 @@
"save": "Save",
"unsave": "Unsave",
"more": {
"label": "More Actions",
"label": "More actions",
"edit": "Edit",
"creator": "Creator",
"actions": "Actions",
"markRead": "Mark as Read",
"markUnread": "Mark as Unread",
"markRead": "Mark as read",
"markUnread": "Mark as unread",
"hide": "Hide",
"unhide": "Unhide",
"translate": "Translate",
"mediaBias": "Media Bias",
"share": "Share",
"crosspost": "Crosspost",
"delete": "Delete",
"restore": "Restore"
},
"link": {
"title": "Alternative Links",
"actions": "Link Actions"
},
"vote": {
"upvote": "Upvote",
"downvote": "Downvote",
@@ -570,8 +555,7 @@
},
"image": {
"zoomIn": "Zoom in",
"zoomOut": "Zoom out",
"close": "Close"
"zoomOut": "Zoom out"
},
"meta": {
"lastEdited": "Last edited {{default}}",
@@ -738,10 +722,6 @@
"description": "Customize the UI colors.",
"link": "Go to themes"
},
"colorscheme": {
"title": "Color Scheme",
"description": "The color scheme to use."
},
"lang": {
"title": "Language",
"description": "The language used for text in the UI.",
+1 -1
View File
@@ -46,7 +46,7 @@
{#snippet extended()}
<form class="" method="get" action="/">
<div class="flex flex-row gap-4">
<div class="flex flex-row gap-2">
{#if data.filters.value.type_}
<Location
name="type"
+2 -1
View File
@@ -248,8 +248,9 @@
<span>{$t('routes.admin.federation.allowed')}</span>
{#if allowInstance.instance || !(data.instances.value.allowed?.length == 0)}
<Popover openOnHover placement="bottom-end">
{#snippet target()}
{#snippet target(attachment)}
<Icon
{@attach attachment}
src={ExclamationTriangle}
solid
class="text-yellow-500"
+1
View File
@@ -72,6 +72,7 @@
counts={data.community.value.community_view.counts}
class="w-full relative"
compact="lg"
avatarCircle={false}
/>
</div>
{#snippet extended()}
@@ -143,8 +143,7 @@
<Button
loading={formData.addingModerator}
disabled={formData.addingModerator}
size="lg"
class="w-max shrink-0"
rounding="xl"
color="primary"
submit
>
@@ -10,7 +10,7 @@
import { settings } from '$lib/settings.svelte'
import type { PrivateMessageResponse } from 'lemmy-js-client'
import { Button, Material, TextInput, toast } from 'mono-svelte'
import { tick } from 'svelte'
import { onDestroy, onMount, tick } from 'svelte'
import {
ArrowLeft,
Icon,
@@ -84,6 +84,25 @@
),
}
}
let interval: number = -1
onMount(() => {
interval = setInterval(async () => {
const res = await client().getPrivateMessages({
creator_id: Number(data.creator.value.person_view.person.id),
limit: 50,
page: 1,
})
data.message.value = res
}, 5 * 1000) as unknown as number
return () => clearInterval(interval)
})
onDestroy(() => {
clearInterval(interval)
})
</script>
<Header pageHeader>
@@ -104,12 +123,12 @@
rounding="2xl"
padding="none"
class="bg-white dark:bg-zinc-950 dark:border-t-zinc-900
w-full overflow-auto mt-6 relative max-h-128 h-full"
w-full overflow-auto relative h-full"
>
<div class="h-full overflow-auto" bind:this={chatWindow}>
<ul id="chat-window" class=" h-full flex flex-col gap-1 flex-1 px-4 py-4">
<div class="mt-auto"></div>
<p class="mx-auto mt-auto text-slate-400 dark:text-zinc-600">
<p class="mx-auto mt-auto text-slate-400 dark:text-zinc-600 text-center">
{$t('routes.inbox.messages.conversation', {
user:
data.creator.value.person_view.person.name +
@@ -51,8 +51,9 @@
{/if}
</div>
<Menu>
{#snippet target()}
{#snippet target(attachment)}
<Button
{@attach attachment}
color="tertiary"
class="opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-all shrink-0"
size="square-md"
+15 -6
View File
@@ -3,7 +3,7 @@
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
import { t } from '$lib/i18n/translations'
import { defaultSettings, settings } from '$lib/settings.svelte'
import { Button, toast, Modal } from 'mono-svelte'
import { Button, toast, Modal, modal, action } from 'mono-svelte'
import TextArea from 'mono-svelte/forms/TextArea.svelte'
import {
ArrowDownTray,
@@ -78,11 +78,20 @@
</Button>
<Button
onclick={() => {
toast({
content: $t('toast.resetSettings'),
action: () => {
Object.assign(settings, defaultSettings)
},
modal({
title: $t('settings.reset'),
body: $t('toast.resetSettings'),
actions: [
action({
action: () => Object.assign(settings, defaultSettings),
close: true,
type: 'danger',
content: $t('settings.reset'),
}),
action({
content: $t('common.cancel'),
}),
],
})
}}
rounding="pill"
+4 -4
View File
@@ -105,7 +105,7 @@
disabled={themeData.current.id <= 0}
>
<Icon src={ArrowUpTray} size="16" mini />
{$t('routes.theme.import')}
{$t('settings.import')}
</Button>
<Button
onclick={() => {
@@ -115,7 +115,7 @@
size="lg"
>
<Icon src={ArrowDownTray} size="16" mini />
{$t('routes.theme.export')}
{$t('settings.export')}
</Button>
<Button
disabled={themeData.current.id <= 0}
@@ -135,7 +135,7 @@
slate: {},
}
},
content: $t('routes.theme.reset'),
content: $t('settings.reset'),
close: true,
type: 'danger',
}),
@@ -147,7 +147,7 @@
size="lg"
>
<Icon src={ArrowPath} size="16" mini />
{$t('routes.theme.reset')}
{$t('settings.reset')}
</Button>
</div>
{#if themeData.current.id <= 0}
+54 -51
View File
@@ -156,6 +156,7 @@
<Header pageHeader class="tracking-normal!">
<div class="w-full">
<EntityHeader
avatarCircle
avatar={data.person_view.value.person.avatar}
name={data.person_view.value.person.display_name ||
data.person_view.value.person.name}
@@ -216,7 +217,7 @@
<Button
size="sm"
rounding="pill"
color="secondary"
color="primary"
href="/inbox/messages/{data.person_view.value.person.id}"
>
{#snippet prefix()}
@@ -278,8 +279,8 @@
</Menu>
{/if}
<Menu placement="bottom-end">
{#snippet target()}
<Button size="custom" class="h-7 w-7" rounding="pill">
{#snippet target(attachment)}
<Button {@attach attachment} size="custom" class="h-8 w-8" rounding="pill">
{#snippet prefix()}
<Icon src={EllipsisHorizontal} size="16" mini />
{/snippet}
@@ -305,56 +306,58 @@
{/snippet}
</EntityHeader>
</div>
{#snippet extended()}
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<form
action={page.url.origin + page.url.pathname}
method="GET"
class="flex flex-row gap-4 flex-wrap"
bind:this={sortForm}
>
<Select
bind:value={data.filters.value.type}
name="type"
onchange={() => sortForm?.requestSubmit()}
>
{#snippet customLabel()}
<span class="flex items-center gap-1">
<Icon src={AdjustmentsHorizontal} size="15" mini />
{$t('filter.type')}
</span>
{/snippet}
<Option value="all">{$t('content.all')}</Option>
<Option value="posts">{$t('content.posts')}</Option>
<Option value="comments">{$t('content.comments')}</Option>
</Select>
<Sort
bind:selected={data.filters.value.sort}
onchange={() => sortForm?.requestSubmit()}
/>
</form>
</div>
{/snippet}
</Header>
{/if}
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<form
action={page.url.origin + page.url.pathname}
method="GET"
class="flex flex-row gap-4 flex-wrap"
bind:this={sortForm}
>
<Select
bind:value={data.filters.value.type}
name="type"
onchange={() => sortForm?.requestSubmit()}
>
{#snippet customLabel()}
<span class="flex items-center gap-1">
<Icon src={AdjustmentsHorizontal} size="15" mini />
{$t('filter.type')}
</span>
{/snippet}
<Option value="all">{$t('content.all')}</Option>
<Option value="posts">{$t('content.posts')}</Option>
<Option value="comments">{$t('content.comments')}</Option>
</Select>
<Sort
bind:selected={data.filters.value.sort}
onchange={() => sortForm?.requestSubmit()}
/>
</form>
{#if data.items.value.length == 0}
<Placeholder
icon={PencilSquare}
title="No submissions"
description="This user has no submissions that match this filter."
/>
{:else}
<CommonList items={data.items.value}>
{#snippet item(item)}
{#if isCommentView(item)}
<CommentItem comment={item} />
{:else if !isCommentView(item)}
<PostItem post={item} />
{/if}
{/snippet}
</CommonList>
{/if}
<Pageination
bind:page={data.filters.value.page}
href={page => `?page=${page}`}
{#if data.items.value.length == 0}
<Placeholder
icon={PencilSquare}
title="No submissions"
description="This user has no submissions that match this filter."
/>
</div>
{:else}
<CommonList items={data.items.value}>
{#snippet item(item)}
{#if isCommentView(item)}
<CommentItem comment={item} />
{:else if !isCommentView(item)}
<PostItem post={item} />
{/if}
{/snippet}
</CommonList>
{/if}
<Pageination
bind:page={data.filters.value.page}
href={page => `?page=${page}`}
/>
</div>