Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%!s() instead of repo name in email #17160

Closed
lakostin opened this issue Sep 26, 2021 · 5 comments · Fixed by #17183
Closed

%!s() instead of repo name in email #17160

lakostin opened this issue Sep 26, 2021 · 5 comments · Fixed by #17183

Comments

@lakostin
Copy link

lakostin commented Sep 26, 2021

Gitea Version

1.15.0

Git Version

2.30.2

Operating System

docker Alpine Linux v3.13

How are you running Gitea?

docker

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Description

@denis.patrakeev assigned you to the pull request #106 in repository %!s().


View it on Gitea: Git with a cup of tea.

Screenshots

image

@axifive
Copy link
Member

axifive commented Sep 26, 2021

Don't you have custom templates in your $GITEA_CUSTOM/templates/mail directory?
https://docs.gitea.io/en-us/customizing-gitea/#customizing-gitea-mails

@lakostin
Copy link
Author

Don't you have custom templates in your $GITEA_CUSTOM/templates/mail directory?
https://docs.gitea.io/en-us/customizing-gitea/#customizing-gitea-mails

no

@zeripath
Copy link
Contributor

Is this in the English emails or a different language?

Looking at some of our translations I can see that the related string is incorrect in a number of them.

The related string is: mail.issue_assigned.pull

issue_assigned.pull = @%[1]s assigned you to the pull request %[2]s in repository %[3]s.

The related template is mail/issue/assigned.tmpl.

{{$repo_url := printf "<a href='%s'>%s</a>" .Release.Repo.HTMLURL .Release.Repo.FullName}}
{{$link := printf "<a href='%s'>#%d</a>" .Link .Issue.Index}}
<body>
<p>
{{if .IsPull}}
{{.i18n.Tr "mail.issue_assigned.pull" .Doer.Name $link $repo_url | Str2html}}

Both the template and locale string appear correct for English in 1.15.

@silverwind
Copy link
Member

silverwind commented Sep 29, 2021

It's certainly happening in english e-mails. Same problem on issue assignment as well:

@username assigned you to the issue #1 in repository %!s().

I would suggest also removing the from these sentences.

@zeripath
Copy link
Contributor

Aha! figured it out... The problem is obvious once you see it.

@zeripath zeripath added this to the 1.15.4 milestone Sep 29, 2021
zeripath added a commit to zeripath/gitea that referenced this issue Sep 29, 2021
There was a mistake in the template file: `templates/mail/issue/assigned.tmpl`
where the repourl was generated from a non-existent release instead of the issue.

This PR changes this to use the issue but also ensure that the issue repo is loaded.

It also slightly improves the English locale string.

Fix go-gitea#17160

Signed-off-by: Andrew Thornton <[email protected]>
zeripath added a commit to zeripath/gitea that referenced this issue Sep 29, 2021
Backport go-gitea#17183

There was a mistake in the template file: `templates/mail/issue/assigned.tmpl`
where the repourl was generated from a non-existent release instead of the issue.

This PR changes this to use the issue but also ensure that the issue repo is loaded.

It also slightly improves the English locale string.

Fix go-gitea#17160

Signed-off-by: Andrew Thornton <[email protected]>
6543 pushed a commit that referenced this issue Sep 29, 2021
There was a mistake in the template file: `templates/mail/issue/assigned.tmpl`
where the repourl was generated from a non-existent release instead of the issue.

This PR changes this to use the issue but also ensure that the issue repo is loaded.

It also slightly improves the English locale string.

Fix #17160

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: delvh <[email protected]>
6543 added a commit that referenced this issue Sep 29, 2021
Backport #17183

There was a mistake in the template file: `templates/mail/issue/assigned.tmpl`
where the repourl was generated from a non-existent release instead of the issue.

This PR changes this to use the issue but also ensure that the issue repo is loaded.

It also slightly improves the English and the Russian locale string.

Fix #17160

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: 6543 <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants