i18n: localize toasts
This commit is contained in:
1 parent
b57baa3769
commit
e89d2aaddb
35 files changed
+169
-177
No files matched your search
@@ -107,16 +107,7 @@
|
||||
<PostBody body={post.post.body} {view} style="grid-area: body" />
|
||||
{/if}
|
||||
{#if actions}
|
||||
<PostActions
|
||||
bind:post
|
||||
on:edit={(e) => {
|
||||
toast({
|
||||
content: 'The post was edited successfully.',
|
||||
type: 'success',
|
||||
})
|
||||
}}
|
||||
style="grid-area: actions;"
|
||||
/>
|
||||
<PostActions bind:post style="grid-area: actions;" />
|
||||
{:else if view == 'compact'}
|
||||
<div class="flex flex-row items-center gap-2 text-sm">
|
||||
<Badge>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
if (!data.community && !edit) {
|
||||
toast({
|
||||
type: 'warning',
|
||||
content: 'You need to set a community.',
|
||||
content: $t('toast.needCommunity'),
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -96,7 +96,7 @@
|
||||
new URL(data.url)
|
||||
} catch (err) {
|
||||
toast({
|
||||
content: 'Invalid URL',
|
||||
content: $t('toast.invalidURL'),
|
||||
type: 'warning',
|
||||
})
|
||||
return
|
||||
@@ -171,14 +171,14 @@
|
||||
.join('\n')
|
||||
|
||||
toast({
|
||||
content: `Generated title and body from that website. Would you like to undo this action?`,
|
||||
content: $t('toast.generatedTitle'),
|
||||
type: 'info',
|
||||
action: () => (data = oldData),
|
||||
duration: 15 * 1000,
|
||||
})
|
||||
} catch (e) {
|
||||
toast({
|
||||
content: 'There was no usable title or description of that website.',
|
||||
content: $t('toast.failGenerateTitle'),
|
||||
})
|
||||
}
|
||||
generation.loading = false
|
||||
@@ -328,7 +328,7 @@
|
||||
{#if !edit}
|
||||
<Button
|
||||
on:click={() => {
|
||||
toast({ content: 'Restored from draft' })
|
||||
toast({ content: $t('toast.restoredFromDraft') })
|
||||
const draft = getSessionStorage('postDraft')
|
||||
if (draft && !edit) {
|
||||
// @ts-ignore
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
import { site } from '$lib/lemmy.js'
|
||||
import { fly } from 'svelte/transition'
|
||||
import { backOut } from 'svelte/easing'
|
||||
import { t } from '$lib/translations'
|
||||
|
||||
export let post: Post
|
||||
export let vote: number = 0
|
||||
@@ -42,7 +43,7 @@
|
||||
|
||||
const castVote = async (newVote: number) => {
|
||||
if (!$profile?.jwt) {
|
||||
toast({ content: 'You must be logged in to vote.', type: 'warning' })
|
||||
toast({ content: $t('toast.loginVoteGate'), type: 'warning' })
|
||||
return
|
||||
}
|
||||
loading = true
|
||||
|
||||
Reference in new issue
Block a user