Skip to content

Commit 83f37f6

Browse files
authored
Remove urls from translations (#31950)
Part of #27700 Removes all URLs from translation strings to easy up changing them in the future and to exclude people injecting malicious URLs through translations. First measure as long as #24402 is out of scope.
1 parent ac34449 commit 83f37f6

File tree

14 files changed

+53
-53
lines changed

14 files changed

+53
-53
lines changed

options/locale/locale_en-US.ini

+24-24
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ string.desc = Z - A
218218

219219
[error]
220220
occurred = An error occurred
221-
report_message = If you believe that this is a Gitea bug, please search for issues on <a href="https://github.com/go-gitea/gitea/issues" target="_blank">GitHub</a> or open a new issue if necessary.
221+
report_message = If you believe that this is a Gitea bug, please search for issues on <a href="%s" target="_blank">GitHub</a> or open a new issue if necessary.
222222
missing_csrf = Bad Request: no CSRF token present
223223
invalid_csrf = Bad Request: invalid CSRF token
224224
not_found = The target couldn't be found.
@@ -227,13 +227,13 @@ network_error = Network error
227227
[startpage]
228228
app_desc = A painless, self-hosted Git service
229229
install = Easy to install
230-
install_desc = Simply <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/installation/install-from-binary">run the binary</a> for your platform, ship it with <a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea/tree/master/docker">Docker</a>, or get it <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/installation/install-from-package">packaged</a>.
230+
install_desc = Simply <a target="_blank" rel="noopener noreferrer" href="%[1]s">run the binary</a> for your platform, ship it with <a target="_blank" rel="noopener noreferrer" href="%[2]s">Docker</a>, or get it <a target="_blank" rel="noopener noreferrer" href="%[3]s">packaged</a>.
231231
platform = Cross-platform
232-
platform_desc = Gitea runs anywhere <a target="_blank" rel="noopener noreferrer" href="https://go.dev/">Go</a> can compile for: Windows, macOS, Linux, ARM, etc. Choose the one you love!
232+
platform_desc = Gitea runs anywhere <a target="_blank" rel="noopener noreferrer" href="%s">Go</a> can compile for: Windows, macOS, Linux, ARM, etc. Choose the one you love!
233233
lightweight = Lightweight
234234
lightweight_desc = Gitea has low minimal requirements and can run on an inexpensive Raspberry Pi. Save your machine energy!
235235
license = Open Source
236-
license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="https://code.gitea.io/gitea">code.gitea.io/gitea</a>! Join us by <a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea">contributing</a> to make this project even better. Don't be shy to be a contributor!
236+
license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">%[2]s</a>! Join us by <a target="_blank" rel="noopener noreferrer" href="%[3]s">contributing</a> to make this project even better. Don't be shy to be a contributor!
237237

238238
[install]
239239
install = Installation
@@ -456,7 +456,7 @@ authorize_title = Authorize "%s" to access your account?
456456
authorization_failed = Authorization failed
457457
authorization_failed_desc = The authorization failed because we detected an invalid request. Please contact the maintainer of the app you have tried to authorize.
458458
sspi_auth_failed = SSPI authentication failed
459-
password_pwned = The password you chose is on a <a target="_blank" rel="noopener noreferrer" href="https://haveibeenpwned.com/Passwords">list of stolen passwords</a> previously exposed in public data breaches. Please try again with a different password and consider changing this password elsewhere too.
459+
password_pwned = The password you chose is on a <a target="_blank" rel="noopener noreferrer" href="%s">list of stolen passwords</a> previously exposed in public data breaches. Please try again with a different password and consider changing this password elsewhere too.
460460
password_pwned_err = Could not complete request to HaveIBeenPwned
461461
last_admin = You cannot remove the last admin. There must be at least one admin.
462462
signin_passkey = Sign in with a passkey
@@ -954,7 +954,7 @@ passcode_invalid = The passcode is incorrect. Try again.
954954
twofa_enrolled = Your account has been successfully enrolled. Store your single-use recovery key (%s) in a safe place, as it will not be shown again.
955955
twofa_failed_get_secret = Failed to get secret.
956956

957-
webauthn_desc = Security keys are hardware devices containing cryptographic keys. They can be used for two-factor authentication. Security keys must support the <a rel="noreferrer" target="_blank" href="https://w3c.github.io/webauthn/#webauthn-authenticator">WebAuthn Authenticator</a> standard.
957+
webauthn_desc = Security keys are hardware devices containing cryptographic keys. They can be used for two-factor authentication. Security keys must support the <a rel="noreferrer" target="_blank" href="%s">WebAuthn Authenticator</a> standard.
958958
webauthn_register_key = Add Security Key
959959
webauthn_nickname = Nickname
960960
webauthn_delete_key = Remove Security Key
@@ -2325,7 +2325,7 @@ settings.event_pull_request_merge = Pull Request Merge
23252325
settings.event_package = Package
23262326
settings.event_package_desc = Package created or deleted in a repository.
23272327
settings.branch_filter = Branch filter
2328-
settings.branch_filter_desc = Branch whitelist for push, branch creation and branch deletion events, specified as glob pattern. If empty or <code>*</code>, events for all branches are reported. See <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> documentation for syntax. Examples: <code>master</code>, <code>{master,release*}</code>.
2328+
settings.branch_filter_desc = Branch whitelist for push, branch creation and branch deletion events, specified as glob pattern. If empty or <code>*</code>, events for all branches are reported. See <a href="%[1]s">%[2]s</a> documentation for syntax. Examples: <code>master</code>, <code>{master,release*}</code>.
23292329
settings.authorization_header = Authorization Header
23302330
settings.authorization_header_desc = Will be included as authorization header for requests when present. Examples: %s.
23312331
settings.active = Active
@@ -2425,12 +2425,12 @@ settings.ignore_stale_approvals_desc = Do not count approvals that were made on
24252425
settings.require_signed_commits = Require Signed Commits
24262426
settings.require_signed_commits_desc = Reject pushes to this branch if they are unsigned or unverifiable.
24272427
settings.protect_branch_name_pattern = Protected Branch Name Pattern
2428-
settings.protect_branch_name_pattern_desc = "Protected branch name patterns. See <a href="https://github.com/gobwas/glob">the documentation</a> for pattern syntax. Examples: main, release/**"
2428+
settings.protect_branch_name_pattern_desc = "Protected branch name patterns. See <a href="%s">the documentation</a> for pattern syntax. Examples: main, release/**"
24292429
settings.protect_patterns = Patterns
24302430
settings.protect_protected_file_patterns = "Protected file patterns (separated using semicolon ';'):"
2431-
settings.protect_protected_file_patterns_desc = "Protected files are not allowed to be changed directly even if user has rights to add, edit, or delete files in this branch. Multiple patterns can be separated using semicolon (';'). See <a href='https://pkg.go.dev/github.com/gobwas/glob#Compile'>github.com/gobwas/glob</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>."
2431+
settings.protect_protected_file_patterns_desc = "Protected files are not allowed to be changed directly even if user has rights to add, edit, or delete files in this branch. Multiple patterns can be separated using semicolon (';'). See <a href='%[1]s'>%[2]s</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>."
24322432
settings.protect_unprotected_file_patterns = "Unprotected file patterns (separated using semicolon ';'):"
2433-
settings.protect_unprotected_file_patterns_desc = "Unprotected files that are allowed to be changed directly if user has write access, bypassing push restriction. Multiple patterns can be separated using semicolon (';'). See <a href='https://pkg.go.dev/github.com/gobwas/glob#Compile'>github.com/gobwas/glob</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>."
2433+
settings.protect_unprotected_file_patterns_desc = "Unprotected files that are allowed to be changed directly if user has write access, bypassing push restriction. Multiple patterns can be separated using semicolon (';'). See <a href='%[1]s'>%[2]s</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>."
24342434
settings.add_protected_branch = Enable protection
24352435
settings.delete_protected_branch = Disable protection
24362436
settings.update_protect_branch_success = Branch protection for rule "%s" has been updated.
@@ -2462,7 +2462,7 @@ settings.tags.protection.allowed.teams = Allowed teams
24622462
settings.tags.protection.allowed.noone = No One
24632463
settings.tags.protection.create = Protect Tag
24642464
settings.tags.protection.none = There are no protected tags.
2465-
settings.tags.protection.pattern.description = You can use a single name or a glob pattern or regular expression to match multiple tags. Read more in the <a target="_blank" rel="noopener" href="https://docs.gitea.com/usage/protected-tags">protected tags guide</a>.
2465+
settings.tags.protection.pattern.description = You can use a single name or a glob pattern or regular expression to match multiple tags. Read more in the <a target="_blank" rel="noopener" href="%s">protected tags guide</a>.
24662466
settings.bot_token = Bot Token
24672467
settings.chat_id = Chat ID
24682468
settings.thread_id = Thread ID
@@ -2844,7 +2844,7 @@ last_page = Last
28442844
total = Total: %d
28452845
settings = Admin Settings
28462846
2847-
dashboard.new_version_hint = Gitea %s is now available, you are running %s. Check <a target="_blank" rel="noreferrer" href="https://blog.gitea.io">the blog</a> for more details.
2847+
dashboard.new_version_hint = Gitea %s is now available, you are running %s. Check <a target="_blank" rel="noreferrer" href="%s">the blog</a> for more details.
28482848
dashboard.statistic = Summary
28492849
dashboard.maintenance_operations = Maintenance Operations
28502850
dashboard.system_status = System Status
@@ -3036,12 +3036,12 @@ packages.size = Size
30363036
packages.published = Published
30373037
30383038
defaulthooks = Default Webhooks
3039-
defaulthooks.desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Webhooks defined here are defaults and will be copied into all new repositories. Read more in the <a target="_blank" rel="noopener" href="https://docs.gitea.com/usage/webhooks">webhooks guide</a>.
3039+
defaulthooks.desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Webhooks defined here are defaults and will be copied into all new repositories. Read more in the <a target="_blank" rel="noopener" href="%s">webhooks guide</a>.
30403040
defaulthooks.add_webhook = Add Default Webhook
30413041
defaulthooks.update_webhook = Update Default Webhook
30423042
30433043
systemhooks = System Webhooks
3044-
systemhooks.desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Webhooks defined here will act on all repositories on the system, so please consider any performance implications this may have. Read more in the <a target="_blank" rel="noopener" href="https://docs.gitea.com/usage/webhooks">webhooks guide</a>.
3044+
systemhooks.desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Webhooks defined here will act on all repositories on the system, so please consider any performance implications this may have. Read more in the <a target="_blank" rel="noopener" href="%s">webhooks guide</a>.
30453045
systemhooks.add_webhook = Add System Webhook
30463046
systemhooks.update_webhook = Update System Webhook
30473047
@@ -3136,18 +3136,18 @@ auths.tips = Tips
31363136
auths.tips.oauth2.general = OAuth2 Authentication
31373137
auths.tips.oauth2.general.tip = When registering a new OAuth2 authentication, the callback/redirect URL should be:
31383138
auths.tip.oauth2_provider = OAuth2 Provider
3139-
auths.tip.bitbucket = Register a new OAuth consumer on https://bitbucket.org/account/user/{your-username}/oauth-consumers/new and add the permission 'Account' - 'Read'
3139+
auths.tip.bitbucket = Register a new OAuth consumer on %s and add the permission 'Account' - 'Read'
31403140
auths.tip.nextcloud = Register a new OAuth consumer on your instance using the following menu "Settings -> Security -> OAuth 2.0 client"
3141-
auths.tip.dropbox = Create a new application at https://www.dropbox.com/developers/apps
3142-
auths.tip.facebook = Register a new application at https://developers.facebook.com/apps and add the product "Facebook Login"
3143-
auths.tip.github = Register a new OAuth application on https://github.com/settings/applications/new
3144-
auths.tip.gitlab_new = Register a new application on https://gitlab.com/-/profile/applications
3145-
auths.tip.google_plus = Obtain OAuth2 client credentials from the Google API console at https://console.developers.google.com/
3141+
auths.tip.dropbox = Create a new application at %s
3142+
auths.tip.facebook = Register a new application at %s and add the product "Facebook Login"
3143+
auths.tip.github = Register a new OAuth application on %s
3144+
auths.tip.gitlab_new = Register a new application on %s
3145+
auths.tip.google_plus = Obtain OAuth2 client credentials from the Google API console at %s
31463146
auths.tip.openid_connect = Use the OpenID Connect Discovery URL "https://{server}/.well-known/openid-configuration" to specify the endpoints
3147-
auths.tip.twitter = Go to https://dev.twitter.com/apps, create an application and ensure that the “Allow this application to be used to Sign in with Twitter” option is enabled
3148-
auths.tip.discord = Register a new application on https://discordapp.com/developers/applications/me
3149-
auths.tip.gitea = Register a new OAuth2 application. Guide can be found at https://docs.gitea.com/development/oauth2-provider
3150-
auths.tip.yandex = Create a new application at https://oauth.yandex.com/client/new. Select following permissions from the "Yandex.Passport API" section: "Access to email address", "Access to user avatar" and "Access to username, first name and surname, gender"
3147+
auths.tip.twitter = Go to %s, create an application and ensure that the “Allow this application to be used to Sign in with Twitter” option is enabled
3148+
auths.tip.discord = Register a new application on %s
3149+
auths.tip.gitea = Register a new OAuth2 application. Guide can be found at %s
3150+
auths.tip.yandex = Create a new application at %s. Select following permissions from the "Yandex.Passport API" section: "Access to email address", "Access to user avatar" and "Access to username, first name and surname, gender"
31513151
auths.tip.mastodon = Input a custom instance URL for the mastodon instance you want to authenticate with (or use the default one)
31523152
auths.edit = Edit Authentication Source
31533153
auths.activated = This Authentication Source is Activated

routers/web/admin/hooks.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func DefaultOrSystemWebhooks(ctx *context.Context) {
3434
}
3535

3636
sys["Title"] = ctx.Tr("admin.systemhooks")
37-
sys["Description"] = ctx.Tr("admin.systemhooks.desc")
37+
sys["Description"] = ctx.Tr("admin.systemhooks.desc", "https://docs.gitea.com/usage/webhooks")
3838
sys["Webhooks"], err = webhook.GetSystemWebhooks(ctx, optional.None[bool]())
3939
sys["BaseLink"] = setting.AppSubURL + "/admin/hooks"
4040
sys["BaseLinkNew"] = setting.AppSubURL + "/admin/system-hooks"
@@ -44,7 +44,7 @@ func DefaultOrSystemWebhooks(ctx *context.Context) {
4444
}
4545

4646
def["Title"] = ctx.Tr("admin.defaulthooks")
47-
def["Description"] = ctx.Tr("admin.defaulthooks.desc")
47+
def["Description"] = ctx.Tr("admin.defaulthooks.desc", "https://docs.gitea.com/usage/webhooks")
4848
def["Webhooks"], err = webhook.GetDefaultWebhooks(ctx)
4949
def["BaseLink"] = setting.AppSubURL + "/admin/hooks"
5050
def["BaseLinkNew"] = setting.AppSubURL + "/admin/default-hooks"

routers/web/admin/users.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func NewUserPost(ctx *context.Context) {
166166
}
167167
if err := password.IsPwned(ctx, form.Password); err != nil {
168168
ctx.Data["Err_Password"] = true
169-
errMsg := ctx.Tr("auth.password_pwned")
169+
errMsg := ctx.Tr("auth.password_pwned", "https://haveibeenpwned.com/Passwords")
170170
if password.IsErrIsPwnedRequest(err) {
171171
log.Error(err.Error())
172172
errMsg = ctx.Tr("auth.password_pwned_err")
@@ -401,7 +401,7 @@ func EditUserPost(ctx *context.Context) {
401401
ctx.RenderWithErr(password.BuildComplexityError(ctx.Locale), tplUserEdit, &form)
402402
case errors.Is(err, password.ErrIsPwned):
403403
ctx.Data["Err_Password"] = true
404-
ctx.RenderWithErr(ctx.Tr("auth.password_pwned"), tplUserEdit, &form)
404+
ctx.RenderWithErr(ctx.Tr("auth.password_pwned", "https://haveibeenpwned.com/Passwords"), tplUserEdit, &form)
405405
case password.IsErrIsPwnedRequest(err):
406406
ctx.Data["Err_Password"] = true
407407
ctx.RenderWithErr(ctx.Tr("auth.password_pwned_err"), tplUserEdit, &form)

routers/web/auth/auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ func SignUpPost(ctx *context.Context) {
504504
return
505505
}
506506
if err := password.IsPwned(ctx, form.Password); err != nil {
507-
errMsg := ctx.Tr("auth.password_pwned")
507+
errMsg := ctx.Tr("auth.password_pwned", "https://haveibeenpwned.com/Passwords")
508508
if password.IsErrIsPwnedRequest(err) {
509509
log.Error(err.Error())
510510
errMsg = ctx.Tr("auth.password_pwned_err")

routers/web/auth/password.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func ResetPasswdPost(ctx *context.Context) {
212212
case errors.Is(err, password.ErrComplexity):
213213
ctx.RenderWithErr(password.BuildComplexityError(ctx.Locale), tplResetPassword, nil)
214214
case errors.Is(err, password.ErrIsPwned):
215-
ctx.RenderWithErr(ctx.Tr("auth.password_pwned"), tplResetPassword, nil)
215+
ctx.RenderWithErr(ctx.Tr("auth.password_pwned", "https://haveibeenpwned.com/Passwords"), tplResetPassword, nil)
216216
case password.IsErrIsPwnedRequest(err):
217217
ctx.RenderWithErr(ctx.Tr("auth.password_pwned_err"), tplResetPassword, nil)
218218
default:
@@ -295,7 +295,7 @@ func MustChangePasswordPost(ctx *context.Context) {
295295
ctx.RenderWithErr(password.BuildComplexityError(ctx.Locale), tplMustChangePassword, &form)
296296
case errors.Is(err, password.ErrIsPwned):
297297
ctx.Data["Err_Password"] = true
298-
ctx.RenderWithErr(ctx.Tr("auth.password_pwned"), tplMustChangePassword, &form)
298+
ctx.RenderWithErr(ctx.Tr("auth.password_pwned", "https://haveibeenpwned.com/Passwords"), tplMustChangePassword, &form)
299299
case password.IsErrIsPwnedRequest(err):
300300
ctx.Data["Err_Password"] = true
301301
ctx.RenderWithErr(ctx.Tr("auth.password_pwned_err"), tplMustChangePassword, &form)

routers/web/user/setting/account.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func AccountPost(ctx *context.Context) {
8585
case errors.Is(err, password.ErrComplexity):
8686
ctx.Flash.Error(password.BuildComplexityError(ctx.Locale))
8787
case errors.Is(err, password.ErrIsPwned):
88-
ctx.Flash.Error(ctx.Tr("auth.password_pwned"))
88+
ctx.Flash.Error(ctx.Tr("auth.password_pwned", "https://haveibeenpwned.com/Passwords"))
8989
case password.IsErrIsPwnedRequest(err):
9090
ctx.Flash.Error(ctx.Tr("auth.password_pwned_err"))
9191
default:

0 commit comments

Comments
 (0)