i18n: localize settings page

This commit is contained in:
Xylight committed 2024-06-04 13:52:56 -07:00
1 parent e89d2aaddb
commit 00f70d6ba0
2 files changed
+262 -123

No files matched your search

+141
View File
@@ -507,5 +507,146 @@
"blockUser": "Blocked that user.", "blockUser": "Blocked that user.",
"unblockUser": "Unblocked that user.", "unblockUser": "Unblocked that user.",
"purgeUser": "Purged that user." "purgeUser": "Purged that user."
},
"settings": {
"title": "Settings",
"navigation": {
"title": "Navigation",
"dockPos": {
"title": "Dock position",
"description": "Where the dock should be positioned on the screen.",
"top": "Top",
"bottom": "Bottom",
"adaptive": "Adaptive"
},
"panel": {
"title": "Panel mode",
"description": "Extend the dock to the screen edges, similar to a panel.",
"on": "On",
"off": "Off",
"adaptive": "Adaptive"
}
},
"app": {
"title": "Photon",
"theming": {
"title": "Theming",
"description": "Customize Photon's colors.",
"link": "Go to themes"
},
"lang": {
"title": "Language",
"description": "The language used for Photon's UI.",
"note": "Languages other than English and Hebrew are community translated, and may be incomplete.",
"": "Dont translate the below!",
"en": "English",
"en-US": "English",
"he": "Hebrew",
"auto": "Auto"
},
"view": {
"title": "Post style",
"list": "Show posts in a list, with post bodies and compact media.",
"cozy": "Show posts with large images, rich embeds, and longer post bodies.",
"compact": "Show posts in a list, without post bodies and with tighter spacing.",
"legacy": "The old look of Photon."
},
"sort": {
"title": "Default sort",
"description": "The default sorting to use in feeds."
},
"postsInNewTab": {
"title": "Open posts in new tab",
"description": "Open posts in a separate tab instead of the current."
},
"displayName": {
"title": "Use display name",
"description": "Show users' display names instead of their actual usernames."
},
"limitLayoutWidth": {
"title": "Limit layout width",
"description": "Improve readability by limiting the main content width."
},
"placeholders": {
"title": "Random placeholders",
"description": "Show random placeholders for certain text inputs."
},
"expandImages": {
"title": "Expand images",
"description": "Clicking on a post's image brings you to an expanded view rather than the post page."
},
"duplicateTitles": {
"title": "Hide duplicate titles/bodies",
"description": "Hides the post title and body if they are identical to the embed."
},
"thumbnailSide": {
"title": "Thumbnail alignment",
"description": "Where thumbnails should be on the post in list/compact mode",
"left": "Left",
"right": "Right"
},
"font": {
"title": "Font",
"description": "What font Photon uses in the UI."
}
},
"embeds": {
"title": "Embeds",
"clickToView": {
"title": "Click to view",
"description": "Only load embeds once you click on them."
},
"youtube": {
"description": "The website to embed YouTube content in."
}
},
"lemmy": {
"title": "Lemmy",
"compactFeatured": {
"title": "Compact featured posts",
"description": "Make featured posts more compact"
},
"markReadPosts": {
"title": "Mark read posts",
"description": "Mark a post as read when you click on it"
},
"fadeReadPosts": {
"title": "Fade read posts",
"description": "Fade the title of posts you've already read"
},
"crosspostMarker": {
"title": "Mark crossposts",
"description": "Show 'crossposted from' when crossposting."
},
"hideSubmissions": {
"title": "Hide submissions",
"description": "Hide certain types of submissions.",
"deleted": "Deleted by user",
"removed": "Removed by moderator"
},
"nsfwBlur": {
"title": "NSFW blur",
"description": "Blur images and remove post bodies of NSFW posts."
},
"instances": {
"title": "Show instances",
"description": "Show the instances where certain content is from."
}
},
"moderation": {
"title": "Moderation",
"replyPresets": {
"title": "Removal reply presets",
"description": "Presets to use for 'reply reason' in the submission removal dialog.",
"syntax": "Syntax"
}
},
"other": {
"title": "Other",
"debug": {
"title": "Debug info",
"description": "Display debug information"
}
}
} }
} }
+121 -123
View File
@@ -36,11 +36,13 @@
</script> </script>
<svelte:head> <svelte:head>
<title>Settings</title> <title>{$t('settings.title')}</title>
</svelte:head> </svelte:head>
<h1 class="text-3xl font-bold flex justify-between"> <h1 class="text-3xl font-bold flex justify-between">
Settings <Button {$t('settings.title')}
<Button
size="square-md"
on:click={() => { on:click={() => {
toast({ toast({
content: $t('toast.resetSettings'), content: $t('toast.resetSettings'),
@@ -50,98 +52,100 @@
class="font-normal" class="font-normal"
> >
<Icon src={ArrowPath} mini size="16" slot="prefix" /> <Icon src={ArrowPath} mini size="16" slot="prefix" />
Reset
</Button> </Button>
</h1> </h1>
<div class="flex flex-col gap-4" style="scroll-behavior: smooth;"> <div class="flex flex-col gap-4" style="scroll-behavior: smooth;">
<Section title="Navigation"> <Section title={$t('settings.navigation.title')}>
<div>
<Button
color="ghost"
on:click={() => {
$userSettings.dock.noGap = true
$userSettings.dock.top = true
}}
disabled={$userSettings.dock.noGap && $userSettings.dock.top}
>
Legacy Navigation Style
</Button>
</div>
<Setting> <Setting>
<span slot="title">Dock position</span> <span slot="title">{$t('settings.navigation.dockPos.title')}</span>
<span slot="description">Where the dock should be put</span> <span slot="description">
{$t('settings.navigation.dockPos.description')}
</span>
<MultiSelect <MultiSelect
options={[true, false, null]} options={[true, false, null]}
optionNames={['Top', 'Bottom', 'Adaptive']} optionNames={[
$t('settings.navigation.dockPos.top'),
$t('settings.navigation.dockPos.bottom'),
$t('settings.navigation.dockPos.adaptive'),
]}
bind:selected={$userSettings.dock.top} bind:selected={$userSettings.dock.top}
/> />
</Setting> </Setting>
<Setting> <Setting>
<span slot="title">Panel mode</span> <span slot="title">{$t('settings.navigation.panel.title')}</span>
<span slot="description"> <span slot="description">
Extend the dock to screen edges, similar to a panel. {$t('settings.navigation.panel.description')}
</span> </span>
<MultiSelect <MultiSelect
options={[true, false, null]} options={[true, false, null]}
optionNames={['On', 'Off', 'Adaptive']} optionNames={[
$t('settings.navigation.panel.on'),
$t('settings.navigation.panel.off'),
$t('settings.navigation.panel.adaptive'),
]}
bind:selected={$userSettings.dock.noGap} bind:selected={$userSettings.dock.noGap}
/> />
</Setting> </Setting>
</Section> </Section>
<Section title="Photon"> <Section title={$t('settings.app.title')}>
<Setting> <Setting>
<span slot="title">Theming</span> <span slot="title">{$t('settings.app.theming.title')}</span>
<span slot="description">Customize Photon's colors.</span> <span slot="description">{$t('settings.app.theming.description')}</span>
<Button href="/theme"> <Button href="/theme">
Go to themes <Icon src={ArrowRight} size="16" mini slot="suffix" /> {$t('settings.app.theming.link')}
<Icon src={ArrowRight} size="16" mini slot="suffix" />
</Button> </Button>
</Setting> </Setting>
<Setting> <Setting>
<span slot="title">Language</span> <span slot="title">{$t('settings.app.lang.title')}</span>
<p slot="description"> <p slot="description">
The language used for Photon's UI. {$t('settings.app.lang.description')}
<Note> <Note>
All languages other than US English and Hebrew are community {$t('settings.app.lang.note')}
translated, and may be incomplete!
</Note> </Note>
</p> </p>
<Select bind:value={$userSettings.language}> <Select bind:value={$userSettings.language}>
<option value={null}>Auto-Detect</option> <option value={null}>{$t('settings.app.lang.auto')}</option>
{#each $locales as locale} {#each $locales as locale}
<option value={locale}>{locale}</option> <option value={locale}>
{$t(`settings.app.lang.${locale}`, { default: locale })}
</option>
{/each} {/each}
</Select> </Select>
</Setting> </Setting>
<Setting> <Setting>
<span slot="title">Post style</span> <span slot="title">{$t('settings.app.view.title')}</span>
<ViewSelect showLabel={false} /> <ViewSelect showLabel={false} />
<p slot="description"> <p slot="description">
{#if $userSettings.view == 'list'} {#if $userSettings.view == 'list'}
Show posts in a list, with post bodies and compact images. {$t('settings.app.view.list')}
{:else if $userSettings.view == 'cozy'} {:else if $userSettings.view == 'cozy'}
Show posts with large images, rich embeds and longer post bodies. {$t('settings.app.view.cozy')}
{:else if $userSettings.view == 'compact'} {:else if $userSettings.view == 'compact'}
Show posts in a list, without post bodies and with tighter spacing. {$t('settings.app.view.compact')}
{:else if $userSettings.view == 'card'} {:else if $userSettings.view == 'card'}
Photon's old post style. {$t('settings.app.view.legacy')}
{/if} {/if}
</p> </p>
</Setting> </Setting>
<Setting optionClass="flex-[2] max-w-full flex-wrap min-w-0"> <Setting optionClass="flex-[2] max-w-full flex-wrap min-w-0">
<span slot="title">Default sort</span> <span slot="title">{$t('settings.app.sort.title')}</span>
<span slot="description">The default sort to use for feeds.</span> <span slot="description">{$t('settings.app.sort.description')}</span>
<div class="flex max-[500px]:flex-col flex-wrap gap-2 w-max max-w-full"> <div class="flex max-[500px]:flex-col flex-wrap gap-2 w-max max-w-full">
<div class="max-w-full"> <div class="max-w-full">
<Select bind:value={$userSettings.defaultSort.feed}> <Select bind:value={$userSettings.defaultSort.feed}>
<span slot="label" class="flex items-center gap-1"> <span slot="label" class="flex items-center gap-1">
<Icon src={GlobeAmericas} size="16" mini /> <Icon src={GlobeAmericas} size="16" mini />
Location {$t('filter.location.label')}
</span> </span>
<option value="All">All</option> <option value="All">{$t('filter.location.all')}</option>
<option value="Local">Local</option> <option value="Local">{$t('filter.location.local')}</option>
<option value="Subscribed">Subscribed</option> <option value="Subscribed">
{$t('filter.location.subscribed')}
</option>
<option value="Moderator">{$t('filter.location.moderator')}</option>
</Select> </Select>
</div> </div>
<div class="max-w-full"> <div class="max-w-full">
@@ -154,80 +158,63 @@
<Select bind:value={$userSettings.defaultSort.comments}> <Select bind:value={$userSettings.defaultSort.comments}>
<span slot="label" class="flex items-center gap-1"> <span slot="label" class="flex items-center gap-1">
<Icon src={ChatBubbleOvalLeftEllipsis} size="14" mini /> <Icon src={ChatBubbleOvalLeftEllipsis} size="14" mini />
Comments {$t('content.comments')}
</span> </span>
<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>
</Select> </Select>
</div> </div>
</div> </div>
</Setting> </Setting>
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.openLinksInNewTab} bind:checked={$userSettings.openLinksInNewTab}
title="Open posts in new tab" title={$t('settings.app.postsInNewTab.title')}
description="Rather than opening posts in the same tab, open a separate one." description={$t('settings.app.postsInNewTab.description')}
/> />
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.displayNames} bind:checked={$userSettings.displayNames}
title="Use display name" title={$t('settings.app.displayName.title')}
description="Show a user's display name instead of their account username." description={$t('settings.app.displayName.description')}
/> />
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.newWidth} bind:checked={$userSettings.newWidth}
title="Limit layout width" title={$t('settings.app.limitLayoutWidth.title')}
description="Improve readability by limiting main content width." description={$t('settings.app.limitLayoutWidth.description')}
/> />
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.randomPlaceholders} bind:checked={$userSettings.randomPlaceholders}
title="Random placeholders" title={$t('settings.app.placeholders.title')}
description="Show a random placeholder for forms for comments, posts, etc." description={$t('settings.app.placeholders.description')}
/> />
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.expandImages} bind:checked={$userSettings.expandImages}
title="Expand images" title={$t('settings.app.expandImages.title')}
description="Clicking on a post's image brings you to an expanded view rather than description={$t('settings.app.expandImages.description')}
sending you to the post page."
/> />
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.posts.deduplicateEmbed} bind:checked={$userSettings.posts.deduplicateEmbed}
title="Hide duplicate titles/bodies" title={$t('settings.app.duplicateTitles.title')}
description="Hides the post title and body if they're the same as the embed." description={$t('settings.app.duplicateTitles.description')}
/> />
<Setting> <Setting>
<span slot="title">Thumbnail alignment</span> <span slot="title">{$t('settings.app.thumbnailSide.title')}</span>
<span slot="description"> <span slot="description">
Where thumbnails should be on the post in list/compact view. {$t('settings.app.thumbnailSide.title')}
</span> </span>
<MultiSelect <MultiSelect
options={[true, false]} options={[true, false]}
optionNames={['Left', 'Right']} optionNames={[
$t('settings.app.thumbnailSide.left'),
$t('settings.app.thumbnailSide.right'),
]}
bind:selected={$userSettings.leftAlign} bind:selected={$userSettings.leftAlign}
/> />
</Setting> </Setting>
</Section>
<Section title="Embeds">
<ToggleSetting
title="Click to view"
description="Don't load an embed until you click it. (It is recommended to leave this on, to not load a video you don't want to load.)"
bind:checked={$userSettings.embeds.clickToView}
/>
<Setting>
<span slot="title">YouTube</span>
<span slot="description">
The website to use to embed YouTube content.
</span>
<Select bind:value={$userSettings.embeds.youtube}>
<option value="youtube">YouTube</option>
<option value="invidious">Invidious</option>
<option value="piped">Piped</option>
</Select>
</Setting>
<Setting vertical> <Setting vertical>
<span slot="title">Font</span> <span slot="title">{$t('settings.app.font.title')}</span>
<span slot="description">What font Photon should use.</span> <span slot="description">{$t('settings.app.font.description')}</span>
<MultiSelect <MultiSelect
options={['inter', 'satoshi/nunito', 'system', 'browser']} options={['inter', 'satoshi/nunito', 'system', 'browser']}
optionNames={['Inter', 'Satoshi/Nunito', 'System UI', 'Browser Font']} optionNames={['Inter', 'Satoshi/Nunito', 'System UI', 'Browser Font']}
@@ -236,91 +223,102 @@
</Setting> </Setting>
</Section> </Section>
<Section title="Lemmy"> <Section title={$t('settings.embeds.title')}>
<ToggleSetting
title={$t('settings.embeds.clickToView.title')}
description={$t('settings.embeds.clickToView.description')}
bind:checked={$userSettings.embeds.clickToView}
/>
<Setting>
<span slot="title">YouTube</span>
<span slot="description">
{$t('settings.embeds.youtube.description')}
</span>
<Select bind:value={$userSettings.embeds.youtube}>
<option value="youtube">YouTube</option>
<option value="invidious">Invidious</option>
<option value="piped">Piped</option>
</Select>
</Setting>
</Section>
<Section title={$t('settings.lemmy.title')}>
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.posts.compactFeatured} bind:checked={$userSettings.posts.compactFeatured}
title="Compact featured posts" title={$t('settings.lemmy.compactFeatured.title')}
description="Make featured posts more compact." description={$t('settings.lemmy.compactFeatured.description')}
/> />
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.markPostsAsRead} bind:checked={$userSettings.markPostsAsRead}
title="Mark read posts" title={$t('settings.lemmy.markReadPosts.title')}
description="Mark a post as read when you click on it." description={$t('settings.lemmy.markReadPosts.description')}
/> />
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.markReadPosts} bind:checked={$userSettings.markReadPosts}
title="Fade read posts" title={$t('settings.lemmy.fadeReadPosts.title')}
description="Fade the title of posts you've already read." description={$t('settings.lemmy.fadeReadPosts.title')}
/> />
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.crosspostOriginalLink} bind:checked={$userSettings.crosspostOriginalLink}
title="'Crossposted from' when crossposting" title={$t('settings.lemmy.crosspostMarker.title')}
description="If enabled, crossposts will include a link to the original post." description={$t('settings.lemmy.crosspostMarker.description')}
/> />
<Setting> <Setting>
<span slot="title">Hide Submissions</span> <span slot="title">{$t('settings.lemmy.hideSubmissions.title')}</span>
<span slot="description"> <span slot="description">
<p>Hide certain types of submissions.</p> <p>{$t('settings.lemmy.hideSubmissions.description')}</p>
<p>
Looking to hide read posts? That was moved to your <Link
href="/profile/settings"
highlight
>
profile settings.
</Link>
</p>
</span> </span>
<div class="flex flex-col items-start gap-4 flex-wrap"> <div class="flex flex-col items-start gap-4 flex-wrap">
<Switch bind:checked={$userSettings.hidePosts.deleted}>Deleted</Switch> <Switch bind:checked={$userSettings.hidePosts.deleted}>
{$t('settings.lemmy.hideSubmissions.deleted')}
</Switch>
<Switch bind:checked={$userSettings.hidePosts.removed}> <Switch bind:checked={$userSettings.hidePosts.removed}>
Removed by Moderator {$t('settings.lemmy.hideSubmissions.removed')}
</Switch> </Switch>
</div> </div>
</Setting> </Setting>
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.nsfwBlur} bind:checked={$userSettings.nsfwBlur}
title="NSFW blur" title={$t('settings.lemmy.nsfwBlur.title')}
description="Blur images and remove post bodies of content tagged NSFW." description={$t('settings.lemmy.nsfwBlur.description')}
/> />
<Setting> <Setting>
<span slot="title">Show instances</span> <span slot="title">{$t('settings.lemmy.instances.title')}</span>
<span slot="description">Show items' instances.</span> <span slot="description">
{$t('settings.lemmy.instances.description')}
</span>
<div class="flex flex-row flex-wrap items-center gap-4"> <div class="flex flex-row flex-wrap items-center gap-4">
<Checkbox bind:checked={$userSettings.showInstances.user}> <Checkbox bind:checked={$userSettings.showInstances.user}>
Users {$t('content.users')}
</Checkbox> </Checkbox>
<Checkbox bind:checked={$userSettings.showInstances.comments}> <Checkbox bind:checked={$userSettings.showInstances.comments}>
Comments {$t('content.comments')}
</Checkbox> </Checkbox>
<Checkbox bind:checked={$userSettings.showInstances.community}> <Checkbox bind:checked={$userSettings.showInstances.community}>
Communities {$t('content.communities')}
</Checkbox> </Checkbox>
</div> </div>
</Setting> </Setting>
</Section> </Section>
<Section title="Moderation"> <Section title={$t('settings.moderation.title')}>
<Setting mainClass="md:flex-row flex-col !items-start"> <Setting mainClass="md:flex-row flex-col !items-start">
<span slot="title">Removal reply presets</span> <span slot="title">{$t('settings.moderation.replyPresets.title')}</span>
<span slot="description"> <span slot="description">
<p>Presets to use for "Reply reason" in a submission removal.</p> <p>{$t('settings.moderation.replyPresets.description')}</p>
<ul class="leading-6"> <ul class="leading-6">
<li>Syntax:</li> <li>{$t('settings.moderation.replyPresets.syntax')}</li>
<li> <li>
<code>{'{{reason}}'}</code> <code>{'{{reason}}'}</code>
: The provided reason
</li> </li>
<li> <li>
<code>{'{{post}}'}</code> <code>{'{{post}}'}</code>
: The title of the post
</li> </li>
<li> <li>
<code>{'{{community}}'}</code> <code>{'{{community}}'}</code>
: The community the submission was removed in.
</li> </li>
<li> <li>
<code>{'{{username}}'}</code> <code>{'{{username}}'}</code>
: The username of the creator of the submission.
</li> </li>
</ul> </ul>
</span> </span>
@@ -395,11 +393,11 @@
</Setting> </Setting>
</Section> </Section>
<Section title="Other"> <Section title={$t('settings.other.title')}>
<ToggleSetting <ToggleSetting
bind:checked={$userSettings.debugInfo} bind:checked={$userSettings.debugInfo}
title="Debug info" title={$t('settings.other.debug.title')}
description="Display debug information" description={$t('settings.other.debug.description')}
/> />
</Section> </Section>
</div> </div>