mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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
This commit is contained in:
@@ -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 */}}
|
||||
|
Reference in New Issue
Block a user