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

Localize Email Templates #16200

Merged
merged 21 commits into from
Jun 23, 2021
Merged
11 changes: 7 additions & 4 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -318,24 +318,27 @@ password_pwned_err = Could not complete request to HaveIBeenPwned

[mail]
view_it_on = View it on %s
link_not_working_do_paste = Not working? Try copying and pasting it to your browser.
hi_user_x = Hi <b>%s</b>,

activate_account = Please activate your account
activate_account.title = %s, please activate your account
activate_account.test_1 = Hi <b>%[1]s</b>, thanks for registering at %[2]s!
activate_account.test_2 = Please click the following link to activate your account within <b>%s</b>:
activate_account.test_3 = Not working? Try copying and pasting it to your browser.

activate_email = Verify your email address
activate_email.title = %s, please verify your e-mail address
activate_email.body = <p>Hi <b>%[1]s</b>,</p><br><p>Please click the following link to verify your email address within <b>%[2]s</b>:</p><p><a href="%[3]s">%[3]s</a></p><br><p>Not working? Try copying and pasting it to your browser.</p>
activate_email.text = Please click the following link to verify your email address within <b>%s</b>:

register_notify = Welcome to Gitea
register_notify.title = %[1]s, welcome to %[2]s
register_notify.body = <p>Hi <b>%[1]s</b>, this is your registration confirmation email for %[4]s!</p><br><p>You can now login via username: %[2]s.</p><p><a href="%[3]suser/login">%[3]suser/login</a></p><br><p>If this account has been created for you, please <a href="%[3]suser/forgot_password">set your password</a> first.</p>
register_notify.text_1 = this is your registration confirmation email for %s!
register_notify.text_2 = You can now login via username: %s.
register_notify.text_3 = If this account has been created for you, please <a href="%s">set your password</a> first.

reset_password = Recover your account
reset_password.title = %s, you have requested to recover your account
reset_password.body = <p>Hi <b>%[1]s</b>,</p><br><p>Please click the following link to recover your account within <b>%[2]s</b>:</p><p><a href="%[3]s">%[3]s</a></p><br><p>Not working? Try copying and pasting it to your browser.</p>
reset_password.text = Please click the following link to recover your account within <b>%s</b>:
6543 marked this conversation as resolved.
Show resolved Hide resolved

register_success = Registration successful

Expand Down
2 changes: 1 addition & 1 deletion templates/mail/auth/activate.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<p>{{.i18n.Tr "mail.activate_account.test_1" .DisplayName AppName | Str2html}}</p><br>
<p>{{.i18n.Tr "mail.activate_account.test_2" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>
<p></p>{{.i18n.Tr "mail.activate_account.test_3" .DisplayName AppName | Str2html}}</p>
<p>{{.i18n.Tr "mail.link_not_working_do_paste" .DisplayName AppName | Str2html}}</p>

<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
</body>
Expand Down
4 changes: 3 additions & 1 deletion templates/mail/auth/activate_email.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

{{ $activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl .Code .Email}}
<body>
{{.i18n.Tr "mail.activate_email.body" .DisplayName .ActiveCodeLives $activate_url | Str2html}}
<p>{{.i18n.Tr "mail.hi_user_x" .DisplayName | Str2html}}</p><br>
<p>{{.i18n.Tr "mail.activate_email.text" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>
<p>{{.i18n.Tr "mail.link_not_working_do_paste" .DisplayName AppName | Str2html}}</p>

<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
</body>
Expand Down
6 changes: 5 additions & 1 deletion templates/mail/auth/register_notify.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
<title>{{.i18n.Tr "mail.register_notify.title" .DisplayName AppName}}</title>
</head>

{{$set_pwd_url := printf "%[1]suser/forgot_password" AppUrl}}
<body>
{{.i18n.Tr "mail.register_notify.body" .DisplayName .Username AppUrl AppName | Str2html}}
<p>{{.i18n.Tr "mail.hi_user_x" .DisplayName | Str2html}}</p><br>
<p>{{.i18n.Tr "mail.register_notify.text_1" AppName}}</p><br>
<p>{{.i18n.Tr "mail.register_notify.text_2" .Username}}</p><p><a href="{{AppUrl}}user/login">{{AppUrl}}user/login</a></p><br>
<p>{{.i18n.Tr "mail.register_notify.text_3" $set_pwd_url | Str2html}}</p><br>

<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
</body>
Expand Down
4 changes: 3 additions & 1 deletion templates/mail/auth/reset_passwd.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

{{ $recover_url := printf "%suser/recover_account?code=%s" AppUrl .Code}}
<body>
{{.i18n.Tr "mail.reset_password.body" .DisplayName .ResetPwdCodeLives $recover_url | Str2html}}
<p>{{.i18n.Tr "mail.hi_user_x" .DisplayName | Str2html}}</p><br>
<p>{{.i18n.Tr "mail.reset_password.text" .ResetPwdCodeLives | Str2html}}</p><p><a href="{{$recover_url}}">{{$recover_url}}</a></p><br>
6543 marked this conversation as resolved.
Show resolved Hide resolved
<p>{{.i18n.Tr "mail.link_not_working_do_paste" .DisplayName AppName | Str2html}}</p>

<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
</body>
Expand Down