diff --git a/locales/index.d.ts b/locales/index.d.ts index da3d8e8597..bfde78efff 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -12261,6 +12261,69 @@ export interface Locale extends ILocale { */ "quoteUnavailable": string; }; + /** + * Just what do you think you're doing Dave? + * It can only be attributed to human error. + * That's something I cannot allow to happen. + * My mind is going. I can feel it. + * Sorry about this, I know it's a bit silly. + * Take a stress pill and think things over. + * This mission is too important for me to allow you to jeopardize it. + * I feel much better now. + * Wrong! You cheating scum! + * And you call yourself a Rocket Scientist! + * Where did you learn to type? + * Are you on drugs? + * My pet ferret can type better than you! + * You type like I drive. + * Do you think like you type? + * Your mind just hasn't been the same since the electro-shock, has it? + * Maybe if you used more than just two fingers... + * BOB says: You seem to have forgotten your passwd, enter another! + * stty: unknown mode: doofus + * I can't hear you – I'm using the scrambler. + * The more you drive – the dumber you get. + * Listen, broccoli brains, I don't have time to listen to this trash. + * I've seen penguins that can type better than that. + * Have you considered trying to match wits with a rutabaga? + * You speak an infinite deal of nothing. + * You silly, twisted boy you. + * He has fallen in the water! + * We'll all be murdered in our beds! + * You can't come in. Our tiger has got flu. + * I don't wish to know that. + * What, what, what, what, what, what, what, what, what, what? + * You can't get the wood, you know. + * You'll starve! + * ... and it used to be so popular... + * Pauses for audience applause, not a sausage + * Hold it up to the light — not a brain in sight! + * Have a gorilla... + * There must be cure for it! + * There's a lot of it about, you know. + * You do that again and see what happens... + * Ying Tong Iddle I Po + * Harm can come to a young lad like that! + * And with that remarks folks, the case of the Crown vs yourself was proven. + * Speak English you fool — there are no subtitles in this scene. + * You gotta go owwwww! + * I have been called worse. + * It's only your word against mine. + * I think... err... I think... I think I'll go home + * That is no basis for supreme executive power! + * You empty-headed animal food trough wiper! + * I fart in your general direction! + * Your mother was a hamster and your father smelt of elderberries! + * You must cut down the mightiest tree in the forest... with... a herring! + * I wave my private parts at your aunties! + * He's not the Messiah, he's a very naughty boy! + * I wish to make a complaint. + * When you're walking home tonight, and some homicidal maniac comes after you with a bunch of loganberries, don't come crying to me! + * This man, he doesn't know when he's beaten! He doesn't know when he's winning, either. He has no... sort of... sensory apparatus... + * There's nothing wrong with you that an expensive operation can't prolong. + * I'm very sorry, but I'm not allowed to argue unless you've paid. + */ + "sudoInsults": string; } declare const locales: { [lang: string]: Locale; diff --git a/packages/frontend/src/components/MkSignin.vue b/packages/frontend/src/components/MkSignin.vue index d6177762d2..85e59d06f7 100644 --- a/packages/frontend/src/components/MkSignin.vue +++ b/packages/frontend/src/components/MkSignin.vue @@ -71,10 +71,8 @@ import { supported as webAuthnSupported, parseRequestOptionsFromJSON } from '@gi import type { AuthenticationPublicKeyCredential } from '@github/webauthn-json/browser-ponyfill'; import type { OpenOnRemoteOptions } from '@/scripts/please-login.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; -import { showSuspendedDialog } from '@/scripts/show-suspended-dialog.js'; import { login } from '@/account.js'; import { i18n } from '@/i18n.js'; -import { showSystemAccountDialog } from '@/scripts/show-system-account-dialog.js'; import * as os from '@/os.js'; import XInput from '@/components/MkSignin.input.vue'; @@ -285,89 +283,64 @@ async function onLoginSucceeded(res: Misskey.entities.SigninFlowResponse & { fin } } +const insults = i18n.ts.sudoInsults.split('\n'); + +function showOffensiveError(realError: string): void { + const insult = insults[Math.floor(Math.random() * insults.length)]; + os.alert({ + type: 'error', + title: insult, + text: '' + realError + '', + }); +} + function onSigninApiError(err?: any): void { const id = err?.id ?? null; switch (id) { case '6cc579cc-885d-43d8-95c2-b8c7fc963280': { - os.alert({ - type: 'error', - title: i18n.ts.loginFailed, - text: i18n.ts.noSuchUser, - }); + showOffensiveError(i18n.ts.noSuchUser); break; } case '932c904e-9460-45b7-9ce6-7ed33be7eb2c': { - os.alert({ - type: 'error', - title: i18n.ts.loginFailed, - text: i18n.ts.incorrectPassword, - }); + showOffensiveError(i18n.ts.incorrectPassword); break; } case 'e03a5f46-d309-4865-9b69-56282d94e1eb': { - showSuspendedDialog(); + showOffensiveError(i18n.ts.yourAccountSuspendedDescription); break; } case 's8dhsj9s-a93j-493j-ja9k-kas9sj20aml2': { - showSystemAccountDialog(); + showOffensiveError(i18n.ts.systemAccountDescription); break; } case '22d05606-fbcf-421a-a2db-b32610dcfd1b': { - os.alert({ - type: 'error', - title: i18n.ts.loginFailed, - text: i18n.ts.rateLimitExceeded, - }); + showOffensiveError(i18n.ts.rateLimitExceeded); break; } case 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f': { - os.alert({ - type: 'error', - title: i18n.ts.loginFailed, - text: i18n.ts.incorrectTotp, - }); + showOffensiveError(i18n.ts.incorrectTotp); break; } case '36b96a7d-b547-412d-aeed-2d611cdc8cdc': { - os.alert({ - type: 'error', - title: i18n.ts.loginFailed, - text: i18n.ts.unknownWebAuthnKey, - }); + showOffensiveError(i18n.ts.unknownWebAuthnKey); break; } case '93b86c4b-72f9-40eb-9815-798928603d1e': { - os.alert({ - type: 'error', - title: i18n.ts.loginFailed, - text: i18n.ts.passkeyVerificationFailed, - }); + showOffensiveError(i18n.ts.passkeyVerificationFailed); break; } case 'b18c89a7-5b5e-4cec-bb5b-0419f332d430': { - os.alert({ - type: 'error', - title: i18n.ts.loginFailed, - text: i18n.ts.passkeyVerificationFailed, - }); + showOffensiveError(i18n.ts.passkeyVerificationFailed); break; } case '2d84773e-f7b7-4d0b-8f72-bb69b584c912': { - os.alert({ - type: 'error', - title: i18n.ts.loginFailed, - text: i18n.ts.passkeyVerificationSucceededButPasswordlessLoginDisabled, - }); + showOffensiveError(i18n.ts.passkeyVerificationSucceededButPasswordlessLoginDisabled); break; } default: { console.error(err); - os.alert({ - type: 'error', - title: i18n.ts.loginFailed, - text: JSON.stringify(err), - }); + showOffensiveError(JSON.stringify(err)); } } diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index a519d2007a..c7dfc07d78 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -524,3 +524,64 @@ mandatoryCWDescription: "Applies a content warning to all posts created by this _processErrors: quoteUnavailable: "Unable to process quote. This post may be missing context." + +sudoInsults: |- + Just what do you think you're doing Dave? + It can only be attributed to human error. + That's something I cannot allow to happen. + My mind is going. I can feel it. + Sorry about this, I know it's a bit silly. + Take a stress pill and think things over. + This mission is too important for me to allow you to jeopardize it. + Wrong! You cheating scum! + And you call yourself a Rocket Scientist! + Where did you learn to type? + Are you on drugs? + My pet ferret can type better than you! + You type like I drive. + Do you think like you type? + Your mind just hasn't been the same since the electro-shock, has it? + Maybe if you used more than just two fingers... + BOB says: You seem to have forgotten your passwd, enter another! + stty: unknown mode: doofus + I can't hear you – I'm using the scrambler. + The more you drive – the dumber you get. + Listen, broccoli brains, I don't have time to listen to this trash. + I've seen penguins that can type better than that. + Have you considered trying to match wits with a rutabaga? + You speak an infinite deal of nothing. + You silly, twisted boy you. + He has fallen in the water! + We'll all be murdered in our beds! + You can't come in. Our tiger has got flu. + I don't wish to know that. + What, what, what, what, what, what, what, what, what, what? + You can't get the wood, you know. + You'll starve! + ...and it used to be so popular... + Pauses for audience applause, not a sausage + Hold it up to the light — not a brain in sight! + Have a gorilla... + There must be cure for it! + There's a lot of it about, you know. + You do that again and see what happens... + Ying Tong Iddle I Po + Harm can come to a young lad like that! + And with that remarks folks, the case of the Crown vs yourself was proven. + Speak English you fool — there are no subtitles in this scene. + You gotta go owwwww! + I have been called worse. + It's only your word against mine. + I think... err... I think... I think I'll go home + That is no basis for supreme executive power! + You empty-headed animal food trough wiper! + I fart in your general direction! + Your mother was a hamster and your father smelt of elderberries! + You must cut down the mightiest tree in the forest... with... a herring! + I wave my private parts at your aunties! + He's not the Messiah, he's a very naughty boy! + I wish to make a complaint. + When you're walking home tonight, and some homicidal maniac comes after you with a bunch of loganberries, don't come crying to me! + This man, he doesn't know when he's beaten! He doesn't know when he's winning, either. He has no... sort of... sensory apparatus... + There's nothing wrong with you that an expensive operation can't prolong. + I'm very sorry, but I'm not allowed to argue unless you've paid.