From d55a0b723809f5b94acd948b924c8518014445e0 Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 27 Jun 2022 22:58:46 +0200 Subject: Refactor `i18n` to `locale` (#20153) * Refactor `i18n` to `locale` - Currently we're using the `i18n` variable naming for the `locale` struct. This contains locale's specific information and cannot be used for general i18n purpose, therefore refactoring it to `locale` makes more sense. - Ref: https://github.com/go-gitea/gitea/pull/20096#discussion_r906699200 * Update routers/install/install.go --- templates/base/head_script.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'templates/base/head_script.tmpl') diff --git a/templates/base/head_script.tmpl b/templates/base/head_script.tmpl index e6a8060a16..2f74b959e2 100644 --- a/templates/base/head_script.tmpl +++ b/templates/base/head_script.tmpl @@ -38,10 +38,10 @@ If you introduce mistakes in it, Gitea JavaScript code wouldn't run correctly. mermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}}, {{/* this global i18n object should only contain general texts. for specialized texts, it should be provided 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"}}', + copy_success: '{{.locale.Tr "copy_success"}}', + copy_error: '{{.locale.Tr "copy_error"}}', + error_occurred: '{{.locale.Tr "error.occurred"}}', + network_error: '{{.locale.Tr "error.network_error"}}', }, }; {{/* in case some pages don't render the pageData, we make sure it is an object to prevent null access */}} -- cgit v1.2.3