-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Description
Gitea Version
1.15.5
Git Version
git version 2.34.1
Operating System
k8s
How are you running Gitea?
running 1.15.5 in docker
Database
MySQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Description
When language is set to zh-CN(简体中文) or zh-TW(繁体中文(台湾)), and start a code search in a repository, the repo link in results is a long path, and redirects to a 404 page.
In other languages, results of repository code search will only show repo name and the link is correct.

The reason seems obvious. The order of string fields in search.results is different in English and Chinese, but they use the same template.
code in templates\repo\search.tmpl, require order of string fields to be Keyword, RepoLink, RepoName.
{{if .Keyword}} <h3> {{.i18n.Tr "repo.search.results" (.Keyword|Escape) .RepoLink .RepoName | Str2html }} </h3>
code in options\locale\locale_en-US.ini
search.results = Search results for "%s" in <a href="%s">%s</a>
code in options\locale\ zh-CN and zh-TW
search.results=在 <a href="%s"> %s </a> 中搜索 "%s" 的结果
Screenshots
No response
