fix: make translate feature mostly work
This commit is contained in:
1 parent
4b42e40817
commit
19fa06b5bd
5 files changed
+18
-21
No files matched your search
@@ -8,19 +8,15 @@
|
|||||||
BookmarkSlash,
|
BookmarkSlash,
|
||||||
BugAnt,
|
BugAnt,
|
||||||
ChatBubbleOvalLeft,
|
ChatBubbleOvalLeft,
|
||||||
ChatBubbleOvalLeftEllipsis,
|
|
||||||
CheckBadge,
|
CheckBadge,
|
||||||
EllipsisHorizontal,
|
EllipsisHorizontal,
|
||||||
Eye,
|
Eye,
|
||||||
EyeSlash,
|
EyeSlash,
|
||||||
Flag,
|
Flag,
|
||||||
GlobeAlt,
|
|
||||||
Home,
|
|
||||||
Icon,
|
Icon,
|
||||||
Language,
|
Language,
|
||||||
Newspaper,
|
Newspaper,
|
||||||
PencilSquare,
|
PencilSquare,
|
||||||
Scale,
|
|
||||||
ServerStack,
|
ServerStack,
|
||||||
Share,
|
Share,
|
||||||
Trash,
|
Trash,
|
||||||
@@ -36,12 +32,7 @@
|
|||||||
} from '$lib/components/lemmy/moderation/moderation.js'
|
} from '$lib/components/lemmy/moderation/moderation.js'
|
||||||
import ModerationMenu from '$lib/components/lemmy/moderation/ModerationMenu.svelte'
|
import ModerationMenu from '$lib/components/lemmy/moderation/ModerationMenu.svelte'
|
||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
import {
|
import { deleteItem, markAsRead, save } from '$lib/lemmy/contentview.js'
|
||||||
contentView,
|
|
||||||
deleteItem,
|
|
||||||
markAsRead,
|
|
||||||
save,
|
|
||||||
} from '$lib/lemmy/contentview.js'
|
|
||||||
import { setSessionStorage } from '$lib/session.js'
|
import { setSessionStorage } from '$lib/session.js'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { userSettings, type View } from '$lib/settings.js'
|
import { userSettings, type View } from '$lib/settings.js'
|
||||||
@@ -55,11 +46,9 @@
|
|||||||
toast,
|
toast,
|
||||||
} from 'mono-svelte'
|
} from 'mono-svelte'
|
||||||
import { fediseer, type Data } from '$lib/fediseer/fediseer'
|
import { fediseer, type Data } from '$lib/fediseer/fediseer'
|
||||||
import Fediseer from '$lib/fediseer/Fediseer.svelte'
|
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
import { text } from '$lib/components/translate/translation'
|
import { text } from '$lib/components/translate/translation'
|
||||||
import Translation from '$lib/components/translate/Translation.svelte'
|
import { hidePost, type MediaType } from './helpers'
|
||||||
import { hidePost, postLink, type MediaType } from './helpers'
|
|
||||||
import { feature } from '$lib/version'
|
import { feature } from '$lib/version'
|
||||||
import Switch from '$lib/components/input/Switch.svelte'
|
import Switch from '$lib/components/input/Switch.svelte'
|
||||||
import { instanceToURL } from '$lib/util'
|
import { instanceToURL } from '$lib/util'
|
||||||
@@ -92,7 +81,9 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if fediseerData}
|
{#if fediseerData}
|
||||||
|
{#await import('$lib/fediseer/Fediseer.svelte') then { default: Fediseer }}
|
||||||
<Fediseer bind:open={fediseerOpen} data={fediseerData} />
|
<Fediseer bind:open={fediseerOpen} data={fediseerData} />
|
||||||
|
{/await}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if editing}
|
{#if editing}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@
|
|||||||
class="flex flex-col border border-slate-200 border-b-slate-300 dark:border-t-zinc-700 dark:border-zinc-800
|
class="flex flex-col border border-slate-200 border-b-slate-300 dark:border-t-zinc-700 dark:border-zinc-800
|
||||||
focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring ring-slate-300
|
focus-within:border-primary-900 focus-within:dark:border-primary-100 focus-within:ring ring-slate-300
|
||||||
dark:ring-zinc-700 rounded-xl
|
dark:ring-zinc-700 rounded-xl
|
||||||
overflow-hidden transition-colors"
|
overflow-hidden transition-colors {$$props.class}"
|
||||||
class:mt-1={label}
|
class:mt-1={label}
|
||||||
>
|
>
|
||||||
{#if previewing}
|
{#if previewing}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
requestURL.searchParams.set('q', text)
|
requestURL.searchParams.set('q', text)
|
||||||
requestURL.searchParams.set('source', from)
|
requestURL.searchParams.set('source', from)
|
||||||
requestURL.searchParams.set('target', to)
|
requestURL.searchParams.set('target', to)
|
||||||
requestURL.searchParams.set('alternatives', '')
|
|
||||||
|
|
||||||
result = fetch(requestURL.toString(), {
|
result = fetch(requestURL.toString(), {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -89,7 +88,6 @@
|
|||||||
<Spinner width={32} />
|
<Spinner width={32} />
|
||||||
</div>
|
</div>
|
||||||
{:then result}
|
{:then result}
|
||||||
{#if !error}
|
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
previewButton={false}
|
previewButton={false}
|
||||||
previewing
|
previewing
|
||||||
@@ -98,7 +96,6 @@
|
|||||||
value={result.translatedText || 'Failed to translate'}
|
value={result.translatedText || 'Failed to translate'}
|
||||||
disabled
|
disabled
|
||||||
></MarkdownEditor>
|
></MarkdownEditor>
|
||||||
{/if}
|
|
||||||
{:catch err}
|
{:catch err}
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
previewButton={false}
|
previewButton={false}
|
||||||
@@ -106,7 +103,7 @@
|
|||||||
tools={false}
|
tools={false}
|
||||||
disabled
|
disabled
|
||||||
rows={8}
|
rows={8}
|
||||||
value={err || 'Failed to translate'}
|
value="Failed to translate: {err}"
|
||||||
class="!border-red-500 !ring-red-500 !text-red-500"
|
class="!border-red-500 !ring-red-500 !text-red-500"
|
||||||
></MarkdownEditor>
|
></MarkdownEditor>
|
||||||
{/await}
|
{/await}
|
||||||
|
|||||||
@@ -143,9 +143,18 @@
|
|||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||||
<div class="contents" on:click|stopPropagation={() => {}}>
|
<div class="contents" on:click|stopPropagation={() => {}}>
|
||||||
<Select bind:value={$colorScheme} class="ml-auto my-auto w-24" size="sm">
|
<Select bind:value={$colorScheme} class="ml-auto my-auto w-24" size="sm">
|
||||||
<option value="system">{$t('nav.menu.colorscheme.system')}</option>
|
<option value="system">
|
||||||
<option value="light">{$t('nav.menu.colorscheme.light')}</option>
|
<Icon src={ComputerDesktop} size="16" mini />
|
||||||
<option value="dark">{$t('nav.menu.colorscheme.dark')}</option>
|
{$t('nav.menu.colorscheme.system')}
|
||||||
|
</option>
|
||||||
|
<option value="light">
|
||||||
|
<Icon src={Sun} size="16" mini />
|
||||||
|
{$t('nav.menu.colorscheme.light')}
|
||||||
|
</option>
|
||||||
|
<option value="dark">
|
||||||
|
<Icon src={Moon} size="16" mini />
|
||||||
|
{$t('nav.menu.colorscheme.dark')}
|
||||||
|
</option>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
|
|||||||
Reference in new issue
Block a user