From 6c3372443446a6b5724d35ce3d96d824a2af658e Mon Sep 17 00:00:00 2001 From: Xylight Date: Sat, 10 Aug 2024 20:18:07 -0700 Subject: [PATCH] i18n: add more languages --- src/lib/components/lemmy/post/PostVote.svelte | 6 +++++- src/lib/i18n/en.json | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib/components/lemmy/post/PostVote.svelte b/src/lib/components/lemmy/post/PostVote.svelte index a7566870..812c6121 100644 --- a/src/lib/components/lemmy/post/PostVote.svelte +++ b/src/lib/components/lemmy/post/PostVote.svelte @@ -23,6 +23,7 @@ import { fly } from 'svelte/transition' import { backOut } from 'svelte/easing' import { t } from '$lib/translations' + import { errorMessage } from '$lib/lemmy/error' export let post: Post export let vote: number = 0 @@ -42,7 +43,10 @@ loading = true oldScore = score vote = newVote - const res = await voteItem(post, newVote, $profile.jwt) + const res = await voteItem(post, newVote, $profile.jwt).catch((e) => { + toast({ content: errorMessage(e), type: 'error' }) + return { upvotes: 0, downvotes: 0, score: 0 } + }) ;({ upvotes, downvotes, score } = res) loading = false } diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index 8dbbcafc..3129785d 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -818,6 +818,18 @@ "incorrect_login_9": "Each of these requests you make are sending data through via an incredible technology. And you're using it to make failed logins.", "incorrect_login_10": "Think about this. The poor instance admins have to maintain their server just for you to make these useless requests.", "incorrect_login_11": "I give up, for real this time.", - "incorrect_login_12": "..." + "incorrect_login_12": "...", + "registration_application_is_pending": "The registration application for that account hasn't been accepted yet.", + "couldnt_find_post": "That post doesn't exist, isn't on this instance, or was removed.", + "cant_block_yourself": "You can't block yourself. You shouldn't either, you're a nice person!", + "email_not_verified": "Your account's email isn't verified.", + "passwords_do_not_match": "Your input password and the verification password do not match.", + "honeypot_failed": "How did you- are you a bot? Beep bop bap boop. If you're not, the Honeypot check failed.", + "downvotes_are_disabled": "Downvotes are disabled on this instance.", + "email_already_exists": "An account already exists with that email.", + "slurs": "Your submission contains a term banned in this instance.", + "captcha_failed": "Incorrect CAPTCHA answer.", + "cant_block_local_instance": "You can't block the instance you are actively using.", + "invalid_vote_value": "You can't commit voter fraud on Lemmy posts, sorry." } }