forked from forgejo/forgejo
Always use ctx.Locale.Tr
inside templates (#27231)
This commit is contained in:
parent
e6d8b14620
commit
7960ba7e2b
305 changed files with 3810 additions and 3810 deletions
|
@ -1,11 +1,11 @@
|
|||
{{/* No account links, no way to add account links: Menu will not be shown. */}}
|
||||
{{if or .AccountLinks .OrderedOAuth2Names}}
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_account_links"}}
|
||||
{{ctx.Locale.Tr "settings.manage_account_links"}}
|
||||
{{if .OrderedOAuth2Names}}
|
||||
<div class="ui right">
|
||||
<div class="ui dropdown">
|
||||
<div class="ui primary tiny button">{{.locale.Tr "settings.link_account"}}</div>
|
||||
<div class="ui primary tiny button">{{ctx.Locale.Tr "settings.link_account"}}</div>
|
||||
<div class="menu">
|
||||
{{range $key := .OrderedOAuth2Names}}
|
||||
{{$provider := index $.OAuth2Providers $key}}
|
||||
|
@ -23,7 +23,7 @@
|
|||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
{{.locale.Tr "settings.manage_account_links_desc"}}
|
||||
{{ctx.Locale.Tr "settings.manage_account_links_desc"}}
|
||||
</div>
|
||||
{{range $loginSource, $provider := .AccountLinks}}
|
||||
<div class="flex-item">
|
||||
|
@ -36,12 +36,12 @@
|
|||
{{$loginSource.Name}}
|
||||
</span>
|
||||
{{if $loginSource.IsActive}}
|
||||
<span class="flex-text-body text primary">{{$.locale.Tr "repo.settings.active"}}</span>
|
||||
<span class="flex-text-body text primary">{{ctx.Locale.Tr "repo.settings.active"}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-account-link" data-url="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}">
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -51,10 +51,10 @@
|
|||
<div class="ui g-modal-confirm delete modal" id="delete-account-link">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.remove_account_link"}}
|
||||
{{ctx.Locale.Tr "settings.remove_account_link"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.remove_account_link_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.remove_account_link_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.manage_openid"}}
|
||||
{{ctx.Locale.Tr "settings.manage_openid"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<div class="flex-list">
|
||||
<div class="flex-item">
|
||||
{{.locale.Tr "settings.openid_desc"}}
|
||||
{{ctx.Locale.Tr "settings.openid_desc"}}
|
||||
</div>
|
||||
{{range .OpenIDs}}
|
||||
<div class="flex-item gt-ac">
|
||||
|
@ -21,17 +21,17 @@
|
|||
{{if .Show}}
|
||||
<button class="ui tiny button">
|
||||
{{svg "octicon-eye" 16 "icon"}}
|
||||
{{$.locale.Tr "settings.hide_openid"}}
|
||||
{{ctx.Locale.Tr "settings.hide_openid"}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="ui tiny button">
|
||||
{{svg "octicon-eye-closed" 16 "icon"}}
|
||||
{{$.locale.Tr "settings.show_openid"}}
|
||||
{{ctx.Locale.Tr "settings.show_openid"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</form>
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-openid" data-url="{{AppSubUrl}}/user/settings/security/openid/delete" data-id="{{.ID}}">
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -42,21 +42,21 @@
|
|||
<form class="ui form" action="{{AppSubUrl}}/user/settings/security/openid" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="required field {{if .Err_OpenID}}error{{end}}">
|
||||
<label for="openid">{{.locale.Tr "settings.add_new_openid"}}</label>
|
||||
<label for="openid">{{ctx.Locale.Tr "settings.add_new_openid"}}</label>
|
||||
<input id="openid" name="openid" type="text" required>
|
||||
</div>
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "settings.add_openid"}}
|
||||
{{ctx.Locale.Tr "settings.add_openid"}}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-openid">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.openid_deletion"}}
|
||||
{{ctx.Locale.Tr "settings.openid_deletion"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.openid_deletion_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.openid_deletion_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.twofa"}}
|
||||
{{ctx.Locale.Tr "settings.twofa"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{.locale.Tr "settings.twofa_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_desc"}}</p>
|
||||
{{if .TOTPEnrolled}}
|
||||
<p>{{$.locale.Tr "settings.twofa_is_enrolled" | Str2html}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_is_enrolled" | Str2html}}</p>
|
||||
<form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/regenerate_scratch" method="post" enctype="multipart/form-data">
|
||||
{{.CsrfTokenHtml}}
|
||||
<p>{{.locale.Tr "settings.regenerate_scratch_token_desc"}}</p>
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.twofa_scratch_token_regenerate"}}</button>
|
||||
<p>{{ctx.Locale.Tr "settings.regenerate_scratch_token_desc"}}</p>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "settings.twofa_scratch_token_regenerate"}}</button>
|
||||
</form>
|
||||
<form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/disable" method="post" enctype="multipart/form-data" id="disable-form">
|
||||
{{.CsrfTokenHtml}}
|
||||
<p>{{.locale.Tr "settings.twofa_disable_note"}}</p>
|
||||
<button class="ui red button delete-button" data-modal-id="disable-twofa" data-type="form" data-form="#disable-form">{{$.locale.Tr "settings.twofa_disable"}}</button>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_disable_note"}}</p>
|
||||
<button class="ui red button delete-button" data-modal-id="disable-twofa" data-type="form" data-form="#disable-form">{{ctx.Locale.Tr "settings.twofa_disable"}}</button>
|
||||
</form>
|
||||
{{else}}
|
||||
<p>{{.locale.Tr "settings.twofa_not_enrolled"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_not_enrolled"}}</p>
|
||||
<div class="inline field">
|
||||
<a class="ui primary button" href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{$.locale.Tr "settings.twofa_enroll"}}</a>
|
||||
<a class="ui primary button" href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{ctx.Locale.Tr "settings.twofa_enroll"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="ui g-modal-confirm delete modal" id="disable-twofa">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.twofa_disable"}}
|
||||
{{ctx.Locale.Tr "settings.twofa_disable"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.twofa_disable_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.twofa_disable_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings twofa")}}
|
||||
<div class="user-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "settings.twofa_enroll"}}
|
||||
{{ctx.Locale.Tr "settings.twofa_enroll"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{.locale.Tr "settings.scan_this_image"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.scan_this_image"}}</p>
|
||||
<img src="{{.QrUri}}" alt="{{.TwofaSecret}}">
|
||||
<p>{{.locale.Tr "settings.or_enter_secret" .TwofaSecret}}</p>
|
||||
<p>{{.locale.Tr "settings.then_enter_passcode"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.or_enter_secret" .TwofaSecret}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.then_enter_passcode"}}</p>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="inline required field {{if .Err_Passcode}}error{{end}}">
|
||||
<label for="passcode">{{.locale.Tr "passcode"}}</label>
|
||||
<label for="passcode">{{ctx.Locale.Tr "passcode"}}</label>
|
||||
<input id="passcode" name="passcode" autofocus required>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui primary button">{{.locale.Tr "auth.verify"}}</button>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "auth.verify"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<h4 class="ui top attached header">{{.locale.Tr "settings.webauthn"}}</h4>
|
||||
<h4 class="ui top attached header">{{ctx.Locale.Tr "settings.webauthn"}}</h4>
|
||||
<div class="ui attached segment">
|
||||
<p>{{.locale.Tr "settings.webauthn_desc" | Str2html}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.webauthn_desc" | Str2html}}</p>
|
||||
{{template "user/auth/webauthn_error" .}}
|
||||
<div class="flex-list">
|
||||
{{range .WebAuthnCredentials}}
|
||||
|
@ -14,7 +14,7 @@
|
|||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<button class="ui red tiny button delete-button" data-modal-id="delete-registration" data-url="{{$.Link}}/webauthn/delete" data-id="{{.ID}}">
|
||||
{{$.locale.Tr "settings.delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.delete_key"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -22,18 +22,18 @@
|
|||
</div>
|
||||
<div class="ui form">
|
||||
<div class="required field">
|
||||
<label for="nickname">{{.locale.Tr "settings.webauthn_nickname"}}</label>
|
||||
<label for="nickname">{{ctx.Locale.Tr "settings.webauthn_nickname"}}</label>
|
||||
<input id="nickname" name="nickname" type="text" required>
|
||||
</div>
|
||||
<button id="register-webauthn" class="ui primary button">{{svg "octicon-key"}} {{.locale.Tr "settings.webauthn_register_key"}}</button>
|
||||
<button id="register-webauthn" class="ui primary button">{{svg "octicon-key"}} {{ctx.Locale.Tr "settings.webauthn_register_key"}}</button>
|
||||
</div>
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-registration">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.webauthn_delete_key"}}
|
||||
{{ctx.Locale.Tr "settings.webauthn_delete_key"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.webauthn_delete_key_desc"}}</p>
|
||||
<p>{{ctx.Locale.Tr "settings.webauthn_delete_key_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue