i18n: localize toasts

This commit is contained in:
Xylight committed 2024-06-04 13:02:05 -07:00
1 parent b57baa3769
commit e89d2aaddb
35 files changed
+169 -177

No files matched your search

@@ -41,12 +41,12 @@
await setUser(res.jwt, instance, username!)
$currentInstance = instance
toast({ content: 'Your login was refreshed.', type: 'success' })
toast({ content: $t('toast.loginRefresh'), type: 'success' })
} else {
throw new Error('Invalid credentials')
throw new Error($t('toast.invalidLogin'))
}
toast({ content: 'Successfully changed your password. ' })
toast({ content: $t('toast.passwordReset') })
} catch (e) {
toast({
content: e as any,
@@ -139,7 +139,7 @@
on:click={() => {
if (!totpLink) return
navigator.clipboard?.writeText(totpLink)
toast({ content: 'Copied to clipboard.' })
toast({ content: $t('toast.copied') })
}}
>
<Icon src={ClipboardDocument} size="20" mini />
@@ -41,8 +41,7 @@
})
toast({
content:
'Saved your user settings. If you changed your email, a verification email will have been sent.',
content: $t('toast.saveSettings'),
type: 'success',
})
} catch (err) {
@@ -65,21 +64,21 @@
switch (level) {
case 0: {
toast({
content: 'Are you sure you want to delete your account?',
content: $t('toast.confirmDelete1'),
action: () => deleteAccount(1),
})
return
}
case 1: {
toast({
content: 'Are you really sure?',
content: $t('toast.confirmDelete2'),
action: () => deleteAccount(2),
})
return
}
case 2: {
toast({
content: 'Final warning. Are you reeeeeeally sure?',
content: $t('toast.confirmDelete3'),
action: () => deleteAccount(3),
})
return
@@ -93,13 +92,13 @@
if (!(deletion.password || null)) {
toast({
content: 'You must provide your password.',
content: $t('toast.needPassword'),
type: 'warning',
})
}
const id = toast({
content: 'You did this. Deleting account...',
content: $t('toast.deleting'),
loading: true,
})
@@ -121,7 +120,7 @@
setUserID(-1)
toast({
content: 'Your account was deleted.',
content: $t('toast.deleted'),
})
goto('/')
} catch (err) {