i18n: localize explore and search pages
This commit is contained in:
1 parent
2aaacf07a7
commit
9089dd9ac3
4 files changed
+36
-37
No files matched your search
@@ -1,3 +1,3 @@
|
||||
<h1 class="text-3xl font-bold flex items-center">
|
||||
<h1 class="text-3xl font-bold flex items-center gap-2">
|
||||
<slot />
|
||||
</h1>
|
||||
@@ -118,6 +118,17 @@
|
||||
"moderates": "Moderates"
|
||||
},
|
||||
"accounts": "Accounts",
|
||||
"communities": "Communities",
|
||||
"search": {
|
||||
"title": "Search",
|
||||
"federating": "Federating",
|
||||
"query": "Query",
|
||||
"noResults": {
|
||||
"title": "No Results",
|
||||
"description": "There are no results that match that filter. Try refining your search.",
|
||||
"alt": "Search across the fediverse"
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"crosspostCount": "crossposts",
|
||||
"commentCount": "comments",
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import CommunityItem from '$lib/components/lemmy/community/CommunityItem.svelte'
|
||||
import Location from '$lib/components/lemmy/dropdowns/Location.svelte'
|
||||
import { t } from '$lib/translations.js'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
|
||||
export let data
|
||||
|
||||
@@ -24,8 +27,8 @@
|
||||
<title>Communities</title>
|
||||
</svelte:head>
|
||||
|
||||
<h1 class="text-3xl font-bold">
|
||||
<span>Communities</span>
|
||||
<Header>
|
||||
<span>{$t('routes.communities')}</span>
|
||||
<Popover
|
||||
openOnHover
|
||||
class="!inline-flex"
|
||||
@@ -52,20 +55,9 @@
|
||||
</p>
|
||||
</Material>
|
||||
</Popover>
|
||||
</h1>
|
||||
</Header>
|
||||
<div class="flex flex-row flex-wrap gap-4 mt-4 items-center">
|
||||
<Select
|
||||
bind:value={data.type}
|
||||
on:change={() => searchParam($page.url, 'type', data.type ?? 'All', 'page')}
|
||||
>
|
||||
<span slot="label" class="flex items-center gap-1">
|
||||
<Icon src={GlobeAmericas} mini size="15" />
|
||||
Location
|
||||
</span>
|
||||
<option value="All">All</option>
|
||||
<option value="Local">Local</option>
|
||||
<option value="Subscribed">Subscribed</option>
|
||||
</Select>
|
||||
<Location selected={data.type} />
|
||||
<Sort selected={data.sort} />
|
||||
<form
|
||||
on:submit|preventDefault={() => searchParam($page.url, 'q', search, 'page')}
|
||||
@@ -73,8 +65,7 @@
|
||||
>
|
||||
<TextInput
|
||||
bind:value={search}
|
||||
placeholder="Search for a community..."
|
||||
label="Query"
|
||||
label={$t('routes.search.query')}
|
||||
size="md"
|
||||
/>
|
||||
<Button
|
||||
@@ -93,9 +84,8 @@
|
||||
{#if data.communities.length == 0}
|
||||
<Placeholder
|
||||
icon={QuestionMarkCircle}
|
||||
title="No communities"
|
||||
description="There are no communities that match this filter. Try refining your
|
||||
search."
|
||||
title={$t('routes.search.noResults.title')}
|
||||
description={$t('routes.search.noResults.description')}
|
||||
/>
|
||||
{/if}
|
||||
{#each data.communities as community}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
} from 'svelte-hero-icons'
|
||||
import { expoOut } from 'svelte/easing'
|
||||
import { slide } from 'svelte/transition'
|
||||
import { t } from '$lib/translations.js'
|
||||
|
||||
type Result = PostView | CommentView | PersonView | CommunityView
|
||||
|
||||
@@ -57,25 +58,20 @@
|
||||
>
|
||||
<span slot="label" class="flex items-center gap-1">
|
||||
<Icon src={AdjustmentsHorizontal} mini size="15" />
|
||||
Filter
|
||||
{$t('filter.type')}
|
||||
</span>
|
||||
<option value="All">All</option>
|
||||
<option value="Posts">Posts</option>
|
||||
<option value="Comments">Comments</option>
|
||||
<option value="Communities">Communities</option>
|
||||
<option value="Users">Users</option>
|
||||
<option value="All">{$t('content.all')}</option>
|
||||
<option value="Posts">{$t('content.posts')}</option>
|
||||
<option value="Comments">{$t('content.comments')}</option>
|
||||
<option value="Communities">{$t('content.communities')}</option>
|
||||
<option value="Users">{$t('content.users')}</option>
|
||||
</Select>
|
||||
<Sort navigate bind:selected={data.sort} />
|
||||
<form
|
||||
on:submit|preventDefault={() => searchParam($page.url, 'q', query, 'page')}
|
||||
class="flex flex-col sm:flex-row gap-2 sm:ml-auto items-center"
|
||||
>
|
||||
<TextInput
|
||||
bind:value={query}
|
||||
placeholder="Search for a keyword..."
|
||||
label="Query"
|
||||
size="md"
|
||||
/>
|
||||
<TextInput bind:value={query} label={$t('routes.search.query')} size="md" />
|
||||
<Button
|
||||
submit
|
||||
color="secondary"
|
||||
@@ -100,7 +96,7 @@
|
||||
{#if moreOptions}
|
||||
<div transition:slide={{ axis: 'y', easing: expoOut }} class="max-w-sm">
|
||||
<ObjectAutocomplete
|
||||
label="Community"
|
||||
label={$t('nav.create.community')}
|
||||
jwt={$profile?.jwt}
|
||||
listing_type={'All'}
|
||||
showWhenEmpty={true}
|
||||
@@ -112,8 +108,10 @@
|
||||
{#if !data.results}
|
||||
<Placeholder
|
||||
icon={MagnifyingGlass}
|
||||
title="No results"
|
||||
description="Search across the fediverse"
|
||||
title={$t('routes.search.noResults.title')}
|
||||
description={query == ''
|
||||
? $t('routes.search.noResults.alt')
|
||||
: $t('routes.search.noResults.description')}
|
||||
class="pt-4"
|
||||
/>
|
||||
{:else}
|
||||
@@ -123,7 +121,7 @@
|
||||
out:slide={{ axis: 'y', easing: expoOut }}
|
||||
>
|
||||
<Spinner width={24} />
|
||||
<span>Federating...</span>
|
||||
<span>{$t('routes.search.federating')}</span>
|
||||
</div>
|
||||
{:then object}
|
||||
{#if object}
|
||||
|
||||
Reference in new issue
Block a user