From e4e3df6c66dbeac6ac5bceff8ac4f05dbea30d70 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 28 Dec 2021 13:28:27 +0000 Subject: Handle invalid issues (#18111) * Handle invalid issues - When you hover over a issue reference, and the issue doesn't exist, it will just hang on the loading animation. - This patch fixes that by showing them the pop-up with a "Error occured" message. * Add I18N * refactor * fix comment for lint * fix unit test for i18n * fix unit test for i18n * add comments Co-authored-by: Lunny Xiao Co-authored-by: wxiaoguang --- templates/base/head.tmpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index e9c2d512df..8bc6ae689d 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -46,10 +46,13 @@ ]).values()), {{end}} mermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}}, + {{/* this global i18n object should only contain gereral texts. for specalized texts, it should be provied inside the related modules by: (1) API response (2) HTML data-attribute (3) PageData */}} i18n: { copy_success: '{{.i18n.Tr "copy_success"}}', copy_error: '{{.i18n.Tr "copy_error"}}', - } + error_occurred: '{{.i18n.Tr "error.occurred"}}', + network_error: '{{.i18n.Tr "error.network_error"}}', + }, }; {{/* in case some pages don't render the pageData, we make sure it is an object to prevent null access */}} window.config.pageData = window.config.pageData || {}; -- cgit v1.2.3