diff --git a/Foxnouns.Frontend/src/lib/i18n/locales/en.json b/Foxnouns.Frontend/src/lib/i18n/locales/en.json index 47a39ac..d221de5 100644 --- a/Foxnouns.Frontend/src/lib/i18n/locales/en.json +++ b/Foxnouns.Frontend/src/lib/i18n/locales/en.json @@ -73,7 +73,14 @@ "extra-info-header": "Extra error information", "noscript-title": "This page requires JavaScript", "noscript-info": "This page requires JavaScript to function correctly. Some buttons may not work, or the page may not work at all.", - "noscript-short": "Requires JavaScript" + "noscript-short": "Requires JavaScript", + "404-description": "The page you were trying to visit was not found. If you're sure the page should exist, check your address bar for any typos.", + "back-to-profile-button": "Go back to your profile", + "back-to-main-page-button": "Go back to the main page", + "back-to-prev-page-button": "Go back to the previous page", + "400-description": "Something went wrong with your request. This error should never land you on this page, so it's probably a bug.", + "500-description": "Something went wrong on the server. Please try again later.", + "unknown-status-description": "Something went wrong, but we're not sure what. Please try again." }, "settings": { "general-information-tab": "General information", diff --git a/Foxnouns.Frontend/src/routes/+error.svelte b/Foxnouns.Frontend/src/routes/+error.svelte new file mode 100644 index 0000000..ca116b9 --- /dev/null +++ b/Foxnouns.Frontend/src/routes/+error.svelte @@ -0,0 +1,44 @@ + + + + {$t("title.an-error-occurred")} • pronouns.cc + + +
+

{$t("title.an-error-occurred")}

+

+ {$page.status}: {error.message} +

+

+ {#if $page.status === 400} + {$t("error.400-description")} + {:else if $page.status === 404} + {$t("error.404-description")} + {:else if $page.status === 500} + {$t("error.500-description")} + {:else} + {$t("error.unknown-status-description")} + {/if} +

+
+ {#if data.meUser} + + {$t("error.back-to-profile-button")} + + {:else} + {$t("error.back-to-main-page-button")} + {/if} + +
+