mirror of
https://github.com/go-gitea/gitea
synced 2025-08-21 08:58:27 +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:
@@ -1,9 +1,9 @@
|
||||
<footer>
|
||||
<div class="ui container">
|
||||
<div class="ui left">
|
||||
{{.i18n.Tr "powered_by" "Gitea"}}
|
||||
{{.locale.Tr "powered_by" "Gitea"}}
|
||||
{{if (or .ShowFooterVersion .PageIsAdmin)}}
|
||||
{{.i18n.Tr "version"}}:
|
||||
{{.locale.Tr "version"}}:
|
||||
{{if .IsAdmin}}
|
||||
<a href="{{AppSubUrl}}/admin/config">{{AppVer}}</a>
|
||||
{{else}}
|
||||
@@ -11,8 +11,8 @@
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if and .TemplateLoadTimes ShowFooterTemplateLoadTime}}
|
||||
{{.i18n.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong>
|
||||
{{.i18n.Tr "template"}}
|
||||
{{.locale.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong>
|
||||
{{.locale.Tr "template"}}
|
||||
{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -22,16 +22,16 @@
|
||||
{{end}}
|
||||
<div class="ui language bottom floating slide up dropdown link item">
|
||||
{{svg "octicon-globe"}}
|
||||
<div class="text">{{.i18n.LangName}}</div>
|
||||
<div class="text">{{.locale.LangName}}</div>
|
||||
<div class="menu language-menu">
|
||||
{{range .AllLangs}}
|
||||
<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq $.i18n.Lang .Lang}}active selected{{end}}">{{.Name}}</a>
|
||||
<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq $.locale.Lang .Lang}}active selected{{end}}">{{.Name}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{AssetUrlPrefix}}/js/licenses.txt">{{.i18n.Tr "licenses"}}</a>
|
||||
<a href="{{AssetUrlPrefix}}/js/licenses.txt">{{.locale.Tr "licenses"}}</a>
|
||||
{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.i18n.Tr "website"}}</a>
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.locale.Tr "website"}}</a>
|
||||
{{template "custom/extra_links_footer" .}}
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user