i18n: localize profile menu
This commit is contained in:
1 parent
c4236fa124
commit
0f0e34d347
5 files changed
+180
-17
No files matched your search
@@ -35,6 +35,7 @@
|
||||
import { userSettings } from '$lib/settings'
|
||||
import { site } from '$lib/lemmy'
|
||||
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
||||
import { t } from '$lib/translations'
|
||||
|
||||
let showInstance = false
|
||||
</script>
|
||||
@@ -59,7 +60,7 @@
|
||||
class="w-10 h-10 rounded-full ring-1 ring-slate-200 dark:ring-zinc-700
|
||||
transition-all bg-slate-50 dark:bg-zinc-900 relative
|
||||
hover:dark:brightness-125 hover:brightness {$$props.buttonClass}"
|
||||
aria-label="Profile"
|
||||
title={$t('profile.profile')}
|
||||
slot="target"
|
||||
>
|
||||
{#if $profile?.user}
|
||||
@@ -93,15 +94,16 @@
|
||||
{$profile?.user?.local_user_view?.person.name}
|
||||
</div>
|
||||
{:else}
|
||||
<MenuDivider>Profile</MenuDivider>
|
||||
<MenuDivider>{$t('nav.menu.label')}</MenuDivider>
|
||||
{/if}
|
||||
{#if $profile?.user}
|
||||
<MenuButton link href="/profile">
|
||||
<Icon src={UserCircle} mini width={16} slot="prefix" /> Profile
|
||||
<Icon src={UserCircle} mini width={16} slot="prefix" />
|
||||
{$t('profile.profile')}
|
||||
</MenuButton>
|
||||
<MenuButton link href="/inbox">
|
||||
<Icon src={Inbox} mini width={16} slot="prefix" />
|
||||
Inbox
|
||||
{$t('profile.inbox')}
|
||||
{#if $profile.user.notifications.inbox > 0}
|
||||
<Badge color="red-subtle" class="text-xs ml-auto font-bold !py-0.5">
|
||||
{$profile.user.notifications.inbox}
|
||||
@@ -109,18 +111,19 @@
|
||||
{/if}
|
||||
</MenuButton>
|
||||
<MenuButton link href="/saved">
|
||||
<Icon src={Bookmark} mini width={16} slot="prefix" /> Saved
|
||||
<Icon src={Bookmark} mini width={16} slot="prefix" />
|
||||
{$t('profile.saved')}
|
||||
</MenuButton>
|
||||
{/if}
|
||||
<MenuButton link href="/accounts">
|
||||
<Icon src={UserGroup} mini width={16} slot="prefix" />
|
||||
Accounts
|
||||
{$t('account.accounts')}
|
||||
</MenuButton>
|
||||
<hr class="dark:opacity-10 w-[90%] my-2 mx-auto" />
|
||||
<MenuDivider>App</MenuDivider>
|
||||
<MenuDivider>{$t('nav.menu.app')}</MenuDivider>
|
||||
<MenuButton link href="/settings">
|
||||
<Icon src={Cog6Tooth} mini width={16} slot="prefix" />
|
||||
Settings
|
||||
{$t('nav.menu.settings')}
|
||||
</MenuButton>
|
||||
<MenuButton class="!py-0">
|
||||
<Icon
|
||||
@@ -135,20 +138,20 @@
|
||||
size="16"
|
||||
slot="prefix"
|
||||
/>
|
||||
<span>Color Scheme</span>
|
||||
<span>{$t('nav.menu.colorscheme.label')}</span>
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<div class="contents" on:click|stopPropagation={() => {}}>
|
||||
<Select bind:value={$legacyTheme} class="ml-auto my-auto w-24" size="sm">
|
||||
<option value="system">System</option>
|
||||
<option value="light">Light</option>
|
||||
<option value="dark">Dark</option>
|
||||
<option value="system">{$t('nav.menu.colorscheme.system')}</option>
|
||||
<option value="light">{$t('nav.menu.colorscheme.label')}</option>
|
||||
<option value="dark">{$t('nav.menu.colorscheme.dark')}</option>
|
||||
</Select>
|
||||
</div>
|
||||
</MenuButton>
|
||||
<MenuButton href="/theme">
|
||||
<Icon src={Swatch} size="16" mini slot="prefix" />
|
||||
Theme
|
||||
{$t('nav.menu.theme')}
|
||||
</MenuButton>
|
||||
{#if $userSettings.debugInfo}
|
||||
<MenuButton link href="/util">
|
||||
@@ -174,7 +177,7 @@
|
||||
<Button
|
||||
on:click={() => (showInstance = !showInstance)}
|
||||
color="tertiary"
|
||||
title="Instance"
|
||||
title={$t('nav.menu.instance')}
|
||||
size="square-md"
|
||||
>
|
||||
<Icon src={ServerStack} size="16" mini />
|
||||
@@ -182,7 +185,7 @@
|
||||
<Button
|
||||
color="tertiary"
|
||||
href="https://buymeacoffee.com/xylight"
|
||||
title="Donate"
|
||||
title={$t('nav.menu.donate')}
|
||||
size="square-md"
|
||||
>
|
||||
<Icon src={Heart} size="16" mini />
|
||||
@@ -190,12 +193,17 @@
|
||||
<Button
|
||||
color="tertiary"
|
||||
href="https://github.com/Xyphyn/Photon"
|
||||
title="GitHub"
|
||||
title={$t('nav.menu.source')}
|
||||
size="square-md"
|
||||
>
|
||||
<Icon src={CodeBracketSquare} size="16" mini />
|
||||
</Button>
|
||||
<Button color="tertiary" href="/about" title="About" size="square-md">
|
||||
<Button
|
||||
color="tertiary"
|
||||
href="/about"
|
||||
title={$t('nav.menu.about')}
|
||||
size="square-md"
|
||||
>
|
||||
<Icon src={InformationCircle} size="16" mini />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user