From 90398ab99ad8e75c898d227715c368fac2d34dff Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 9 Aug 2021 02:00:52 -0700 Subject: [PATCH] Show next steps message on all Invidious errors --- src/invidious/helpers/errors.cr | 52 +++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index dde0d2df..ae6839c6 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -111,30 +111,38 @@ end def error_redirect_helper(env : HTTP::Server::Context, locale : Hash(String, JSON::Any) | Nil) request_resource = env.request.resource + # Basic translations needed on all errors + next_steps_text = translate(locale, "next_steps_error_message") + refresh = translate(locale, "next_steps_error_message_refresh") + switch_instance = translate(locale, "Switch Invidious Instance") + + next_step_html = <<-END_HTML +

#{next_steps_text}

+ + END_HTML + + return next_step_html end