From daaf0ad473c9fd0b54d3820444db5689ab2a7cc3 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 25 Sep 2023 08:21:38 +0800 Subject: cleanup locale function usage (#27227) (#27240) Backport #27227 by @denyskon Throughout the Gitea codebase, you can meet some weird constructions to make `locale.Tr` work in subtemplates. Since we now have `ctx.Locale.Tr` which solves that problem, clean up various templates which pass `locale` through `dict` or use some weird constructions like `$.root.locale` Going on, it would be great to replace every case of `$.locale.Tr` and `.locale.Tr` with `ctx.Locale.Tr`, but that needs to be done with patience. Co-authored-by: Denys Konovalov --- templates/code/searchform.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/code') diff --git a/templates/code/searchform.tmpl b/templates/code/searchform.tmpl index a8c8e6576d..8b1f99cc88 100644 --- a/templates/code/searchform.tmpl +++ b/templates/code/searchform.tmpl @@ -1,6 +1,6 @@
- {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true "Disabled" .CodeIndexerUnavailable}} + {{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true "Disabled" .CodeIndexerUnavailable}}