From 41cebeb8fa1ed6d03e0fc74d3724131d479d6964 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 28 Apr 2020 01:03:15 +0200 Subject: [PATCH] Make error pages translatable (#11163) * make error pages translatable * dont translate ":" * link need Safe --- options/locale/locale_en-US.ini | 4 ++++ templates/status/404.tmpl | 2 +- templates/status/500.tmpl | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 2a4789e22..d85dc39a8 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -82,6 +82,10 @@ loading = Loading… error404 = The page you are trying to reach either does not exist or you are not authorized to view it. +[error] +occurred = An error has occurred +report_message = If you are sure this is a Gitea bug, please search for issue on GitHub and open new issue if necessary. + [startpage] app_desc = A painless, self-hosted Git service install = Easy to install diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl index bb5ac1d5c..bd739280d 100644 --- a/templates/status/404.tmpl +++ b/templates/status/404.tmpl @@ -5,6 +5,6 @@
{{.i18n.Tr "error404" | Safe}} - {{if .ShowFooterVersion}}
Application Version: {{AppVer}}
{{end}} + {{if .ShowFooterVersion}}{{.i18n.Tr "admin.config.app_ver"}}: {{AppVer}}
{{end}} {{template "base/footer" .}} diff --git a/templates/status/500.tmpl b/templates/status/500.tmpl index 1dc7061d4..c66897822 100644 --- a/templates/status/500.tmpl +++ b/templates/status/500.tmpl @@ -3,9 +3,9 @@An error has occurred :
+ {{if .ErrorMsg}}{{.i18n.Tr "error.occurred"}}:
{{.ErrorMsg}}{{end}} - {{if .ShowFooterVersion}}
Application Version: {{AppVer}}
{{end}} - {{if .IsAdmin}}If you are sure this is Gitea bug, please search for issue on GitHub and open new issue if necessary.
{{end}} + {{if .ShowFooterVersion}}{{.i18n.Tr "admin.config.app_ver"}}: {{AppVer}}
{{end}} + {{if .IsAdmin}}{{.i18n.Tr "error.report_message" | Safe}}
{{end}} {{template "base/footer" .}}