summaryrefslogtreecommitdiffstats
path: root/templates/code
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-09-25 08:21:38 +0800
committerGitHub <noreply@github.com>2023-09-25 00:21:38 +0000
commitdaaf0ad473c9fd0b54d3820444db5689ab2a7cc3 (patch)
tree4fec6e3e7733bf800881f2635bcf2172b9f04268 /templates/code
parent9fc24a8f5ea364ed232ce8ea23bff064db43303f (diff)
downloadgitea-daaf0ad473c9fd0b54d3820444db5689ab2a7cc3.tar.gz
gitea-daaf0ad473c9fd0b54d3820444db5689ab2a7cc3.zip
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 <kontakt@denyskon.de>
Diffstat (limited to 'templates/code')
-rw-r--r--templates/code/searchform.tmpl2
1 files changed, 1 insertions, 1 deletions
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 @@
<form class="ui form ignore-dirty">
<div class="ui fluid action input">
- {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true "Disabled" .CodeIndexerUnavailable}}
+ {{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true "Disabled" .CodeIndexerUnavailable}}
<div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{.locale.Tr "explore.search.type.tooltip"}}">
<input name="t" type="hidden" value="{{.queryType}}"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="text">{{.locale.Tr (printf "explore.search.%s" (or .queryType "fuzzy"))}}</div>