diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-06-27 22:58:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 15:58:46 -0500 |
commit | d55a0b723809f5b94acd948b924c8518014445e0 (patch) | |
tree | 0ef9ea54f30769ca1d16ce20e551bd7a078f7f5e /templates/admin | |
parent | b551bc2a089d3310dde5706d1b9702f112fe3ea0 (diff) | |
download | gitea-d55a0b723809f5b94acd948b924c8518014445e0.tar.gz gitea-d55a0b723809f5b94acd948b924c8518014445e0.zip |
Refactor `i18n` to `locale` (#20153)
* Refactor `i18n` to `locale`
- Currently we're using the `i18n` variable naming for the `locale`
struct. This contains locale's specific information and cannot be used
for general i18n purpose, therefore refactoring it to `locale` makes
more sense.
- Ref: https://github.com/go-gitea/gitea/pull/20096#discussion_r906699200
* Update routers/install/install.go
Diffstat (limited to 'templates/admin')
29 files changed, 697 insertions, 697 deletions
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index 6e491d6cf4..af3f381c8e 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -4,7 +4,7 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.auths.edit"}} + {{.locale.Tr "admin.auths.edit"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> @@ -12,12 +12,12 @@ {{.CsrfTokenHtml}} <input type="hidden" name="id" value="{{.Source.ID}}"> <div class="inline field"> - <label>{{$.i18n.Tr "admin.auths.auth_type"}}</label> + <label>{{$.locale.Tr "admin.auths.auth_type"}}</label> <input type="hidden" id="auth_type" name="type" value="{{.Source.Type.Int}}"> <span>{{.Source.TypeName}}</span> </div> <div class="required inline field {{if .Err_Name}}error{{end}}"> - <label for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label> + <label for="name">{{.locale.Tr "admin.auths.auth_name"}}</label> <input id="name" name="name" value="{{.Source.Name}}" autofocus required> </div> @@ -25,7 +25,7 @@ {{if or .Source.IsLDAP .Source.IsDLDAP}} {{ $cfg:=.Source.Cfg }} <div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}"> - <label>{{.i18n.Tr "admin.auths.security_protocol"}}</label> + <label>{{.locale.Tr "admin.auths.security_protocol"}}</label> <div class="ui selection security-protocol dropdown"> <input type="hidden" id="security_protocol" name="security_protocol" value="{{$cfg.SecurityProtocol.Int}}"> <div class="text">{{$cfg.SecurityProtocolName}}</div> @@ -38,74 +38,74 @@ </div> </div> <div class="required field"> - <label for="host">{{.i18n.Tr "admin.auths.host"}}</label> + <label for="host">{{.locale.Tr "admin.auths.host"}}</label> <input id="host" name="host" value="{{$cfg.Host}}" placeholder="e.g. mydomain.com" required> </div> <div class="required field"> - <label for="port">{{.i18n.Tr "admin.auths.port"}}</label> + <label for="port">{{.locale.Tr "admin.auths.port"}}</label> <input id="port" name="port" value="{{$cfg.Port}}" placeholder="e.g. 636" required> </div> <div class="has-tls inline field {{if not .HasTLS}}hide{{end}}"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.skip_tls_verify"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> <input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}> </div> </div> {{if .Source.IsLDAP}} <div class="field"> - <label for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label> + <label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label> <input id="bind_dn" name="bind_dn" value="{{$cfg.BindDN}}" placeholder="e.g. cn=Search,dc=mydomain,dc=com"> </div> <div class="field"> - <label for="bind_password">{{.i18n.Tr "admin.auths.bind_password"}}</label> + <label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label> <input id="bind_password" name="bind_password" type="password" value="{{$cfg.BindPassword}}"> </div> {{end}} <div class="{{if .Source.IsLDAP}}required{{end}} field"> - <label for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label> + <label for="user_base">{{.locale.Tr "admin.auths.user_base"}}</label> <input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com" {{if .Source.IsLDAP}}required{{end}}> </div> {{if .Source.IsDLDAP}} <div class="required field"> - <label for="user_dn">{{.i18n.Tr "admin.auths.user_dn"}}</label> + <label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label> <input id="user_dn" name="user_dn" value="{{$cfg.UserDN}}" placeholder="e.g. uid=%s,ou=Users,dc=mydomain,dc=com" required> </div> {{end}} <div class="required field"> - <label for="filter">{{.i18n.Tr "admin.auths.filter"}}</label> + <label for="filter">{{.locale.Tr "admin.auths.filter"}}</label> <input id="filter" name="filter" value="{{$cfg.Filter}}" placeholder="e.g. (&(objectClass=posixAccount)(uid=%s))" required> </div> <div class="field"> - <label for="admin_filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label> + <label for="admin_filter">{{.locale.Tr "admin.auths.admin_filter"}}</label> <input id="admin_filter" name="admin_filter" value="{{$cfg.AdminFilter}}"> </div> <div class="field"> - <label for="restricted_filter">{{.i18n.Tr "admin.auths.restricted_filter"}}</label> + <label for="restricted_filter">{{.locale.Tr "admin.auths.restricted_filter"}}</label> <input id="restricted_filter" name="restricted_filter" value="{{$cfg.RestrictedFilter}}"> - <p class="help">{{.i18n.Tr "admin.auths.restricted_filter_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.restricted_filter_helper"}}</p> </div> <div class="field"> - <label for="attribute_username">{{.i18n.Tr "admin.auths.attribute_username"}}</label> - <input id="attribute_username" name="attribute_username" value="{{$cfg.AttributeUsername}}" placeholder="{{.i18n.Tr "admin.auths.attribute_username_placeholder"}}"> + <label for="attribute_username">{{.locale.Tr "admin.auths.attribute_username"}}</label> + <input id="attribute_username" name="attribute_username" value="{{$cfg.AttributeUsername}}" placeholder="{{.locale.Tr "admin.auths.attribute_username_placeholder"}}"> </div> <div class="field"> - <label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label> + <label for="attribute_name">{{.locale.Tr "admin.auths.attribute_name"}}</label> <input id="attribute_name" name="attribute_name" value="{{$cfg.AttributeName}}"> </div> <div class="field"> - <label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label> + <label for="attribute_surname">{{.locale.Tr "admin.auths.attribute_surname"}}</label> <input id="attribute_surname" name="attribute_surname" value="{{$cfg.AttributeSurname}}"> </div> <div class="required field"> - <label for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label> + <label for="attribute_mail">{{.locale.Tr "admin.auths.attribute_mail"}}</label> <input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="e.g. mail" required> </div> <div class="field"> - <label for="attribute_ssh_public_key">{{.i18n.Tr "admin.auths.attribute_ssh_public_key"}}</label> + <label for="attribute_ssh_public_key">{{.locale.Tr "admin.auths.attribute_ssh_public_key"}}</label> <input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{$cfg.AttributeSSHPublicKey}}" placeholder="e.g. SshPublicKey"> </div> <div class="field"> - <label for="attribute_avatar">{{.i18n.Tr "admin.auths.attribute_avatar"}}</label> + <label for="attribute_avatar">{{.locale.Tr "admin.auths.attribute_avatar"}}</label> <input id="attribute_avatar" name="attribute_avatar" value="{{$cfg.AttributeAvatar}}" placeholder="e.g. jpegPhoto"> </div> @@ -113,33 +113,33 @@ <!-- ldap group begin --> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.enable_ldap_groups"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label> <input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if $cfg.GroupsEnabled}}checked{{end}}> </div> </div> <div id="ldap-group-options" class="ui segment secondary" {{if not $cfg.GroupsEnabled}}hidden{{end}}> <div class="field"> - <label>{{.i18n.Tr "admin.auths.group_search_base"}}</label> + <label>{{.locale.Tr "admin.auths.group_search_base"}}</label> <input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="e.g. ou=group,dc=mydomain,dc=com"> </div> <div class="field"> - <label>{{.i18n.Tr "admin.auths.group_attribute_list_users"}}</label> + <label>{{.locale.Tr "admin.auths.group_attribute_list_users"}}</label> <input name="group_member_uid" value="{{$cfg.GroupMemberUID}}" placeholder="e.g. memberUid"> </div> <div class="field"> - <label>{{.i18n.Tr "admin.auths.user_attribute_in_group"}}</label> + <label>{{.locale.Tr "admin.auths.user_attribute_in_group"}}</label> <input name="user_uid" value="{{$cfg.UserUID}}" placeholder="e.g. uid"> </div> <div class="field"> - <label>{{.i18n.Tr "admin.auths.verify_group_membership"}}</label> + <label>{{.locale.Tr "admin.auths.verify_group_membership"}}</label> <input name="group_filter" value="{{$cfg.GroupFilter}}" placeholder="e.g. (|(cn=gitea_users)(cn=admins))"> </div> <div class="field"> - <label>{{.i18n.Tr "admin.auths.map_group_to_team"}}</label> + <label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label> <input name="group_team_map" value="{{$cfg.GroupTeamMap}}" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'> </div> <div class="ui checkbox"> - <label>{{.i18n.Tr "admin.auths.map_group_to_team_removal"}}</label> + <label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label> <input name="group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}> </div> </div> @@ -148,31 +148,31 @@ {{if .Source.IsLDAP}} <div class="inline field"> <div class="ui checkbox"> - <label for="use_paged_search"><strong>{{.i18n.Tr "admin.auths.use_paged_search"}}</strong></label> + <label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label> <input id="use_paged_search" name="use_paged_search" type="checkbox" {{if $cfg.UsePagedSearch}}checked{{end}}> </div> </div> <div class="field required search-page-size{{if not $cfg.UsePagedSearch}} hide{{end}}"> - <label for="search_page_size">{{.i18n.Tr "admin.auths.search_page_size"}}</label> + <label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label> <input id="search_page_size" name="search_page_size" value="{{if $cfg.UsePagedSearch}}{{$cfg.SearchPageSize}}{{end}}"> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.attributes_in_bind"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label> <input name="attributes_in_bind" type="checkbox" {{if $cfg.AttributesInBind}}checked{{end}}> </div> </div> {{end}} <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="allow_deactivate_all"><strong>{{.i18n.Tr "admin.auths.allow_deactivate_all"}}</strong></label> + <label for="allow_deactivate_all"><strong>{{.locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label> <input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox" {{if $cfg.AllowDeactivateAll}}checked{{end}}> </div> </div> @@ -182,7 +182,7 @@ {{if .Source.IsSMTP}} {{ $cfg:=.Source.Cfg }} <div class="inline required field"> - <label>{{.i18n.Tr "admin.auths.smtp_auth"}}</label> + <label>{{.locale.Tr "admin.auths.smtp_auth"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="smtp_auth" name="smtp_auth" value="{{$cfg.Auth}}" required> <div class="text">{{$cfg.Auth}}</div> @@ -195,47 +195,47 @@ </div> </div> <div class="required field"> - <label for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label> + <label for="smtp_host">{{.locale.Tr "admin.auths.smtphost"}}</label> <input id="smtp_host" name="smtp_host" value="{{$cfg.Host}}" required> </div> <div class="required field"> - <label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label> + <label for="smtp_port">{{.locale.Tr "admin.auths.smtpport"}}</label> <input id="smtp_port" name="smtp_port" value="{{$cfg.Port}}" required> </div> <div class="field"> <div class="ui checkbox"> - <label for="force_smtps"><strong>{{.i18n.Tr "admin.auths.force_smtps"}}</strong></label> + <label for="force_smtps"><strong>{{.locale.Tr "admin.auths.force_smtps"}}</strong></label> <input id="force_smtps" name="force_smtps" type="checkbox" {{if $cfg.ForceSMTPS}}checked{{end}}> </div> - <p class="help">{{.i18n.Tr "admin.auths.force_smtps_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.force_smtps_helper"}}</p> </div> <div class="has-tls inline field {{if not .HasTLS}}hide{{end}}"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.skip_tls_verify"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> <input name="skip_verify" type="checkbox" {{if .Source.SkipVerify}}checked{{end}}> </div> </div> <div class="field"> - <label for="helo_hostname">{{.i18n.Tr "admin.auths.helo_hostname"}}</label> + <label for="helo_hostname">{{.locale.Tr "admin.auths.helo_hostname"}}</label> <input id="helo_hostname" name="helo_hostname" value="{{$cfg.HeloHostname}}"> - <p class="help">{{.i18n.Tr "admin.auths.helo_hostname_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.helo_hostname_helper"}}</p> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="disable_helo"><strong>{{.i18n.Tr "admin.auths.disable_helo"}}</strong></label> + <label for="disable_helo"><strong>{{.locale.Tr "admin.auths.disable_helo"}}</strong></label> <input id="disable_helo" name="disable_helo" type="checkbox" {{if $cfg.DisableHelo}}checked{{end}}> </div> </div> <div class="field"> - <label for="allowed_domains">{{.i18n.Tr "admin.auths.allowed_domains"}}</label> + <label for="allowed_domains">{{.locale.Tr "admin.auths.allowed_domains"}}</label> <input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}"> - <p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.allowed_domains_helper"}}</p> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> {{end}} @@ -244,18 +244,18 @@ {{if .Source.IsPAM}} {{ $cfg:=.Source.Cfg }} <div class="required field"> - <label for="pam_service_name">{{.i18n.Tr "admin.auths.pam_service_name"}}</label> + <label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label> <input id="pam_service_name" name="pam_service_name" value="{{$cfg.ServiceName}}" required> </div> <div class="field"> - <label for="pam_email_domain">{{.i18n.Tr "admin.auths.pam_email_domain"}}</label> + <label for="pam_email_domain">{{.locale.Tr "admin.auths.pam_email_domain"}}</label> <input id="pam_email_domain" name="pam_email_domain" value="{{$cfg.EmailDomain}}"> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> {{end}} @@ -264,7 +264,7 @@ {{if .Source.IsOAuth2}} {{ $cfg:=.Source.Cfg }} <div class="inline required field"> - <label>{{.i18n.Tr "admin.auths.oauth2_provider"}}</label> + <label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="oauth2_provider" name="oauth2_provider" value="{{$cfg.Provider}}" required> <div class="text">{{.CurrentOAuth2Provider.DisplayName}}</div> @@ -277,52 +277,52 @@ </div> </div> <div class="required field"> - <label for="oauth2_key">{{.i18n.Tr "admin.auths.oauth2_clientID"}}</label> + <label for="oauth2_key">{{.locale.Tr "admin.auths.oauth2_clientID"}}</label> <input id="oauth2_key" name="oauth2_key" value="{{$cfg.ClientID}}" required> </div> <div class="required field"> - <label for="oauth2_secret">{{.i18n.Tr "admin.auths.oauth2_clientSecret"}}</label> + <label for="oauth2_secret">{{.locale.Tr "admin.auths.oauth2_clientSecret"}}</label> <input id="oauth2_secret" name="oauth2_secret" value="{{$cfg.ClientSecret}}" required> </div> <div class="optional field"> - <label for="oauth2_icon_url">{{.i18n.Tr "admin.auths.oauth2_icon_url"}}</label> + <label for="oauth2_icon_url">{{.locale.Tr "admin.auths.oauth2_icon_url"}}</label> <input id="oauth2_icon_url" name="oauth2_icon_url" value="{{$cfg.IconURL}}"> </div> <div class="open_id_connect_auto_discovery_url required field"> - <label for="open_id_connect_auto_discovery_url">{{.i18n.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> + <label for="open_id_connect_auto_discovery_url">{{.locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> <input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{$cfg.OpenIDConnectAutoDiscoveryURL}}"> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if $cfg.SkipLocalTwoFA}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> <div class="oauth2_use_custom_url inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> <input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox" {{if $cfg.CustomURLMapping}}checked{{end}}> </div> </div> <div class="oauth2_use_custom_url_field oauth2_auth_url required field"> - <label for="oauth2_auth_url">{{.i18n.Tr "admin.auths.oauth2_authURL"}}</label> + <label for="oauth2_auth_url">{{.locale.Tr "admin.auths.oauth2_authURL"}}</label> <input id="oauth2_auth_url" name="oauth2_auth_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.AuthURL}}{{end}}"> </div> <div class="oauth2_use_custom_url_field oauth2_token_url required field"> - <label for="oauth2_token_url">{{.i18n.Tr "admin.auths.oauth2_tokenURL"}}</label> + <label for="oauth2_token_url">{{.locale.Tr "admin.auths.oauth2_tokenURL"}}</label> <input id="oauth2_token_url" name="oauth2_token_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.TokenURL}}{{end}}"> </div> <div class="oauth2_use_custom_url_field oauth2_profile_url required field"> - <label for="oauth2_profile_url">{{.i18n.Tr "admin.auths.oauth2_profileURL"}}</label> + <label for="oauth2_profile_url">{{.locale.Tr "admin.auths.oauth2_profileURL"}}</label> <input id="oauth2_profile_url" name="oauth2_profile_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.ProfileURL}}{{end}}"> </div> <div class="oauth2_use_custom_url_field oauth2_email_url required field"> - <label for="oauth2_email_url">{{.i18n.Tr "admin.auths.oauth2_emailURL"}}</label> + <label for="oauth2_email_url">{{.locale.Tr "admin.auths.oauth2_emailURL"}}</label> <input id="oauth2_email_url" name="oauth2_email_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.EmailURL}}{{end}}"> </div> <div class="oauth2_use_custom_url_field oauth2_tenant required field"> - <label for="oauth2_tenant">{{.i18n.Tr "admin.auths.oauth2_tenant"}}</label> + <label for="oauth2_tenant">{{.locale.Tr "admin.auths.oauth2_tenant"}}</label> <input id="oauth2_tenant" name="oauth2_tenant" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.Tenant}}{{end}}"> </div> @@ -336,29 +336,29 @@ {{end}}{{end}} <div class="field"> - <label for="oauth2_scopes">{{.i18n.Tr "admin.auths.oauth2_scopes"}}</label> + <label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label> <input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{Join $cfg.Scopes "," }}{{end}}"> </div> <div class="field"> - <label for="oauth2_required_claim_name">{{.i18n.Tr "admin.auths.oauth2_required_claim_name"}}</label> + <label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label> <input id="oauth2_required_claim_name" name="oauth2_required_claim_name" values="{{$cfg.RequiredClaimName}}"> - <p class="help">{{.i18n.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p> </div> <div class="field"> - <label for="oauth2_required_claim_value">{{.i18n.Tr "admin.auths.oauth2_required_claim_value"}}</label> + <label for="oauth2_required_claim_value">{{.locale.Tr "admin.auths.oauth2_required_claim_value"}}</label> <input id="oauth2_required_claim_value" name="oauth2_required_claim_value" values="{{$cfg.RequiredClaimValue}}"> - <p class="help">{{.i18n.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p> </div> <div class="field"> - <label for="oauth2_group_claim_name">{{.i18n.Tr "admin.auths.oauth2_group_claim_name"}}</label> + <label for="oauth2_group_claim_name">{{.locale.Tr "admin.auths.oauth2_group_claim_name"}}</label> <input id="oauth2_group_claim_name" name="oauth2_group_claim_name" value="{{$cfg.GroupClaimName}}"> </div> <div class="field"> - <label for="oauth2_admin_group">{{.i18n.Tr "admin.auths.oauth2_admin_group"}}</label> + <label for="oauth2_admin_group">{{.locale.Tr "admin.auths.oauth2_admin_group"}}</label> <input id="oauth2_admin_group" name="oauth2_admin_group" value="{{$cfg.AdminGroup}}"> </div> <div class="field"> - <label for="oauth2_restricted_group">{{.i18n.Tr "admin.auths.oauth2_restricted_group"}}</label> + <label for="oauth2_restricted_group">{{.locale.Tr "admin.auths.oauth2_restricted_group"}}</label> <input id="oauth2_restricted_group" name="oauth2_restricted_group" value="{{$cfg.RestrictedGroup}}"> </div> {{end}} @@ -368,32 +368,32 @@ {{ $cfg:=.Source.Cfg }} <div class="field"> <div class="ui checkbox"> - <label for="sspi_auto_create_users"><strong>{{.i18n.Tr "admin.auths.sspi_auto_create_users"}}</strong></label> + <label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label> <input id="sspi_auto_create_users" name="sspi_auto_create_users" class="sspi-auto-create-users" type="checkbox" {{if $cfg.AutoCreateUsers}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.sspi_auto_create_users_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> - <label for="sspi_auto_activate_users"><strong>{{.i18n.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label> + <label for="sspi_auto_activate_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label> <input id="sspi_auto_activate_users" name="sspi_auto_activate_users" class="sspi-auto-activate-users" type="checkbox" {{if $cfg.AutoActivateUsers}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> - <label for="sspi_strip_domain_names"><strong>{{.i18n.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label> + <label for="sspi_strip_domain_names"><strong>{{.locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label> <input id="sspi_strip_domain_names" name="sspi_strip_domain_names" class="sspi-strip-domain-names" type="checkbox" {{if $cfg.StripDomainNames}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p> </div> </div> <div class="required field"> - <label for="sspi_separator_replacement">{{.i18n.Tr "admin.auths.sspi_separator_replacement"}}</label> + <label for="sspi_separator_replacement">{{.locale.Tr "admin.auths.sspi_separator_replacement"}}</label> <input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{$cfg.SeparatorReplacement}}" required> - <p class="help">{{.i18n.Tr "admin.auths.sspi_separator_replacement_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p> </div> <div class="field"> - <label for="sspi_default_language">{{.i18n.Tr "admin.auths.sspi_default_language"}}</label> + <label for="sspi_default_language">{{.locale.Tr "admin.auths.sspi_default_language"}}</label> <div class="ui language selection dropdown" id="sspi_default_language"> <input name="sspi_default_language" type="hidden" value="{{$cfg.DefaultLanguage}}"> {{svg "octicon-triangle-down" 14 "dropdown icon"}} @@ -405,27 +405,27 @@ {{end}} </div> </div> - <p class="help">{{.i18n.Tr "admin.auths.sspi_default_language_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_default_language_helper"}}</p> </div> {{end}} {{if .Source.IsLDAP}} <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.syncenabled"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label> <input name="is_sync_enabled" type="checkbox" {{if .Source.IsSyncEnabled}}checked{{end}}> </div> </div> {{end}} <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.activated"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.activated"}}</strong></label> <input name="is_active" type="checkbox" {{if .Source.IsActive}}checked{{end}}> </div> </div> <div class="field"> - <button class="ui green button">{{.i18n.Tr "admin.auths.update"}}</button> - <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.i18n.Tr "admin.auths.delete"}}</div> + <button class="ui green button">{{.locale.Tr "admin.auths.update"}}</button> + <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.locale.Tr "admin.auths.delete"}}</div> </div> </form> </div> @@ -435,10 +435,10 @@ <div class="ui small basic delete modal"> <div class="ui icon header"> {{svg "octicon-trash"}} - {{.i18n.Tr "admin.auths.delete_auth_title"}} + {{.locale.Tr "admin.auths.delete_auth_title"}} </div> <div class="content"> - <p>{{.i18n.Tr "admin.auths.delete_auth_desc"}}</p> + <p>{{.locale.Tr "admin.auths.delete_auth_desc"}}</p> </div> {{template "base/delete_modal_actions" .}} </div> diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl index f1b4da35eb..3ce138449d 100644 --- a/templates/admin/auth/list.tmpl +++ b/templates/admin/auth/list.tmpl @@ -4,9 +4,9 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.auths.auth_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}) + {{.locale.Tr "admin.auths.auth_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/auths/new">{{.i18n.Tr "admin.auths.new"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/auths/new">{{.locale.Tr "admin.auths.new"}}</a> </div> </h4> <div class="ui attached table segment"> @@ -14,12 +14,12 @@ <thead> <tr> <th>ID</th> - <th>{{.i18n.Tr "admin.auths.name"}}</th> - <th>{{.i18n.Tr "admin.auths.type"}}</th> - <th>{{.i18n.Tr "admin.auths.enabled"}}</th> - <th>{{.i18n.Tr "admin.auths.updated"}}</th> - <th>{{.i18n.Tr "admin.users.created"}}</th> - <th>{{.i18n.Tr "admin.users.edit"}}</th> + <th>{{.locale.Tr "admin.auths.name"}}</th> + <th>{{.locale.Tr "admin.auths.type"}}</th> + <th>{{.locale.Tr "admin.auths.enabled"}}</th> + <th>{{.locale.Tr "admin.auths.updated"}}</th> + <th>{{.locale.Tr "admin.users.created"}}</th> + <th>{{.locale.Tr "admin.users.edit"}}</th> </tr> </thead> <tbody> diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl index 9882cde03b..6bfda9fcd3 100644 --- a/templates/admin/auth/new.tmpl +++ b/templates/admin/auth/new.tmpl @@ -4,7 +4,7 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.auths.new"}} + {{.locale.Tr "admin.auths.new"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> @@ -12,7 +12,7 @@ {{.CsrfTokenHtml}} <!-- Types and name --> <div class="inline required field {{if .Err_Type}}error{{end}}"> - <label>{{.i18n.Tr "admin.auths.auth_type"}}</label> + <label>{{.locale.Tr "admin.auths.auth_type"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="auth_type" name="type" value="{{.type}}"> <div class="text">{{.CurrentTypeName}}</div> @@ -25,7 +25,7 @@ </div> </div> <div class="required inline field {{if .Err_Name}}error{{end}}"> - <label for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label> + <label for="name">{{.locale.Tr "admin.auths.auth_name"}}</label> <input id="name" name="name" value="{{.name}}" autofocus required> </div> @@ -37,16 +37,16 @@ <!-- PAM --> <div class="pam required field {{if not (eq .type 4)}}hide{{end}}"> - <label for="pam_service_name">{{.i18n.Tr "admin.auths.pam_service_name"}}</label> + <label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label> <input id="pam_service_name" name="pam_service_name" value="{{.pam_service_name}}" /> - <label for="pam_email_domain">{{.i18n.Tr "admin.auths.pam_email_domain"}}</label> + <label for="pam_email_domain">{{.locale.Tr "admin.auths.pam_email_domain"}}</label> <input id="pam_email_domain" name="pam_email_domain" value="{{.pam_email_domain}}"> </div> <div class="pam optional field {{if not (eq .type 4)}}hide{{end}}"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> @@ -58,67 +58,67 @@ <div class="ldap field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.attributes_in_bind"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label> <input name="attributes_in_bind" type="checkbox" {{if .attributes_in_bind}}checked{{end}}> </div> </div> <div class="ldap inline field {{if not (eq .type 2)}}hide{{end}}"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.syncenabled"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label> <input name="is_sync_enabled" type="checkbox" {{if .is_sync_enabled}}checked{{end}}> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.activated"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.activated"}}</strong></label> <input name="is_active" type="checkbox" {{if .is_active}}checked{{end}}> </div> </div> <div class="field"> - <button class="ui green button">{{.i18n.Tr "admin.auths.new"}}</button> + <button class="ui green button">{{.locale.Tr "admin.auths.new"}}</button> </div> </form> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.auths.tips"}} + {{.locale.Tr "admin.auths.tips"}} </h4> <div class="ui attached segment"> <h5>GMail Settings:</h5> <p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p> - <h5>{{.i18n.Tr "admin.auths.tips.oauth2.general"}}:</h5> - <p>{{.i18n.Tr "admin.auths.tips.oauth2.general.tip"}}</p> + <h5>{{.locale.Tr "admin.auths.tips.oauth2.general"}}:</h5> + <p>{{.locale.Tr "admin.auths.tips.oauth2.general.tip"}}</p> - <h5 class="ui top attached header">{{.i18n.Tr "admin.auths.tip.oauth2_provider"}}</h5> + <h5 class="ui top attached header">{{.locale.Tr "admin.auths.tip.oauth2_provider"}}</h5> <div class="ui attached segment"> <li>Bitbucket</li> - <span>{{.i18n.Tr "admin.auths.tip.bitbucket"}}</span> + <span>{{.locale.Tr "admin.auths.tip.bitbucket"}}</span> <li>Dropbox</li> - <span>{{.i18n.Tr "admin.auths.tip.dropbox"}}</span> + <span>{{.locale.Tr "admin.auths.tip.dropbox"}}</span> <li>Facebook</li> - <span>{{.i18n.Tr "admin.auths.tip.facebook"}}</span> + <span>{{.locale.Tr "admin.auths.tip.facebook"}}</span> <li>GitHub</li> - <span>{{.i18n.Tr "admin.auths.tip.github"}}</span> + <span>{{.locale.Tr "admin.auths.tip.github"}}</span> <li>GitLab</li> - <span>{{.i18n.Tr "admin.auths.tip.gitlab"}}</span> + <span>{{.locale.Tr "admin.auths.tip.gitlab"}}</span> <li>Google</li> - <span>{{.i18n.Tr "admin.auths.tip.google_plus"}}</span> + <span>{{.locale.Tr "admin.auths.tip.google_plus"}}</span> <li>OpenID Connect</li> - <span>{{.i18n.Tr "admin.auths.tip.openid_connect"}}</span> + <span>{{.locale.Tr "admin.auths.tip.openid_connect"}}</span> <li>Twitter</li> - <span>{{.i18n.Tr "admin.auths.tip.twitter"}}</span> + <span>{{.locale.Tr "admin.auths.tip.twitter"}}</span> <li>Discord</li> - <span>{{.i18n.Tr "admin.auths.tip.discord"}}</span> + <span>{{.locale.Tr "admin.auths.tip.discord"}}</span> <li>Gitea</li> - <span>{{.i18n.Tr "admin.auths.tip.gitea"}}</span> + <span>{{.locale.Tr "admin.auths.tip.gitea"}}</span> <li>Nextcloud</li> - <span>{{.i18n.Tr "admin.auths.tip.nextcloud"}}</span> + <span>{{.locale.Tr "admin.auths.tip.nextcloud"}}</span> <li>Yandex</li> - <span>{{.i18n.Tr "admin.auths.tip.yandex"}}</span> + <span>{{.locale.Tr "admin.auths.tip.yandex"}}</span> <li>Mastodon</li> - <span>{{.i18n.Tr "admin.auths.tip.mastodon"}}</span> + <span>{{.locale.Tr "admin.auths.tip.mastodon"}}</span> </div> </div> </div> diff --git a/templates/admin/auth/source/ldap.tmpl b/templates/admin/auth/source/ldap.tmpl index afdfbadd65..b44eb799b9 100644 --- a/templates/admin/auth/source/ldap.tmpl +++ b/templates/admin/auth/source/ldap.tmpl @@ -1,6 +1,6 @@ <div class="ldap dldap field {{if not (or (eq .type 2) (eq .type 5))}}hide{{end}}"> <div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}"> - <label>{{.i18n.Tr "admin.auths.security_protocol"}}</label> + <label>{{.locale.Tr "admin.auths.security_protocol"}}</label> <div class="ui selection security-protocol dropdown"> <input type="hidden" id="security_protocol" name="security_protocol" value="{{.security_protocol}}"> <div class="text">{{.CurrentSecurityProtocol}}</div> @@ -13,103 +13,103 @@ </div> </div> <div class="required field"> - <label for="host">{{.i18n.Tr "admin.auths.host"}}</label> + <label for="host">{{.locale.Tr "admin.auths.host"}}</label> <input id="host" name="host" value="{{.host}}" placeholder="e.g. mydomain.com"> </div> <div class="required field"> - <label for="port">{{.i18n.Tr "admin.auths.port"}}</label> + <label for="port">{{.locale.Tr "admin.auths.port"}}</label> <input id="port" name="port" value="{{.port}}" placeholder="e.g. 636"> </div> <div class="has-tls inline field {{if not .HasTLS}}hide{{end}}"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.skip_tls_verify"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> <input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}> </div> </div> <div class="ldap field {{if not (eq .type 2)}}hide{{end}}"> - <label for="bind_dn">{{.i18n.Tr "admin.auths.bind_dn"}}</label> + <label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label> <input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="e.g. cn=Search,dc=mydomain,dc=com"> </div> <div class="ldap field {{if not (eq .type 2)}}hide{{end}}"> - <label for="bind_password">{{.i18n.Tr "admin.auths.bind_password"}}</label> + <label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label> <input id="bind_password" name="bind_password" type="password" autocomplete="off" value="{{.bind_password}}"> </div> <div class="binddnrequired {{if (eq .type 2)}}required{{end}} field"> - <label for="user_base">{{.i18n.Tr "admin.auths.user_base"}}</label> + <label for="user_base">{{.locale.Tr "admin.auths.user_base"}}</label> <input id="user_base" name="user_base" value="{{.user_base}}" placeholder="e.g. ou=Users,dc=mydomain,dc=com"> </div> <div class="dldap required field {{if not (eq .type 5)}}hide{{end}}"> - <label for="user_dn">{{.i18n.Tr "admin.auths.user_dn"}}</label> + <label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label> <input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="e.g. uid=%s,ou=Users,dc=mydomain,dc=com"> </div> <div class="required field"> - <label for="filter">{{.i18n.Tr "admin.auths.filter"}}</label> + <label for="filter">{{.locale.Tr "admin.auths.filter"}}</label> <input id="filter" name="filter" value="{{.filter}}" placeholder="e.g. (&(objectClass=posixAccount)(uid=%s))"> </div> <div class="field"> - <label for="admin_filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label> + <label for="admin_filter">{{.locale.Tr "admin.auths.admin_filter"}}</label> <input id="admin_filter" name="admin_filter" value="{{.admin_filter}}"> </div> <div class="field"> - <label for="restricted_filter">{{.i18n.Tr "admin.auths.restricted_filter"}}</label> + <label for="restricted_filter">{{.locale.Tr "admin.auths.restricted_filter"}}</label> <input id="restricted_filter" name="admin_filter" value="{{.restricted_filter}}"> - <p class="help">{{.i18n.Tr "admin.auths.restricted_filter_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.restricted_filter_helper"}}</p> </div> <div class="field"> - <label for="attribute_username">{{.i18n.Tr "admin.auths.attribute_username"}}</label> - <input id="attribute_username" name="attribute_username" value="{{.attribute_username}}" placeholder="{{.i18n.Tr "admin.auths.attribute_username_placeholder"}}"> + <label for="attribute_username">{{.locale.Tr "admin.auths.attribute_username"}}</label> + <input id="attribute_username" name="attribute_username" value="{{.attribute_username}}" placeholder="{{.locale.Tr "admin.auths.attribute_username_placeholder"}}"> </div> <div class="field"> - <label for="attribute_name">{{.i18n.Tr "admin.auths.attribute_name"}}</label> + <label for="attribute_name">{{.locale.Tr "admin.auths.attribute_name"}}</label> <input id="attribute_name" name="attribute_name" value="{{.attribute_name}}"> </div> <div class="field"> - <label for="attribute_surname">{{.i18n.Tr "admin.auths.attribute_surname"}}</label> + <label for="attribute_surname">{{.locale.Tr "admin.auths.attribute_surname"}}</label> <input id="attribute_surname" name="attribute_surname" value="{{.attribute_surname}}"> </div> <div class="required field"> - <label for="attribute_mail">{{.i18n.Tr "admin.auths.attribute_mail"}}</label> + <label for="attribute_mail">{{.locale.Tr "admin.auths.attribute_mail"}}</label> <input id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" placeholder="e.g. mail"> </div> <div class="field"> - <label for="attribute_ssh_public_key">{{.i18n.Tr "admin.auths.attribute_ssh_public_key"}}</label> + <label for="attribute_ssh_public_key">{{.locale.Tr "admin.auths.attribute_ssh_public_key"}}</label> <input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{.attribute_ssh_public_key}}" placeholder="e.g. SshPublicKey"> </div> <div class="field"> - <label for="attribute_avatar">{{.i18n.Tr "admin.auths.attribute_avatar"}}</label> + <label for="attribute_avatar">{{.locale.Tr "admin.auths.attribute_avatar"}}</label> <input id="attribute_avatar" name="attribute_avatar" value="{{.attribute_avatar}}" placeholder="e.g. jpegPhoto"> </div> <!-- ldap group begin --> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.enable_ldap_groups"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label> <input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if .groups_enabled}}checked{{end}}> </div> </div> <div id="ldap-group-options" class="ui segment secondary"> <div class="field"> - <label>{{.i18n.Tr "admin.auths.group_search_base"}}</label> + <label>{{.locale.Tr "admin.auths.group_search_base"}}</label> <input name="group_dn" value="{{.group_dn}}" placeholder="e.g. ou=group,dc=mydomain,dc=com"> </div> <div class="field"> - <label>{{.i18n.Tr "admin.auths.group_attribute_list_users"}}</label> + <label>{{.locale.Tr "admin.auths.group_attribute_list_users"}}</label> <input name="group_member_uid" value="{{.group_member_uid}}" placeholder="e.g. memberUid"> </div> <div class="field"> - <label>{{.i18n.Tr "admin.auths.user_attribute_in_group"}}</label> + <label>{{.locale.Tr "admin.auths.user_attribute_in_group"}}</label> <input name="user_uid" value="{{.user_uid}}" placeholder="e.g. uid"> </div> <div class="field"> - <label>{{.i18n.Tr "admin.auths.verify_group_membership"}}</label> + <label>{{.locale.Tr "admin.auths.verify_group_membership"}}</label> <input name="group_filter" value="{{.group_filter}}" placeholder="e.g. (|(cn=gitea_users)(cn=admins))"> </div> <div class="field"> - <label>{{.i18n.Tr "admin.auths.map_group_to_team"}}</label> + <label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label> <input name="group_team_map" value="{{.group_team_map}}" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'> </div> <div class="ui checkbox"> - <label>{{.i18n.Tr "admin.auths.map_group_to_team_removal"}}</label> + <label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label> <input name="group_team_map_removal" type="checkbox" {{if .group_team_map_removal}}checked{{end}}> </div> </div> @@ -117,24 +117,24 @@ <div class="ldap inline field {{if not (eq .type 2)}}hide{{end}}"> <div class="ui checkbox"> - <label for="use_paged_search"><strong>{{.i18n.Tr "admin.auths.use_paged_search"}}</strong></label> + <label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label> <input id="use_paged_search" name="use_paged_search" class="use-paged-search" type="checkbox" {{if .use_paged_search}}checked{{end}}> </div> </div> <div class="ldap field search-page-size required {{if or (not (eq .type 2)) (not .use_paged_search)}}hide{{end}}"> - <label for="search_page_size">{{.i18n.Tr "admin.auths.search_page_size"}}</label> + <label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label> <input id="search_page_size" name="search_page_size" value="{{.search_page_size}}"> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="allow_deactivate_all"><strong>{{.i18n.Tr "admin.auths.allow_deactivate_all"}}</strong></label> + <label for="allow_deactivate_all"><strong>{{.locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label> <input id="allow_deactivate_all" name="allow_deactivate_all" type="checkbox" {{if .allow_deactivate_all}}checked{{end}}> </div> </div> diff --git a/templates/admin/auth/source/oauth.tmpl b/templates/admin/auth/source/oauth.tmpl index 3991dc2170..166373a324 100644 --- a/templates/admin/auth/source/oauth.tmpl +++ b/templates/admin/auth/source/oauth.tmpl @@ -1,6 +1,6 @@ <div class="oauth2 field {{if not (eq .type 6)}}hide{{end}}"> <div class="inline required field"> - <label>{{.i18n.Tr "admin.auths.oauth2_provider"}}</label> + <label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="oauth2_provider" name="oauth2_provider" value="{{.oauth2_provider}}"> <div class="text">{{.oauth2_provider}}</div> @@ -13,53 +13,53 @@ </div> </div> <div class="required field"> - <label for="oauth2_key">{{.i18n.Tr "admin.auths.oauth2_clientID"}}</label> + <label for="oauth2_key">{{.locale.Tr "admin.auths.oauth2_clientID"}}</label> <input id="oauth2_key" name="oauth2_key" value="{{.oauth2_key}}"> </div> <div class="required field"> - <label for="oauth2_secret">{{.i18n.Tr "admin.auths.oauth2_clientSecret"}}</label> + <label for="oauth2_secret">{{.locale.Tr "admin.auths.oauth2_clientSecret"}}</label> <input id="oauth2_secret" name="oauth2_secret" value="{{.oauth2_secret}}"> </div> <div class="optional field"> - <label for="oauth2_icon_url">{{.i18n.Tr "admin.auths.oauth2_icon_url"}}</label> + <label for="oauth2_icon_url">{{.locale.Tr "admin.auths.oauth2_icon_url"}}</label> <input id="oauth2_icon_url" name="oauth2_icon_url" value="{{.oauth2_icon_url}}"> </div> <div class="open_id_connect_auto_discovery_url required field"> - <label for="open_id_connect_auto_discovery_url">{{.i18n.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> + <label for="open_id_connect_auto_discovery_url">{{.locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> <input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{.open_id_connect_auto_discovery_url}}"> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> <div class="oauth2_use_custom_url inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> <input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox"> </div> </div> <div class="oauth2_use_custom_url_field oauth2_auth_url required field"> - <label for="oauth2_auth_url">{{.i18n.Tr "admin.auths.oauth2_authURL"}}</label> + <label for="oauth2_auth_url">{{.locale.Tr "admin.auths.oauth2_authURL"}}</label> <input id="oauth2_auth_url" name="oauth2_auth_url" value="{{.oauth2_auth_url}}"> </div> <div class="oauth2_use_custom_url_field oauth2_token_url required field"> - <label for="oauth2_token_url">{{.i18n.Tr "admin.auths.oauth2_tokenURL"}}</label> + <label for="oauth2_token_url">{{.locale.Tr "admin.auths.oauth2_tokenURL"}}</label> <input id="oauth2_token_url" name="oauth2_token_url" value="{{.oauth2_token_url}}"> </div> <div class="oauth2_use_custom_url_field oauth2_profile_url required field"> - <label for="oauth2_profile_url">{{.i18n.Tr "admin.auths.oauth2_profileURL"}}</label> + <label for="oauth2_profile_url">{{.locale.Tr "admin.auths.oauth2_profileURL"}}</label> <input id="oauth2_profile_url" name="oauth2_profile_url" value="{{.oauth2_profile_url}}"> </div> <div class="oauth2_use_custom_url_field oauth2_email_url required field"> - <label for="oauth2_email_url">{{.i18n.Tr "admin.auths.oauth2_emailURL"}}</label> + <label for="oauth2_email_url">{{.locale.Tr "admin.auths.oauth2_emailURL"}}</label> <input id="oauth2_email_url" name="oauth2_email_url" value="{{.oauth2_email_url}}"> </div> <div class="oauth2_use_custom_url_field oauth2_tenant required field"> - <label for="oauth2_tenant">{{.i18n.Tr "admin.auths.oauth2_tenant"}}</label> + <label for="oauth2_tenant">{{.locale.Tr "admin.auths.oauth2_tenant"}}</label> <input id="oauth2_tenant" name="oauth2_tenant" value="{{.oauth2_tenant}}"> </div> @@ -73,29 +73,29 @@ {{end}}{{end}} <div class="field"> - <label for="oauth2_scopes">{{.i18n.Tr "admin.auths.oauth2_scopes"}}</label> + <label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label> <input id="oauth2_scopes" name="oauth2_scopes" values="{{.oauth2_scopes}}"> </div> <div class="field"> - <label for="oauth2_required_claim_name">{{.i18n.Tr "admin.auths.oauth2_required_claim_name"}}</label> + <label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label> <input id="oauth2_required_claim_name" name="oauth2_required_claim_name" values="{{.oauth2_required_claim_name}}"> - <p class="help">{{.i18n.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p> </div> <div class="field"> - <label for="oauth2_required_claim_value">{{.i18n.Tr "admin.auths.oauth2_required_claim_value"}}</label> + <label for="oauth2_required_claim_value">{{.locale.Tr "admin.auths.oauth2_required_claim_value"}}</label> <input id="oauth2_required_claim_value" name="oauth2_required_claim_value" values="{{.oauth2_required_claim_value}}"> - <p class="help">{{.i18n.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p> </div> <div class="field"> - <label for="oauth2_group_claim_name">{{.i18n.Tr "admin.auths.oauth2_group_claim_name"}}</label> + <label for="oauth2_group_claim_name">{{.locale.Tr "admin.auths.oauth2_group_claim_name"}}</label> <input id="oauth2_group_claim_name" name="oauth2_group_claim_name" value="{{.oauth2_group_claim_name}}"> </div> <div class="field"> - <label for="oauth2_admin_group">{{.i18n.Tr "admin.auths.oauth2_admin_group"}}</label> + <label for="oauth2_admin_group">{{.locale.Tr "admin.auths.oauth2_admin_group"}}</label> <input id="oauth2_admin_group" name="oauth2_admin_group" value="{{.oauth2_group_claim_name}}"> </div> <div class="field"> - <label for="oauth2_restricted_group">{{.i18n.Tr "admin.auths.oauth2_restricted_group"}}</label> + <label for="oauth2_restricted_group">{{.locale.Tr "admin.auths.oauth2_restricted_group"}}</label> <input id="oauth2_restricted_group" name="oauth2_restricted_group" value="{{.oauth2_group_claim_name}}"> </div> </div> diff --git a/templates/admin/auth/source/smtp.tmpl b/templates/admin/auth/source/smtp.tmpl index 8572d6dc56..2d577412c1 100644 --- a/templates/admin/auth/source/smtp.tmpl +++ b/templates/admin/auth/source/smtp.tmpl @@ -1,6 +1,6 @@ <div class="smtp field {{if not (eq .type 3)}}hide{{end}}"> <div class="inline required field"> - <label>{{.i18n.Tr "admin.auths.smtp_auth"}}</label> + <label>{{.locale.Tr "admin.auths.smtp_auth"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="smtp_auth" name="smtp_auth" value="{{.smtp_auth}}"> <div class="text">{{.smtp_auth}}</div> @@ -13,47 +13,47 @@ </div> </div> <div class="required field"> - <label for="smtp_host">{{.i18n.Tr "admin.auths.smtphost"}}</label> + <label for="smtp_host">{{.locale.Tr "admin.auths.smtphost"}}</label> <input id="smtp_host" name="smtp_host" value="{{.smtp_host}}"> </div> <div class="required field"> - <label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label> + <label for="smtp_port">{{.locale.Tr "admin.auths.smtpport"}}</label> <input id="smtp_port" name="smtp_port" value="{{.smtp_port}}"> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="force_smtps"><strong>{{.i18n.Tr "admin.auths.force_smtps"}}</strong></label> + <label for="force_smtps"><strong>{{.locale.Tr "admin.auths.force_smtps"}}</strong></label> <input id="force_smtps" name="force_smtps" type="checkbox" {{if .force_smtps}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.force_smtps_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.force_smtps_helper"}}</p> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.auths.skip_tls_verify"}}</strong></label> + <label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label> <input name="skip_verify" type="checkbox" {{if .skip_verify}}checked{{end}}> </div> </div> <div class="field"> - <label for="helo_hostname">{{.i18n.Tr "admin.auths.helo_hostname"}}</label> + <label for="helo_hostname">{{.locale.Tr "admin.auths.helo_hostname"}}</label> <input id="helo_hostname" name="helo_hostname" value="{{.helo_hostname}}"> - <p class="help">{{.i18n.Tr "admin.auths.helo_hostname_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.helo_hostname_helper"}}</p> </div> <div class="inline field"> <div class="ui checkbox"> - <label for="disable_helo"><strong>{{.i18n.Tr "admin.auths.disable_helo"}}</strong></label> + <label for="disable_helo"><strong>{{.locale.Tr "admin.auths.disable_helo"}}</strong></label> <input id="disable_helo" name="disable_helo" type="checkbox" {{if .disable_helo}}checked{{end}}> </div> </div> <div class="field"> - <label for="allowed_domains">{{.i18n.Tr "admin.auths.allowed_domains"}}</label> + <label for="allowed_domains">{{.locale.Tr "admin.auths.allowed_domains"}}</label> <input id="allowed_domains" name="allowed_domains" value="{{.allowed_domains}}"> - <p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.allowed_domains_helper"}}</p> </div> <div class="optional field"> <div class="ui checkbox"> - <label for="skip_local_two_fa"><strong>{{.i18n.Tr "admin.auths.skip_local_two_fa"}}</strong></label> + <label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label> <input id="skip_local_two_fa" name="skip_local_two_fa" type="checkbox" {{if .skip_local_two_fa}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p> </div> </div> </div> diff --git a/templates/admin/auth/source/sspi.tmpl b/templates/admin/auth/source/sspi.tmpl index 91697ef9c5..dee40d9fd5 100644 --- a/templates/admin/auth/source/sspi.tmpl +++ b/templates/admin/auth/source/sspi.tmpl @@ -1,32 +1,32 @@ <div class="sspi field {{if not (eq .type 7)}}hide{{end}}"> <div class="field"> <div class="ui checkbox"> - <label for="sspi_auto_create_users"><strong>{{.i18n.Tr "admin.auths.sspi_auto_create_users"}}</strong></label> + <label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label> <input id="sspi_auto_create_users" name="sspi_auto_create_users" class="sspi-auto-create-users" type="checkbox" {{if .SSPIAutoCreateUsers}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.sspi_auto_create_users_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> - <label for="sspi_auto_activate_users"><strong>{{.i18n.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label> + <label for="sspi_auto_activate_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label> <input id="sspi_auto_activate_users" name="sspi_auto_activate_users" class="sspi-auto-activate-users" type="checkbox" {{if .SSPIAutoActivateUsers}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p> </div> </div> <div class="field"> <div class="ui checkbox"> - <label for="sspi_strip_domain_names"><strong>{{.i18n.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label> + <label for="sspi_strip_domain_names"><strong>{{.locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label> <input id="sspi_strip_domain_names" name="sspi_strip_domain_names" class="sspi-strip-domain-names" type="checkbox" {{if .SSPIStripDomainNames}}checked{{end}}> - <p class="help">{{.i18n.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p> </div> </div> <div class="required field"> - <label for="sspi_separator_replacement">{{.i18n.Tr "admin.auths.sspi_separator_replacement"}}</label> + <label for="sspi_separator_replacement">{{.locale.Tr "admin.auths.sspi_separator_replacement"}}</label> <input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{.SSPISeparatorReplacement}}"> - <p class="help">{{.i18n.Tr "admin.auths.sspi_separator_replacement_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p> </div> <div class="field"> - <label for="sspi_default_language">{{.i18n.Tr "admin.auths.sspi_default_language"}}</label> + <label for="sspi_default_language">{{.locale.Tr "admin.auths.sspi_default_language"}}</label> <div class="ui language selection dropdown" id="sspi_default_language"> <input name="sspi_default_language" type="hidden" value="{{.SSPIDefaultLanguage}}"> {{svg "octicon-triangle-down" 14 "dropdown icon"}} @@ -38,6 +38,6 @@ {{end}} </div> </div> - <p class="help">{{.i18n.Tr "admin.auths.sspi_default_language_helper"}}</p> + <p class="help">{{.locale.Tr "admin.auths.sspi_default_language_helper"}}</p> </div> </div> diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl index 4ec62c162c..28bc478f6a 100644 --- a/templates/admin/base/search.tmpl +++ b/templates/admin/base/search.tmpl @@ -2,22 +2,22 @@ <!-- Sort --> <div class="ui dropdown type jump item"> <span class="text"> - {{.i18n.Tr "repo.issues.filter_sort"}} + {{.locale.Tr "repo.issues.filter_sort"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} </span> <div class="menu"> - <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> - <a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> - <a class="{{if eq .SortType "alphabetically"}}active{{end}} item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> - <a class="{{if eq .SortType "reversealphabetically"}}active{{end}} item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> - <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> - <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> + <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a> + <a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a> + <a class="{{if eq .SortType "alphabetically"}}active{{end}} item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> + <a class="{{if eq .SortType "reversealphabetically"}}active{{end}} item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> + <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> + <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> </div> </div> </div> <form class="ui form ignore-dirty" style="max-width: 90%;"> <div class="ui fluid action input"> - <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus> - <button class="ui primary button">{{.i18n.Tr "explore.search"}}</button> + <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}..." autofocus> + <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> </div> </form> diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 2a27baf535..a55a797262 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -4,50 +4,50 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.server_config"}} + {{.locale.Tr "admin.config.server_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.app_name"}}</dt> + <dt>{{.locale.Tr "admin.config.app_name"}}</dt> <dd>{{AppName}}</dd> - <dt>{{.i18n.Tr "admin.config.app_ver"}}</dt> + <dt>{{.locale.Tr "admin.config.app_ver"}}</dt> <dd>{{AppVer}}{{AppBuiltWith}}</dd> - <dt>{{.i18n.Tr "admin.config.custom_conf"}}</dt> + <dt>{{.locale.Tr "admin.config.custom_conf"}}</dt> <dd>{{.CustomConf}}</dd> - <dt>{{.i18n.Tr "admin.config.app_url"}}</dt> + <dt>{{.locale.Tr "admin.config.app_url"}}</dt> <dd>{{.AppUrl}}</dd> - <dt>{{.i18n.Tr "admin.config.domain"}}</dt> + <dt>{{.locale.Tr "admin.config.domain"}}</dt> <dd>{{.Domain}}</dd> - <dt>{{.i18n.Tr "admin.config.offline_mode"}}</dt> + <dt>{{.locale.Tr "admin.config.offline_mode"}}</dt> <dd>{{if .OfflineMode}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.disable_router_log"}}</dt> + <dt>{{.locale.Tr "admin.config.disable_router_log"}}</dt> <dd>{{if .DisableRouterLog}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.config.run_user"}}</dt> + <dt>{{.locale.Tr "admin.config.run_user"}}</dt> <dd>{{.RunUser}}</dd> - <dt>{{.i18n.Tr "admin.config.run_mode"}}</dt> + <dt>{{.locale.Tr "admin.config.run_mode"}}</dt> <dd>{{.RunMode}}</dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.config.git_version"}}</dt> + <dt>{{.locale.Tr "admin.config.git_version"}}</dt> <dd>{{.GitVersion}}</dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt> + <dt>{{.locale.Tr "admin.config.repo_root_path"}}</dt> <dd>{{.RepoRootPath}}</dd> - <dt>{{.i18n.Tr "admin.config.static_file_root_path"}}</dt> + <dt>{{.locale.Tr "admin.config.static_file_root_path"}}</dt> <dd>{{.StaticRootPath}}</dd> - <dt>{{.i18n.Tr "admin.config.custom_file_root_path"}}</dt> + <dt>{{.locale.Tr "admin.config.custom_file_root_path"}}</dt> <dd>{{.CustomRootPath}}</dd> - <dt>{{.i18n.Tr "admin.config.log_file_root_path"}}</dt> + <dt>{{.locale.Tr "admin.config.log_file_root_path"}}</dt> <dd>{{.LogRootPath}}</dd> - <dt>{{.i18n.Tr "admin.config.script_type"}}</dt> + <dt>{{.locale.Tr "admin.config.script_type"}}</dt> <dd>{{.ScriptType}}</dd> - <dt>{{.i18n.Tr "admin.config.reverse_auth_user"}}</dt> + <dt>{{.locale.Tr "admin.config.reverse_auth_user"}}</dt> <dd>{{.ReverseProxyAuthUser}}</dd> {{if .EnvVars }} @@ -62,33 +62,33 @@ </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.ssh_config"}} + {{.locale.Tr "admin.config.ssh_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.ssh_enabled"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_enabled"}}</dt> <dd>{{if not .SSH.Disabled}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if not .SSH.Disabled}} - <dt>{{.i18n.Tr "admin.config.ssh_start_builtin_server"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_start_builtin_server"}}</dt> <dd>{{if .SSH.StartBuiltinServer}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.ssh_domain"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_domain"}}</dt> <dd>{{.SSH.Domain}}</dd> - <dt>{{.i18n.Tr "admin.config.ssh_port"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_port"}}</dt> <dd>{{.SSH.Port}}</dd> - <dt>{{.i18n.Tr "admin.config.ssh_listen_port"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_listen_port"}}</dt> <dd>{{.SSH.ListenPort}}</dd> {{if not .SSH.StartBuiltinServer}} - <dt>{{.i18n.Tr "admin.config.ssh_root_path"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_root_path"}}</dt> <dd>{{.SSH.RootPath}}</dd> - <dt>{{.i18n.Tr "admin.config.ssh_key_test_path"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_key_test_path"}}</dt> <dd>{{.SSH.KeyTestPath}}</dd> - <dt>{{.i18n.Tr "admin.config.ssh_keygen_path"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_keygen_path"}}</dt> <dd>{{.SSH.KeygenPath}}</dd> - <dt>{{.i18n.Tr "admin.config.ssh_minimum_key_size_check"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_minimum_key_size_check"}}</dt> <dd>{{if .SSH.MinimumKeySizeCheck}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if .SSH.MinimumKeySizeCheck}} - <dt>{{.i18n.Tr "admin.config.ssh_minimum_key_sizes"}}</dt> + <dt>{{.locale.Tr "admin.config.ssh_minimum_key_sizes"}}</dt> <dd>{{.SSH.MinimumKeySizes}}</dd> {{end}} {{end}} @@ -97,304 +97,304 @@ </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.lfs_config"}} + {{.locale.Tr "admin.config.lfs_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.lfs_enabled"}}</dt> + <dt>{{.locale.Tr "admin.config.lfs_enabled"}}</dt> <dd>{{if .LFS.StartServer}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if .LFS.StartServer}} - <dt>{{.i18n.Tr "admin.config.lfs_content_path"}}</dt> + <dt>{{.locale.Tr "admin.config.lfs_content_path"}}</dt> <dd>{{.LFS.Path}}</dd> - <dt>{{.i18n.Tr "admin.config.lfs_http_auth_expiry"}}</dt> + <dt>{{.locale.Tr "admin.config.lfs_http_auth_expiry"}}</dt> <dd>{{.LFS.HTTPAuthExpiry}}</dd> {{end}} </dl> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.db_config"}} + {{.locale.Tr "admin.config.db_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.db_type"}}</dt> + <dt>{{.locale.Tr "admin.config.db_type"}}</dt> <dd>{{.DbCfg.Type}}</dd> {{if not (eq .DbCfg.Type "sqlite3")}} - <dt>{{.i18n.Tr "admin.config.db_host"}}</dt> + <dt>{{.locale.Tr "admin.config.db_host"}}</dt> <dd>{{if .DbCfg.Host}}{{.DbCfg.Host}}{{else}}-{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.db_name"}}</dt> + <dt>{{.locale.Tr "admin.config.db_name"}}</dt> <dd>{{if .DbCfg.Name}}{{.DbCfg.Name}}{{else}}-{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.db_user"}}</dt> + <dt>{{.locale.Tr "admin.config.db_user"}}</dt> <dd>{{if .DbCfg.User}}{{.DbCfg.User}}{{else}}-{{end}}</dd> {{end}} {{if eq .DbCfg.Type "postgres"}} - <dt>{{.i18n.Tr "admin.config.db_schema"}}</dt> + <dt>{{.locale.Tr "admin.config.db_schema"}}</dt> <dd>{{if .DbCfg.Schema}}{{.DbCfg.Schema}}{{else}}-{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.db_ssl_mode"}}</dt> + <dt>{{.locale.Tr "admin.config.db_ssl_mode"}}</dt> <dd>{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}}</dd> {{end}} {{if eq .DbCfg.Type "sqlite3"}} - <dt>{{.i18n.Tr "admin.config.db_path"}}</dt> + <dt>{{.locale.Tr "admin.config.db_path"}}</dt> <dd>{{if .DbCfg.Path}}{{.DbCfg.Path}}{{else}}-{{end}}</dd> {{end}} </dl> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.service_config"}} + {{.locale.Tr "admin.config.service_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.register_email_confirm"}}</dt> + <dt>{{.locale.Tr "admin.config.register_email_confirm"}}</dt> <dd>{{if .Service.RegisterEmailConfirm}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.disable_register"}}</dt> + <dt>{{.locale.Tr "admin.config.disable_register"}}</dt> <dd>{{if .Service.DisableRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.allow_only_internal_registration"}}</dt> + <dt>{{.locale.Tr "admin.config.allow_only_internal_registration"}}</dt> <dd>{{if .Service.AllowOnlyInternalRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.allow_only_external_registration"}}</dt> + <dt>{{.locale.Tr "admin.config.allow_only_external_registration"}}</dt> <dd>{{if .Service.AllowOnlyExternalRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.show_registration_button"}}</dt> + <dt>{{.locale.Tr "admin.config.show_registration_button"}}</dt> <dd>{{if .Service.ShowRegistrationButton}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.enable_openid_signup"}}</dt> + <dt>{{.locale.Tr "admin.config.enable_openid_signup"}}</dt> <dd>{{if .Service.EnableOpenIDSignUp}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.enable_openid_signin"}}</dt> + <dt>{{.locale.Tr "admin.config.enable_openid_signin"}}</dt> <dd>{{if .Service.EnableOpenIDSignIn}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.require_sign_in_view"}}</dt> + <dt>{{.locale.Tr "admin.config.require_sign_in_view"}}</dt> <dd>{{if .Service.RequireSignInView}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.mail_notify"}}</dt> + <dt>{{.locale.Tr "admin.config.mail_notify"}}</dt> <dd>{{if .Service.EnableNotifyMail}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.disable_key_size_check"}}</dt> + <dt>{{.locale.Tr "admin.config.disable_key_size_check"}}</dt> <dd>{{if .SSH.MinimumKeySizeCheck}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.enable_captcha"}}</dt> + <dt>{{.locale.Tr "admin.config.enable_captcha"}}</dt> <dd>{{if .Service.EnableCaptcha}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.default_keep_email_private"}}</dt> + <dt>{{.locale.Tr "admin.config.default_keep_email_private"}}</dt> <dd>{{if .Service.DefaultKeepEmailPrivate}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.default_allow_create_organization"}}</dt> + <dt>{{.locale.Tr "admin.config.default_allow_create_organization"}}</dt> <dd>{{if .Service.DefaultAllowCreateOrganization}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.enable_timetracking"}}</dt> + <dt>{{.locale.Tr "admin.config.enable_timetracking"}}</dt> <dd>{{if .Service.EnableTimetracking}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if .Service.EnableTimetracking}} - <dt>{{.i18n.Tr "admin.config.default_enable_timetracking"}}</dt> + <dt>{{.locale.Tr "admin.config.default_enable_timetracking"}}</dt> <dd>{{if .Service.DefaultEnableTimetracking}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.default_allow_only_contributors_to_track_time"}}</dt> + <dt>{{.locale.Tr "admin.config.default_allow_only_contributors_to_track_time"}}</dt> <dd>{{if .Service.DefaultAllowOnlyContributorsToTrackTime}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{end}} - <dt>{{.i18n.Tr "admin.config.default_visibility_organization"}}</dt> + <dt>{{.locale.Tr "admin.config.default_visibility_organization"}}</dt> <dd>{{.Service.DefaultOrgVisibility}}</dd> - <dt>{{.i18n.Tr "admin.config.no_reply_address"}}</dt> + <dt>{{.locale.Tr "admin.config.no_reply_address"}}</dt> <dd>{{if .Service.NoReplyAddress}}{{.Service.NoReplyAddress}}{{else}}-{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.default_enable_dependencies"}}</dt> + <dt>{{.locale.Tr "admin.config.default_enable_dependencies"}}</dt> <dd>{{if .Service.DefaultEnableDependencies}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.config.active_code_lives"}}</dt> - <dd>{{.Service.ActiveCodeLives}} {{.i18n.Tr "tool.raw_minutes"}}</dd> - <dt>{{.i18n.Tr "admin.config.reset_password_code_lives"}}</dt> - <dd>{{.Service.ResetPwdCodeLives}} {{.i18n.Tr "tool.raw_minutes"}}</dd> + <dt>{{.locale.Tr "admin.config.active_code_lives"}}</dt> + <dd>{{.Service.ActiveCodeLives}} {{.locale.Tr "tool.raw_minutes"}}</dd> + <dt>{{.locale.Tr "admin.config.reset_password_code_lives"}}</dt> + <dd>{{.Service.ResetPwdCodeLives}} {{.locale.Tr "tool.raw_minutes"}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.webhook_config"}} + {{.locale.Tr "admin.config.webhook_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.queue_length"}}</dt> + <dt>{{.locale.Tr "admin.config.queue_length"}}</dt> <dd>{{.Webhook.QueueLength}}</dd> - <dt>{{.i18n.Tr "admin.config.deliver_timeout"}}</dt> - <dd>{{.Webhook.DeliverTimeout}} {{.i18n.Tr "tool.raw_seconds"}}</dd> - <dt>{{.i18n.Tr "admin.config.skip_tls_verify"}}</dt> + <dt>{{.locale.Tr "admin.config.deliver_timeout"}}</dt> + <dd>{{.Webhook.DeliverTimeout}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.skip_tls_verify"}}</dt> <dd>{{if .Webhook.SkipTLSVerify}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.mailer_config"}} + {{.locale.Tr "admin.config.mailer_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.mailer_enabled"}}</dt> + <dt>{{.locale.Tr "admin.config.mailer_enabled"}}</dt> <dd>{{if .MailerEnabled}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{if .MailerEnabled}} - <dt>{{.i18n.Tr "admin.config.mailer_name"}}</dt> + <dt>{{.locale.Tr "admin.config.mailer_name"}}</dt> <dd>{{.Mailer.Name}}</dd> {{if eq .Mailer.MailerType "smtp"}} - <dt>{{.i18n.Tr "admin.config.mailer_disable_helo"}}</dt> + <dt>{{.locale.Tr "admin.config.mailer_disable_helo"}}</dt> <dd>{{if .DisableHelo}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.mailer_host"}}</dt> + <dt>{{.locale.Tr "admin.config.mailer_host"}}</dt> <dd>{{.Mailer.Host}}</dd> {{else if eq .Mailer.MailerType "sendmail"}} - <dt>{{.i18n.Tr "admin.config.mailer_use_sendmail"}}</dt> + <dt>{{.locale.Tr "admin.config.mailer_use_sendmail"}}</dt> <dd>{{svg "octicon-check"}}</dd> - <dt>{{.i18n.Tr "admin.config.mailer_sendmail_path"}}</dt> + <dt>{{.locale.Tr "admin.config.mailer_sendmail_path"}}</dt> <dd>{{.Mailer.SendmailPath}}</dd> - <dt>{{.i18n.Tr "admin.config.mailer_sendmail_args"}}</dt> + <dt>{{.locale.Tr "admin.config.mailer_sendmail_args"}}</dt> <dd>{{.Mailer.SendmailArgs}}</dd> - <dt>{{.i18n.Tr "admin.config.mailer_sendmail_timeout"}}</dt> - <dd>{{.Mailer.SendmailTimeout}} {{.i18n.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.mailer_sendmail_timeout"}}</dt> + <dd>{{.Mailer.SendmailTimeout}} {{.locale.Tr "tool.raw_seconds"}}</dd> {{end}} - <dt>{{.i18n.Tr "admin.config.mailer_user"}}</dt> + <dt>{{.locale.Tr "admin.config.mailer_user"}}</dt> <dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd><br> <form class="ui form ignore-dirty" action="{{AppSubUrl}}/admin/config/test_mail" method="post"> {{.CsrfTokenHtml}} <div class="inline field ui left"> <div class="ui input"> - <input type="email" name="email" placeholder="{{.i18n.Tr "admin.config.test_email_placeholder"}}" size="29" required> + <input type="email" name="email" placeholder="{{.locale.Tr "admin.config.test_email_placeholder"}}" size="29" required> </div> </div> - <button class="ui green button" id="test-mail-btn">{{.i18n.Tr "admin.config.send_test_mail"}}</button> + <button class="ui green button" id="test-mail-btn">{{.locale.Tr "admin.config.send_test_mail"}}</button> </form> {{end}} </dl> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.cache_config"}} + {{.locale.Tr "admin.config.cache_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.cache_adapter"}}</dt> + <dt>{{.locale.Tr "admin.config.cache_adapter"}}</dt> <dd>{{.CacheAdapter}}</dd> {{if eq .CacheAdapter "memory"}} - <dt>{{.i18n.Tr "admin.config.cache_interval"}}</dt> - <dd>{{.CacheInterval}} {{.i18n.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.cache_interval"}}</dt> + <dd>{{.CacheInterval}} {{.locale.Tr "tool.raw_seconds"}}</dd> {{end}} {{if .CacheConn}} - <dt>{{.i18n.Tr "admin.config.cache_conn"}}</dt> + <dt>{{.locale.Tr "admin.config.cache_conn"}}</dt> <dd><code>{{.CacheConn}}</code></dd> - <dt>{{.i18n.Tr "admin.config.cache_item_ttl"}}</dt> + <dt>{{.locale.Tr "admin.config.cache_item_ttl"}}</dt> <dd><code>{{.CacheItemTTL}}</code></dd> {{end}} </dl> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.session_config"}} + {{.locale.Tr "admin.config.session_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.session_provider"}}</dt> + <dt>{{.locale.Tr "admin.config.session_provider"}}</dt> <dd>{{.SessionConfig.Provider}}</dd> - <dt>{{.i18n.Tr "admin.config.provider_config"}}</dt> + <dt>{{.locale.Tr "admin.config.provider_config"}}</dt> <dd><code>{{if .SessionConfig.ProviderConfig}}{{.SessionConfig.ProviderConfig}}{{else}}-{{end}}</code></dd> - <dt>{{.i18n.Tr "admin.config.cookie_name"}}</dt> + <dt>{{.locale.Tr "admin.config.cookie_name"}}</dt> <dd>{{.SessionConfig.CookieName}}</dd> - <dt>{{.i18n.Tr "admin.config.gc_interval_time"}}</dt> - <dd>{{.SessionConfig.Gclifetime}} {{.i18n.Tr "tool.raw_seconds"}}</dd> - <dt>{{.i18n.Tr "admin.config.session_life_time"}}</dt> - <dd>{{.SessionConfig.Maxlifetime}} {{.i18n.Tr "tool.raw_seconds"}}</dd> - <dt>{{.i18n.Tr "admin.config.https_only"}}</dt> + <dt>{{.locale.Tr "admin.config.gc_interval_time"}}</dt> + <dd>{{.SessionConfig.Gclifetime}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.session_life_time"}}</dt> + <dd>{{.SessionConfig.Maxlifetime}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.https_only"}}</dt> <dd>{{if .SessionConfig.Secure}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.picture_config"}} + {{.locale.Tr "admin.config.picture_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.disable_gravatar"}}</dt> + <dt>{{.locale.Tr "admin.config.disable_gravatar"}}</dt> <dd>{{if .DisableGravatar}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.config.enable_federated_avatar"}}</dt> + <dt>{{.locale.Tr "admin.config.enable_federated_avatar"}}</dt> <dd>{{if .EnableFederatedAvatar}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.git_config"}} + {{.locale.Tr "admin.config.git_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.config.git_disable_diff_highlight"}}</dt> + <dt>{{.locale.Tr "admin.config.git_disable_diff_highlight"}}</dt> <dd>{{if .Git.DisableDiffHighlight}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> - <dt>{{.i18n.Tr "admin.config.git_max_diff_lines"}}</dt> + <dt>{{.locale.Tr "admin.config.git_max_diff_lines"}}</dt> <dd>{{.Git.MaxGitDiffLines}}</dd> - <dt>{{.i18n.Tr "admin.config.git_max_diff_line_characters"}}</dt> + <dt>{{.locale.Tr "admin.config.git_max_diff_line_characters"}}</dt> <dd>{{.Git.MaxGitDiffLineCharacters}}</dd> - <dt>{{.i18n.Tr "admin.config.git_max_diff_files"}}</dt> + <dt>{{.locale.Tr "admin.config.git_max_diff_files"}}</dt> <dd>{{.Git.MaxGitDiffFiles}}</dd> - <dt>{{.i18n.Tr "admin.config.git_gc_args"}}</dt> + <dt>{{.locale.Tr "admin.config.git_gc_args"}}</dt> <dd><code>{{.Git.GCArgs}}</code></dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.config.git_migrate_timeout"}}</dt> - <dd>{{.Git.Timeout.Migrate}} {{.i18n.Tr "tool.raw_seconds"}}</dd> - <dt>{{.i18n.Tr "admin.config.git_mirror_timeout"}}</dt> - <dd>{{.Git.Timeout.Mirror}} {{.i18n.Tr "tool.raw_seconds"}}</dd> - <dt>{{.i18n.Tr "admin.config.git_clone_timeout"}}</dt> - <dd>{{.Git.Timeout.Clone}} {{.i18n.Tr "tool.raw_seconds"}}</dd> - <dt>{{.i18n.Tr "admin.config.git_pull_timeout"}}</dt> - <dd>{{.Git.Timeout.Pull}} {{.i18n.Tr "tool.raw_seconds"}}</dd> - <dt>{{.i18n.Tr "admin.config.git_gc_timeout"}}</dt> - <dd>{{.Git.Timeout.GC}} {{.i18n.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.git_migrate_timeout"}}</dt> + <dd>{{.Git.Timeout.Migrate}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.git_mirror_timeout"}}</dt> + <dd>{{.Git.Timeout.Mirror}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.git_clone_timeout"}}</dt> + <dd>{{.Git.Timeout.Clone}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.git_pull_timeout"}}</dt> + <dd>{{.Git.Timeout.Pull}} {{.locale.Tr "tool.raw_seconds"}}</dd> + <dt>{{.locale.Tr "admin.config.git_gc_timeout"}}</dt> + <dd>{{.Git.Timeout.GC}} {{.locale.Tr "tool.raw_seconds"}}</dd> </dl> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.config.log_config"}} + {{.locale.Tr "admin.config.log_config"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> {{range .Loggers.default.SubLogDescriptions}} - <dt>{{$.i18n.Tr "admin.config.log_mode"}}</dt> + <dt>{{$.locale.Tr "admin.config.log_mode"}}</dt> <dd>{{.Name}} ({{.Provider}})</dd> - <dt>{{$.i18n.Tr "admin.config.log_config"}}</dt> + <dt>{{$.locale.Tr "admin.config.log_config"}}</dt> <dd><pre>{{.Config | JsonPrettyPrint}}</pre></dd> {{end}} <div class="ui divider"></div> - <dt>{{$.i18n.Tr "admin.config.router_log_mode"}}</dt> + <dt>{{$.locale.Tr "admin.config.router_log_mode"}}</dt> {{if .DisableRouterLog}} - <dd>{{$.i18n.Tr "admin.config.disabled_logger"}}</dd> + <dd>{{$.locale.Tr "admin.config.disabled_logger"}}</dd> {{else}} {{if .Loggers.router.SubLogDescriptions}} - <dd>{{$.i18n.Tr "admin.config.own_named_logger"}}</dd> + <dd>{{$.locale.Tr "admin.config.own_named_logger"}}</dd> {{range .Loggers.router.SubLogDescriptions}} - <dt>{{$.i18n.Tr "admin.config.log_mode"}}</dt> + <dt>{{$.locale.Tr "admin.config.log_mode"}}</dt> <dd>{{.Name}} ({{.Provider}})</dd> - <dt>{{$.i18n.Tr "admin.config.log_config"}}</dt> + <dt>{{$.locale.Tr "admin.config.log_config"}}</dt> <dd><pre>{{.Config | JsonPrettyPrint}}</pre></dd> {{end}} {{else}} - <dd>{{$.i18n.Tr "admin.config.routes_to_default_logger"}}</dd> + <dd>{{$.locale.Tr "admin.config.routes_to_default_logger"}}</dd> {{end}} {{end}} <div class="ui divider"></div> - <dt>{{$.i18n.Tr "admin.config.access_log_mode"}}</dt> + <dt>{{$.locale.Tr "admin.config.access_log_mode"}}</dt> {{if .EnableAccessLog}} {{if .Loggers.access.SubLogDescriptions}} - <dd>{{$.i18n.Tr "admin.config.own_named_logger"}}</dd> + <dd>{{$.locale.Tr "admin.config.own_named_logger"}}</dd> {{range .Loggers.access.SubLogDescriptions}} - <dt>{{$.i18n.Tr "admin.config.log_mode"}}</dt> + <dt>{{$.locale.Tr "admin.config.log_mode"}}</dt> <dd>{{.Name}} ({{.Provider}})</dd> - <dt>{{$.i18n.Tr "admin.config.log_config"}}</dt> + <dt>{{$.locale.Tr "admin.config.log_config"}}</dt> <dd><pre>{{.Config | JsonPrettyPrint}}</pre></dd> {{end}} {{else}} - <dd>{{$.i18n.Tr "admin.config.routes_to_default_logger"}}</dd> + <dd>{{$.locale.Tr "admin.config.routes_to_default_logger"}}</dd> {{end}} - <dt>{{$.i18n.Tr "admin.config.access_log_template"}}</dt> + <dt>{{$.locale.Tr "admin.config.access_log_template"}}</dt> <dd><code>{{$.AccessLogTemplate}}</code></dd> {{else}} - <dd>{{$.i18n.Tr "admin.config.disabled_logger"}}</dd> + <dd>{{$.locale.Tr "admin.config.disabled_logger"}}</dd> {{end}} <div class="ui divider"></div> - <dt>{{$.i18n.Tr "admin.config.xorm_log_mode"}}</dt> + <dt>{{$.locale.Tr "admin.config.xorm_log_mode"}}</dt> {{if .EnableXORMLog}} {{if .Loggers.xorm.SubLogDescriptions}} - <dd>{{$.i18n.Tr "admin.config.own_named_logger"}}</dd> + <dd>{{$.locale.Tr "admin.config.own_named_logger"}}</dd> {{range .Loggers.xorm.SubLogDescriptions}} - <dt>{{$.i18n.Tr "admin.config.log_mode"}}</dt> + <dt>{{$.locale.Tr "admin.config.log_mode"}}</dt> <dd>{{.Name}} ({{.Provider}})</dd> - <dt>{{$.i18n.Tr "admin.config.log_config"}}</dt> + <dt>{{$.locale.Tr "admin.config.log_config"}}</dt> <dd><pre>{{.Config | JsonPrettyPrint}}</pre></dd> {{end}} {{else}} - <dd>{{$.i18n.Tr "admin.config.routes_to_default_logger"}}</dd> + <dd>{{$.locale.Tr "admin.config.routes_to_default_logger"}}</dd> {{end}} - <dt>{{$.i18n.Tr "admin.config.xorm_log_sql"}}</dt> + <dt>{{$.locale.Tr "admin.config.xorm_log_sql"}}</dt> <dd>{{if $.LogSQL}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd> {{else}} - <dd>{{$.i18n.Tr "admin.config.disabled_logger"}}</dd> + <dd>{{$.locale.Tr "admin.config.disabled_logger"}}</dd> {{end}} </dl> </div> diff --git a/templates/admin/cron.tmpl b/templates/admin/cron.tmpl index cf3532c77d..b5db356bd8 100644 --- a/templates/admin/cron.tmpl +++ b/templates/admin/cron.tmpl @@ -1,5 +1,5 @@ <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.cron"}} + {{.locale.Tr "admin.monitor.cron"}} </h4> <div class="ui attached table segment"> <form method="post" action="{{AppSubUrl}}/admin"> @@ -7,24 +7,24 @@ <thead> <tr> <th></th> - <th>{{.i18n.Tr "admin.monitor.name"}}</th> - <th>{{.i18n.Tr "admin.monitor.schedule"}}</th> - <th>{{.i18n.Tr "admin.monitor.next"}}</th> - <th>{{.i18n.Tr "admin.monitor.previous"}}</th> - <th>{{.i18n.Tr "admin.monitor.execute_times"}}</th> - <th>{{.i18n.Tr "admin.monitor.last_execution_result"}}</th> + <th>{{.locale.Tr "admin.monitor.name"}}</th> + <th>{{.locale.Tr "admin.monitor.schedule"}}</th> + <th>{{.locale.Tr "admin.monitor.next"}}</th> + <th>{{.locale.Tr "admin.monitor.previous"}}</th> + <th>{{.locale.Tr "admin.monitor.execute_times"}}</th> + <th>{{.locale.Tr "admin.monitor.last_execution_result"}}</th> </tr> </thead> <tbody> {{range .Entries}} <tr> - <td><button type="submit" class="ui green button" name="op" value="{{.Name}}" title="{{$.i18n.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td> - <td>{{$.i18n.Tr (printf "admin.dashboard.%s" .Name)}}</td> + <td><button type="submit" class="ui green button" name="op" value="{{.Name}}" title="{{$.locale.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td> + <td>{{$.locale.Tr (printf "admin.dashboard.%s" .Name)}}</td> <td>{{.Spec}}</td> <td>{{DateFmtLong .Next}}</td> <td>{{if gt .Prev.Year 1 }}{{DateFmtLong .Prev}}{{else}}N/A{{end}}</td> <td>{{.ExecTimes}}</td> - <td {{if ne .Status ""}}class="tooltip" data-content="{{.FormatLastMessage $.i18n}}"{{end}} >{{if eq .Status "" }}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td> + <td {{if ne .Status ""}}class="tooltip" data-content="{{.FormatLastMessage $.locale}}"{{end}} >{{if eq .Status "" }}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td> </tr> {{end}} </tbody> diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index 5a4b82f1b9..80eea91210 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -5,19 +5,19 @@ {{template "base/alert" .}} {{if .NeedUpdate}} <div class="ui negative message flash-error"> - <p>{{(.i18n.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}</p> + <p>{{(.locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}</p> </div> {{end}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.dashboard.statistic"}} + {{.locale.Tr "admin.dashboard.statistic"}} </h4> <div class="ui attached segment"> <p> - {{.i18n.Tr "admin.dashboard.statistic_info" .Stats.Counter.User .Stats.Counter.Org .Stats.Counter.PublicKey .Stats.Counter.Repo .Stats.Counter.Watch .Stats.Counter.Star .Stats.Counter.Action .Stats.Counter.Access .Stats.Counter.Issue .Stats.Counter.Comment .Stats.Counter.Oauth .Stats.Counter.Follow .Stats.Counter.Mirror .Stats.Counter.Release .Stats.Counter.AuthSource .Stats.Counter.Webhook .Stats.Counter.Milestone .Stats.Counter.Label .Stats.Counter.HookTask .Stats.Counter.Team .Stats.Counter.UpdateTask .Stats.Counter.Attachment | Str2html}} + {{.locale.Tr "admin.dashboard.statistic_info" .Stats.Counter.User .Stats.Counter.Org .Stats.Counter.PublicKey .Stats.Counter.Repo .Stats.Counter.Watch .Stats.Counter.Star .Stats.Counter.Action .Stats.Counter.Access .Stats.Counter.Issue .Stats.Counter.Comment .Stats.Counter.Oauth .Stats.Counter.Follow .Stats.Counter.Mirror .Stats.Counter.Release .Stats.Counter.AuthSource .Stats.Counter.Webhook .Stats.Counter.Milestone .Stats.Counter.Label .Stats.Counter.HookTask .Stats.Counter.Team .Stats.Counter.UpdateTask .Stats.Counter.Attachment | Str2html}} </p> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.dashboard.operations"}} + {{.locale.Tr "admin.dashboard.operations"}} </h4> <form method="post" action="{{AppSubUrl}}/admin"> {{.CsrfTokenHtml}} @@ -25,52 +25,52 @@ <table class="ui very basic table"> <tbody> <tr> - <td>{{.i18n.Tr "admin.dashboard.delete_inactive_accounts"}}</td> - <td><button type="submit" class="ui green button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.delete_inactive_accounts"}}</td> + <td><button type="submit" class="ui green button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.i18n.Tr "admin.dashboard.delete_repo_archives"}}</td> - <td><button type="submit" class="ui green button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.delete_repo_archives"}}</td> + <td><button type="submit" class="ui green button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.i18n.Tr "admin.dashboard.delete_missing_repos"}}</td> - <td><button type="submit" class="ui green button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.delete_missing_repos"}}</td> + <td><button type="submit" class="ui green button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.i18n.Tr "admin.dashboard.git_gc_repos"}}</td> - <td><button type="submit" class="ui green button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.git_gc_repos"}}</td> + <td><button type="submit" class="ui green button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}} <tr> - <td>{{.i18n.Tr "admin.dashboard.resync_all_sshkeys"}}<br/> - {{.i18n.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td> - <td><button type="submit" class="ui green button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.resync_all_sshkeys"}}<br/> + {{.locale.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td> + <td><button type="submit" class="ui green button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.i18n.Tr "admin.dashboard.resync_all_sshprincipals"}}<br/> - {{.i18n.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td> - <td><button type="submit" class="ui green button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.resync_all_sshprincipals"}}<br/> + {{.locale.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td> + <td><button type="submit" class="ui green button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> {{end}} <tr> - <td>{{.i18n.Tr "admin.dashboard.resync_all_hooks"}}</td> - <td><button type="submit" class="ui green button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.resync_all_hooks"}}</td> + <td><button type="submit" class="ui green button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.i18n.Tr "admin.dashboard.reinit_missing_repos"}}</td> - <td><button type="submit" class="ui green button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.reinit_missing_repos"}}</td> + <td><button type="submit" class="ui green button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.i18n.Tr "admin.dashboard.sync_external_users"}}</td> - <td><button type="submit" class="ui green button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.sync_external_users"}}</td> + <td><button type="submit" class="ui green button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.i18n.Tr "admin.dashboard.repo_health_check"}}</td> - <td><button type="submit" class="ui green button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.repo_health_check"}}</td> + <td><button type="submit" class="ui green button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> <tr> - <td>{{.i18n.Tr "admin.dashboard.delete_generated_repository_avatars"}}</td> - <td><button type="submit" class="ui green button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{.i18n.Tr "admin.dashboard.operation_run"}}</button></td> + <td>{{.locale.Tr "admin.dashboard.delete_generated_repository_avatars"}}</td> + <td><button type="submit" class="ui green button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td> </tr> </tbody> </table> @@ -78,69 +78,69 @@ </form> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.dashboard.system_status"}} + {{.locale.Tr "admin.dashboard.system_status"}} </h4> <div class="ui attached table segment"> <dl class="dl-horizontal admin-dl-horizontal"> - <dt>{{.i18n.Tr "admin.dashboard.server_uptime"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.server_uptime"}}</dt> <dd>{{.SysStatus.Uptime}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.current_goroutine"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.current_goroutine"}}</dt> <dd>{{.SysStatus.NumGoroutine}}</dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.dashboard.current_memory_usage"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.current_memory_usage"}}</dt> <dd>{{.SysStatus.MemAllocated}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.total_memory_allocated"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.total_memory_allocated"}}</dt> <dd>{{.SysStatus.MemTotal}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.memory_obtained"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.memory_obtained"}}</dt> <dd>{{.SysStatus.MemSys}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.pointer_lookup_times"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.pointer_lookup_times"}}</dt> <dd>{{.SysStatus.Lookups}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.memory_allocate_times"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.memory_allocate_times"}}</dt> <dd>{{.SysStatus.MemMallocs}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.memory_free_times"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.memory_free_times"}}</dt> <dd>{{.SysStatus.MemFrees}}</dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.dashboard.current_heap_usage"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.current_heap_usage"}}</dt> <dd>{{.SysStatus.HeapAlloc}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.heap_memory_obtained"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.heap_memory_obtained"}}</dt> <dd>{{.SysStatus.HeapSys}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.heap_memory_idle"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.heap_memory_idle"}}</dt> <dd>{{.SysStatus.HeapIdle}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.heap_memory_in_use"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.heap_memory_in_use"}}</dt> <dd>{{.SysStatus.HeapInuse}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.heap_memory_released"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.heap_memory_released"}}</dt> <dd>{{.SysStatus.HeapReleased}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.heap_objects"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.heap_objects"}}</dt> <dd>{{.SysStatus.HeapObjects}}</dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.dashboard.bootstrap_stack_usage"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.bootstrap_stack_usage"}}</dt> <dd>{{.SysStatus.StackInuse}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.stack_memory_obtained"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.stack_memory_obtained"}}</dt> <dd>{{.SysStatus.StackSys}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.mspan_structures_usage"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.mspan_structures_usage"}}</dt> <dd>{{.SysStatus.MSpanInuse}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.mspan_structures_obtained"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.mspan_structures_obtained"}}</dt> <dd>{{.SysStatus.MSpanSys}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.mcache_structures_usage"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.mcache_structures_usage"}}</dt> <dd>{{.SysStatus.MCacheInuse}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.mcache_structures_obtained"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.mcache_structures_obtained"}}</dt> <dd>{{.SysStatus.MCacheSys}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}</dt> <dd>{{.SysStatus.BuckHashSys}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.gc_metadata_obtained"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.gc_metadata_obtained"}}</dt> <dd>{{.SysStatus.GCSys}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.other_system_allocation_obtained"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.other_system_allocation_obtained"}}</dt> <dd>{{.SysStatus.OtherSys}}</dd> <div class="ui divider"></div> - <dt>{{.i18n.Tr "admin.dashboard.next_gc_recycle"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.next_gc_recycle"}}</dt> <dd>{{.SysStatus.NextGC}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.last_gc_time"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.last_gc_time"}}</dt> <dd>{{.SysStatus.LastGC}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.total_gc_pause"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.total_gc_pause"}}</dt> <dd>{{.SysStatus.PauseTotalNs}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.last_gc_pause"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.last_gc_pause"}}</dt> <dd>{{.SysStatus.PauseNs}}</dd> - <dt>{{.i18n.Tr "admin.dashboard.gc_times"}}</dt> + <dt>{{.locale.Tr "admin.dashboard.gc_times"}}</dt> <dd>{{.SysStatus.NumGC}}</dd> </dl> </div> diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl index 92444efbd8..adf5b9bef7 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -4,28 +4,28 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.emails.email_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}) + {{.locale.Tr "admin.emails.email_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) </h4> <div class="ui attached segment"> <div class="ui right floated secondary filter menu"> <!-- Sort --> <div class="ui dropdown type jump item"> <span class="text"> - {{.i18n.Tr "repo.issues.filter_sort"}} + {{.locale.Tr "repo.issues.filter_sort"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} </span> <div class="menu"> - <a class="{{if or (eq .SortType "email") (not .SortType)}}active{{end}} item" href="{{$.Link}}?sort=email&q={{$.Keyword}}">{{.i18n.Tr "admin.emails.filter_sort.email"}}</a> - <a class="{{if eq .SortType "reverseemail"}}active{{end}} item" href="{{$.Link}}?sort=reverseemail&q={{$.Keyword}}">{{.i18n.Tr "admin.emails.filter_sort.email_reverse"}}</a> - <a class="{{if eq .SortType "username"}}active{{end}} item" href="{{$.Link}}?sort=username&q={{$.Keyword}}">{{.i18n.Tr "admin.emails.filter_sort.name"}}</a> - <a class="{{if eq .SortType "reverseusername"}}active{{end}} item" href="{{$.Link}}?sort=reverseusername&q={{$.Keyword}}">{{.i18n.Tr "admin.emails.filter_sort.name_reverse"}}</a> + <a class="{{if or (eq .SortType "email") (not .SortType)}}active{{end}} item" href="{{$.Link}}?sort=email&q={{$.Keyword}}">{{.locale.Tr "admin.emails.filter_sort.email"}}</a> + <a class="{{if eq .SortType "reverseemail"}}active{{end}} item" href="{{$.Link}}?sort=reverseemail&q={{$.Keyword}}">{{.locale.Tr "admin.emails.filter_sort.email_reverse"}}</a> + <a class="{{if eq .SortType "username"}}active{{end}} item" href="{{$.Link}}?sort=username&q={{$.Keyword}}">{{.locale.Tr "admin.emails.filter_sort.name"}}</a> + <a class="{{if eq .SortType "reverseusername"}}active{{end}} item" href="{{$.Link}}?sort=reverseusername&q={{$.Keyword}}">{{.locale.Tr "admin.emails.filter_sort.name_reverse"}}</a> </div> </div> </div> <form class="ui form ignore-dirty" style="max-width: 90%"> <div class="ui fluid action input"> - <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus> - <button class="ui primary button">{{.i18n.Tr "explore.search"}}</button> + <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}..." autofocus> + <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> </div> </form> </div> @@ -34,16 +34,16 @@ <thead> <tr> <th data-sortt-asc="username" data-sortt-desc="reverseusername"> - {{.i18n.Tr "admin.users.name"}} + {{.locale.Tr "admin.users.name"}} {{SortArrow "username" "reverseusername" $.SortType false}} </th> - <th>{{.i18n.Tr "admin.users.full_name"}}</th> + <th>{{.locale.Tr "admin.users.full_name"}}</th> <th data-sortt-asc="email" data-sortt-desc="reverseemail" data-sortt-default="true"> - {{.i18n.Tr "email"}} + {{.locale.Tr "email"}} {{SortArrow "email" "reverseemail" $.SortType true}} </th> - <th>{{.i18n.Tr "admin.emails.primary"}}</th> - <th>{{.i18n.Tr "admin.emails.activated"}}</th> + <th>{{.locale.Tr "admin.emails.primary"}}</th> + <th>{{.locale.Tr "admin.emails.activated"}}</th> </tr> </thead> <tbody> @@ -75,10 +75,10 @@ <div class="ui basic modal" id="change-email-modal"> <div class="ui icon header"> - {{.i18n.Tr "admin.emails.change_email_header"}} + {{.locale.Tr "admin.emails.change_email_header"}} </div> <div class="content center"> - <p>{{.i18n.Tr "admin.emails.change_email_text"}}</p> + <p>{{.locale.Tr "admin.emails.change_email_text"}}</p> <form class="ui form" id="email-action-form" action="{{AppSubUrl}}/admin/emails/activate" method="post"> {{$.CsrfTokenHtml}} @@ -94,8 +94,8 @@ <input type="hidden" id="form-activate" name="activate" value="" required> <div class="center actions"> - <div class="ui basic cancel inverted button">{{$.i18n.Tr "settings.cancel"}}</div> - <button class="ui basic inverted yellow button">{{$.i18n.Tr "modal.yes"}}</button> + <div class="ui basic cancel inverted button">{{$.locale.Tr "settings.cancel"}}</div> + <button class="ui basic inverted yellow button">{{$.locale.Tr "modal.yes"}}</button> </div> </form> diff --git a/templates/admin/hook_new.tmpl b/templates/admin/hook_new.tmpl index 049e54ef83..c5196fce4e 100644 --- a/templates/admin/hook_new.tmpl +++ b/templates/admin/hook_new.tmpl @@ -5,13 +5,13 @@ {{template "base/alert" .}} <h4 class="ui top attached header"> {{if .PageIsAdminDefaultHooksNew}} - {{.i18n.Tr "admin.defaulthooks.add_webhook"}} + {{.locale.Tr "admin.defaulthooks.add_webhook"}} {{else if .PageIsAdminSystemHooksNew}} - {{.i18n.Tr "admin.systemhooks.add_webhook"}} + {{.locale.Tr "admin.systemhooks.add_webhook"}} {{else if .Webhook.IsSystemWebhook}} - {{.i18n.Tr "admin.systemhooks.update_webhook"}} + {{.locale.Tr "admin.systemhooks.update_webhook"}} {{else}} - {{.i18n.Tr "admin.defaulthooks.update_webhook"}} + {{.locale.Tr "admin.defaulthooks.update_webhook"}} {{end}} <div class="ui right"> {{if eq .HookType "gitea"}} diff --git a/templates/admin/monitor.tmpl b/templates/admin/monitor.tmpl index 86686101ac..f11d071ea4 100644 --- a/templates/admin/monitor.tmpl +++ b/templates/admin/monitor.tmpl @@ -5,17 +5,17 @@ {{template "base/alert" .}} {{template "admin/cron" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queues"}} + {{.locale.Tr "admin.monitor.queues"}} </h4> <div class="ui attached table segment"> <table class="ui very basic striped table unstackable"> <thead> <tr> - <th>{{.i18n.Tr "admin.monitor.queue.name"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.type"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.exemplar"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.numberworkers"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.numberinqueue"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.name"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.type"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.exemplar"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.numberworkers"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.numberinqueue"}}</th> <th></th> </tr> </thead> @@ -27,7 +27,7 @@ <td>{{.ExemplarType}}</td> <td>{{$sum := .NumberOfWorkers}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td> <td>{{$sum := .NumberInQueue}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td> - <td><a href="{{$.Link}}/queue/{{.QID}}" class="button">{{if lt $sum 0}}{{$.i18n.Tr "admin.monitor.queue.review"}}{{else}}{{$.i18n.Tr "admin.monitor.queue.review_add"}}{{end}}</a> + <td><a href="{{$.Link}}/queue/{{.QID}}" class="button">{{if lt $sum 0}}{{$.locale.Tr "admin.monitor.queue.review"}}{{else}}{{$.locale.Tr "admin.monitor.queue.review_add"}}{{end}}</a> </tr> {{end}} </tbody> @@ -40,11 +40,11 @@ <div class="ui small basic delete modal"> <div class="ui icon header"> {{svg "octicon-x" 16 "close inside"}} - {{.i18n.Tr "admin.monitor.process.cancel"}} + {{.locale.Tr "admin.monitor.process.cancel"}} </div> <div class="content"> - <p>{{$.i18n.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p> - <p>{{$.i18n.Tr "admin.monitor.process.cancel_desc"}}</p> + <p>{{$.locale.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p> + <p>{{$.locale.Tr "admin.monitor.process.cancel_desc"}}</p> </div> {{template "base/delete_modal_actions" .}} </div> diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl index 24a0a093a6..0db1aab079 100644 --- a/templates/admin/navbar.tmpl +++ b/templates/admin/navbar.tmpl @@ -1,39 +1,39 @@ <div class="ui secondary pointing tabular top attached borderless menu stackable new-menu navbar"> <div class="new-menu-inner"> <a class="{{if .PageIsAdminDashboard}}active{{end}} item" href="{{AppSubUrl}}/admin"> - {{.i18n.Tr "admin.dashboard"}} + {{.locale.Tr "admin.dashboard"}} </a> <a class="{{if .PageIsAdminUsers}}active{{end}} item" href="{{AppSubUrl}}/admin/users"> - {{.i18n.Tr "admin.users"}} + {{.locale.Tr "admin.users"}} </a> <a class="{{if .PageIsAdminOrganizations}}active{{end}} item" href="{{AppSubUrl}}/admin/orgs"> - {{.i18n.Tr "admin.organizations"}} + {{.locale.Tr "admin.organizations"}} </a> <a class="{{if .PageIsAdminRepositories}}active{{end}} item" href="{{AppSubUrl}}/admin/repos"> - {{.i18n.Tr "admin.repositories"}} + {{.locale.Tr "admin.repositories"}} </a> <a class="{{if .PageIsAdminPackages}}active{{end}} item" href="{{AppSubUrl}}/admin/packages"> - {{.i18n.Tr "packages.title"}} + {{.locale.Tr "packages.title"}} </a> {{if not DisableWebhooks}} <a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/hooks"> - {{.i18n.Tr "admin.hooks"}} + {{.locale.Tr "admin.hooks"}} </a> {{end}} <a class="{{if .PageIsAdminAuthentications}}active{{end}} item" href="{{AppSubUrl}}/admin/auths"> - {{.i18n.Tr "admin.authentication"}} + {{.locale.Tr "admin.authentication"}} </a> <a class="{{if .PageIsAdminEmails}}active{{end}} item" href="{{AppSubUrl}}/admin/emails"> - {{.i18n.Tr "admin.emails"}} + {{.locale.Tr "admin.emails"}} </a> <a class="{{if .PageIsAdminConfig}}active{{end}} item" href="{{AppSubUrl}}/admin/config"> - {{.i18n.Tr "admin.config"}} + {{.locale.Tr "admin.config"}} </a> <a class="{{if .PageIsAdminNotices}}active{{end}} item" href="{{AppSubUrl}}/admin/notices"> - {{.i18n.Tr "admin.notices"}} + {{.locale.Tr "admin.notices"}} </a> <a class="{{if .PageIsAdminMonitor}}active{{end}} item" href="{{AppSubUrl}}/admin/monitor"> - {{.i18n.Tr "admin.monitor"}} + {{.locale.Tr "admin.monitor"}} </a> </div> </div> diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index 8d0e1c2206..7d0fa0019a 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -4,7 +4,7 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.notices.system_notice_list"}} ({{.i18n.Tr "admin.total" .Total}}) + {{.locale.Tr "admin.notices.system_notice_list"}} ({{.locale.Tr "admin.total" .Total}}) </h4> <div class="ui attached table segment"> <table id="notice-table" class="ui very basic select selectable table unstackable"> @@ -12,10 +12,10 @@ <tr> <th></th> <th>ID</th> - <th>{{.i18n.Tr "admin.notices.type"}}</th> - <th>{{.i18n.Tr "admin.notices.desc"}}</th> - <th width="100px">{{.i18n.Tr "admin.users.created"}}</th> - <th>{{.i18n.Tr "admin.notices.op"}}</th> + <th>{{.locale.Tr "admin.notices.type"}}</th> + <th>{{.locale.Tr "admin.notices.desc"}}</th> + <th width="100px">{{.locale.Tr "admin.users.created"}}</th> + <th>{{.locale.Tr "admin.notices.op"}}</th> </tr> </thead> <tbody> @@ -27,7 +27,7 @@ </div> </td> <td>{{.ID}}</td> - <td>{{$.i18n.Tr .TrStr}}</td> + <td>{{$.locale.Tr .TrStr}}</td> <td class="view-detail"><span class="notice-description text truncate">{{.Description}}</span></td> <td><span class="notice-created-time tooltip" data-content="{{.CreatedUnix.AsTime}}">{{.CreatedUnix.FormatShort}}</span></td> <td><a href="#">{{svg "octicon-note" 16 "view-detail"}}</a></td> @@ -42,25 +42,25 @@ <div class="ui right"> <form method="post" action="{{AppSubUrl}}/admin/notices/empty"> {{.CsrfTokenHtml}} - <button type="submit" class="ui red small button">{{.i18n.Tr "admin.notices.delete_all"}}</button> + <button type="submit" class="ui red small button">{{.locale.Tr "admin.notices.delete_all"}}</button> </form> </div> <div class="ui floating upward dropdown small button"> - <span class="text">{{.i18n.Tr "admin.notices.actions"}}</span> + <span class="text">{{.locale.Tr "admin.notices.actions"}}</span> <div class="menu"> <div class="item select action" data-action="select-all"> - {{.i18n.Tr "admin.notices.select_all"}} + {{.locale.Tr "admin.notices.select_all"}} </div> <div class="item select action" data-action="deselect-all"> - {{.i18n.Tr "admin.notices.deselect_all"}} + {{.locale.Tr "admin.notices.deselect_all"}} </div> <div class="item select action" data-action="inverse"> - {{.i18n.Tr "admin.notices.inverse_selection"}} + {{.locale.Tr "admin.notices.inverse_selection"}} </div> </div> </div> <div class="ui small teal button" id="delete-selection" data-link="{{.Link}}/delete" data-redirect="{{.Link}}?page={{.Page.Paginater.Current}}"> - {{.i18n.Tr "admin.notices.delete_selected"}} + {{.locale.Tr "admin.notices.delete_selected"}} </div> </th> </tr> @@ -75,7 +75,7 @@ <div class="ui modal admin" id="detail-modal"> {{svg "octicon-x" 16 "close inside"}} - <div class="header">{{$.i18n.Tr "admin.notices.view_detail_header"}}</div> + <div class="header">{{$.locale.Tr "admin.notices.view_detail_header"}}</div> <div class="content"> <div class="sub header"></div> <pre></pre> diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index 1cfd3e79e1..aec3f2c841 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -4,9 +4,9 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.orgs.org_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}) + {{.locale.Tr "admin.orgs.org_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{.i18n.Tr "admin.orgs.new_orga"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{.locale.Tr "admin.orgs.new_orga"}}</a> </div> </h4> <div class="ui attached segment"> @@ -18,17 +18,17 @@ <tr> <th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" $.SortType false}}</th> <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically" data-sortt-default="true"> - {{.i18n.Tr "admin.orgs.name"}} + {{.locale.Tr "admin.orgs.name"}} {{SortArrow "alphabetically" "reversealphabetically" $.SortType true}} </th> - <th>{{.i18n.Tr "admin.orgs.teams"}}</th> - <th>{{.i18n.Tr "admin.orgs.members"}}</th> - <th>{{.i18n.Tr "admin.users.repos"}}</th> + <th>{{.locale.Tr "admin.orgs.teams"}}</th> + <th>{{.locale.Tr "admin.orgs.members"}}</th> + <th>{{.locale.Tr "admin.users.repos"}}</th> <th data-sortt-asc="recentupdate" data-sortt-desc="leastupdate"> - {{.i18n.Tr "admin.users.created"}} + {{.locale.Tr "admin.users.created"}} {{SortArrow "recentupdate" "leastupdate" $.SortType false}} </th> - <th>{{.i18n.Tr "admin.users.edit"}}</th> + <th>{{.locale.Tr "admin.users.edit"}}</th> </tr> </thead> <tbody> diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index 6b19c09a1e..18e8c5fed8 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -4,15 +4,15 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.packages.package_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}, {{.i18n.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}}) + {{.locale.Tr "admin.packages.package_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}, {{.locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}}) </h4> <div class="ui attached segment"> <form class="ui form ignore-dirty"> <div class="ui fluid action input"> - <input name="q" value="{{.Query}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus> + <input name="q" value="{{.Query}}" placeholder="{{.locale.Tr "explore.search"}}..." autofocus> <select class="ui dropdown" name="type"> - <option value="">{{.i18n.Tr "packages.filter.type"}}</option> - <option value="all">{{.i18n.Tr "packages.filter.type.all"}}</option> + <option value="">{{.locale.Tr "packages.filter.type"}}</option> + <option value="all">{{.locale.Tr "packages.filter.type.all"}}</option> <option value="composer" {{if eq .PackageType "composer"}}selected="selected"{{end}}>Composer</option> <option value="conan" {{if eq .PackageType "conan"}}selected="selected"{{end}}>Conan</option> <option value="container" {{if eq .PackageType "container"}}selected="selected"{{end}}>Container</option> @@ -24,7 +24,7 @@ <option value="pypi" {{if eq .PackageType "pypi"}}selected="selected"{{end}}>PyPi</option> <option value="rubygems" {{if eq .PackageType "rubygems"}}selected="selected"{{end}}>RubyGems</option> </select> - <button class="ui primary button">{{.i18n.Tr "explore.search"}}</button> + <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> </div> </form> </div> @@ -33,24 +33,24 @@ <thead> <tr> <th>ID</th> - <th>{{.i18n.Tr "admin.packages.owner"}}</th> - <th>{{.i18n.Tr "admin.packages.type"}}</th> + <th>{{.locale.Tr "admin.packages.owner"}}</th> + <th>{{.locale.Tr "admin.packages.type"}}</th> <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically"> - {{.i18n.Tr "admin.packages.name"}} + {{.locale.Tr "admin.packages.name"}} {{SortArrow "alphabetically" "reversealphabetically" .SortType false}} </th> <th data-sortt-asc="highestversion" data-sortt-desc="lowestversion"> - {{.i18n.Tr "admin.packages.version"}} + {{.locale.Tr "admin.packages.version"}} {{SortArrow "highestversion" "lowestversion" .SortType false}} </th> - <th>{{.i18n.Tr "admin.packages.creator"}}</th> - <th>{{.i18n.Tr "admin.packages.repository"}}</th> - <th>{{.i18n.Tr "admin.packages.size"}}</th> + <th>{{.locale.Tr "admin.packages.creator"}}</th> + <th>{{.locale.Tr "admin.packages.repository"}}</th> + <th>{{.locale.Tr "admin.packages.size"}}</th> <th data-sortt-asc="oldest" data-sortt-desc="newest"> - {{.i18n.Tr "admin.packages.published"}} + {{.locale.Tr "admin.packages.published"}} {{SortArrow "oldest" "newest" .SortType true}} </th> - <th>{{.i18n.Tr "admin.notices.op"}}</th> + <th>{{.locale.Tr "admin.notices.op"}}</th> </tr> </thead> <tbody> @@ -88,10 +88,10 @@ <div class="ui small basic delete modal"> <div class="ui icon header"> {{svg "octicon-trash"}} - {{.i18n.Tr "packages.settings.delete"}} + {{.locale.Tr "packages.settings.delete"}} </div> <div class="content"> - {{.i18n.Tr "packages.settings.delete.notice" `<span class="name"></span>` `<span class="dataVersion"></span>` | Safe}} + {{.locale.Tr "packages.settings.delete.notice" `<span class="name"></span>` `<span class="dataVersion"></span>` | Safe}} </div> {{template "base/delete_modal_actions" .}} </div> diff --git a/templates/admin/process-row.tmpl b/templates/admin/process-row.tmpl index d072a649f2..b97d0fc8dc 100644 --- a/templates/admin/process-row.tmpl +++ b/templates/admin/process-row.tmpl @@ -3,7 +3,7 @@ <div class="icon ml-3 mr-3">{{if eq .Process.Type "request"}}{{svg "octicon-globe" 16 }}{{else if eq .Process.Type "system"}}{{svg "octicon-cpu" 16 }}{{else}}{{svg "octicon-terminal" 16 }}{{end}}</div> <div class="content f1"> <div class="header">{{.Process.Description}}</div> - <div class="description"><span title="{{DateFmtLong .Process.Start}}">{{TimeSince .Process.Start .root.i18n}}</span></div> + <div class="description"><span title="{{DateFmtLong .Process.Start}}">{{TimeSince .Process.Start .root.locale}}</span></div> </div> <div> {{if ne .Process.Type "system"}} diff --git a/templates/admin/process.tmpl b/templates/admin/process.tmpl index 51bf1d48f9..bd5bcfb3a2 100644 --- a/templates/admin/process.tmpl +++ b/templates/admin/process.tmpl @@ -1,7 +1,7 @@ <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.process"}} + {{.locale.Tr "admin.monitor.process"}} <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/monitor/stacktrace">{{.i18n.Tr "admin.monitor.stacktrace"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/monitor/stacktrace">{{.locale.Tr "admin.monitor.stacktrace"}}</a> </div> </h4> <div class="ui attached segment"> diff --git a/templates/admin/queue.tmpl b/templates/admin/queue.tmpl index a08b44277c..a7ea4c602a 100644 --- a/templates/admin/queue.tmpl +++ b/templates/admin/queue.tmpl @@ -4,18 +4,18 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queue" .Queue.Name}} + {{.locale.Tr "admin.monitor.queue" .Queue.Name}} </h4> <div class="ui attached table segment"> <table class="ui very basic striped table"> <thead> <tr> - <th>{{.i18n.Tr "admin.monitor.queue.name"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.type"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.exemplar"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.numberworkers"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.maxnumberworkers"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.numberinqueue"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.name"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.type"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.exemplar"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.numberworkers"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.maxnumberworkers"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.numberinqueue"}}</th> </tr> </thead> <tbody> @@ -32,141 +32,141 @@ </div> {{if lt $sum 0 }} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queue.nopool.title"}} + {{.locale.Tr "admin.monitor.queue.nopool.title"}} </h4> <div class="ui attached segment"> {{if eq .Queue.Type "wrapped" }} - <p>{{.i18n.Tr "admin.monitor.queue.wrapped.desc"}}</p> + <p>{{.locale.Tr "admin.monitor.queue.wrapped.desc"}}</p> {{else if eq .Queue.Type "persistable-channel"}} - <p>{{.i18n.Tr "admin.monitor.queue.persistable-channel.desc"}}</p> + <p>{{.locale.Tr "admin.monitor.queue.persistable-channel.desc"}}</p> {{else}} - <p>{{.i18n.Tr "admin.monitor.queue.nopool.desc"}}</p> + <p>{{.locale.Tr "admin.monitor.queue.nopool.desc"}}</p> {{end}} </div> {{else}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queue.settings.title"}} + {{.locale.Tr "admin.monitor.queue.settings.title"}} </h4> <div class="ui attached segment"> - <p>{{.i18n.Tr "admin.monitor.queue.settings.desc"}}</p> + <p>{{.locale.Tr "admin.monitor.queue.settings.desc"}}</p> <form method="POST" action="{{.Link}}/set"> {{$.CsrfTokenHtml}} <div class="ui form"> <div class="inline field"> - <label for="max-number">{{.i18n.Tr "admin.monitor.queue.settings.maxnumberworkers"}}</label> - <input name="max-number" type="text" placeholder="{{.i18n.Tr "admin.monitor.queue.settings.maxnumberworkers.placeholder" .Queue.MaxNumberOfWorkers}}"> + <label for="max-number">{{.locale.Tr "admin.monitor.queue.settings.maxnumberworkers"}}</label> + <input name="max-number" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.maxnumberworkers.placeholder" .Queue.MaxNumberOfWorkers}}"> </div> <div class="inline field"> - <label for="timeout">{{.i18n.Tr "admin.monitor.queue.settings.timeout"}}</label> - <input name="timeout" type="text" placeholder="{{.i18n.Tr "admin.monitor.queue.settings.timeout.placeholder" .Queue.BoostTimeout }}"> + <label for="timeout">{{.locale.Tr "admin.monitor.queue.settings.timeout"}}</label> + <input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.timeout.placeholder" .Queue.BoostTimeout }}"> </div> <div class="inline field"> - <label for="number">{{.i18n.Tr "admin.monitor.queue.settings.numberworkers"}}</label> - <input name="number" type="text" placeholder="{{.i18n.Tr "admin.monitor.queue.settings.numberworkers.placeholder" .Queue.BoostWorkers}}"> + <label for="number">{{.locale.Tr "admin.monitor.queue.settings.numberworkers"}}</label> + <input name="number" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.numberworkers.placeholder" .Queue.BoostWorkers}}"> </div> <div class="inline field"> - <label>{{.i18n.Tr "admin.monitor.queue.settings.blocktimeout"}}</label> - <span>{{.i18n.Tr "admin.monitor.queue.settings.blocktimeout.value" .Queue.BlockTimeout}}</span> + <label>{{.locale.Tr "admin.monitor.queue.settings.blocktimeout"}}</label> + <span>{{.locale.Tr "admin.monitor.queue.settings.blocktimeout.value" .Queue.BlockTimeout}}</span> </div> - <button class="ui submit button">{{.i18n.Tr "admin.monitor.queue.settings.submit"}}</button> + <button class="ui submit button">{{.locale.Tr "admin.monitor.queue.settings.submit"}}</button> </div> </form> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queue.pool.addworkers.title"}} + {{.locale.Tr "admin.monitor.queue.pool.addworkers.title"}} </h4> <div class="ui attached segment"> - <p>{{.i18n.Tr "admin.monitor.queue.pool.addworkers.desc"}}</p> + <p>{{.locale.Tr "admin.monitor.queue.pool.addworkers.desc"}}</p> <form method="POST" action="{{.Link}}/add"> {{$.CsrfTokenHtml}} <div class="ui form"> <div class="fields"> <div class="field"> - <label>{{.i18n.Tr "admin.monitor.queue.numberworkers"}}</label> - <input name="number" type="text" placeholder="{{.i18n.Tr "admin.monitor.queue.pool.addworkers.numberworkers.placeholder"}}"> + <label>{{.locale.Tr "admin.monitor.queue.numberworkers"}}</label> + <input name="number" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.pool.addworkers.numberworkers.placeholder"}}"> </div> <div class="field"> - <label>{{.i18n.Tr "admin.monitor.queue.pool.timeout"}}</label> - <input name="timeout" type="text" placeholder="{{.i18n.Tr "admin.monitor.queue.pool.addworkers.timeout.placeholder"}}"> + <label>{{.locale.Tr "admin.monitor.queue.pool.timeout"}}</label> + <input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.pool.addworkers.timeout.placeholder"}}"> </div> </div> - <button class="ui submit button">{{.i18n.Tr "admin.monitor.queue.pool.addworkers.submit"}}</button> + <button class="ui submit button">{{.locale.Tr "admin.monitor.queue.pool.addworkers.submit"}}</button> </div> </form> </div> {{if .Queue.Pausable}} {{if .Queue.IsPaused}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queue.pool.resume.title"}} + {{.locale.Tr "admin.monitor.queue.pool.resume.title"}} </h4> <div class="ui attached segment"> - <p>{{.i18n.Tr "admin.monitor.queue.pool.resume.desc"}}</p> + <p>{{.locale.Tr "admin.monitor.queue.pool.resume.desc"}}</p> <form method="POST" action="{{.Link}}/resume"> {{$.CsrfTokenHtml}} <div class="ui form"> - <button class="ui submit button">{{.i18n.Tr "admin.monitor.queue.pool.resume.submit"}}</button> + <button class="ui submit button">{{.locale.Tr "admin.monitor.queue.pool.resume.submit"}}</button> </div> </form> </div> {{else}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queue.pool.pause.title"}} + {{.locale.Tr "admin.monitor.queue.pool.pause.title"}} </h4> <div class="ui attached segment"> - <p>{{.i18n.Tr "admin.monitor.queue.pool.pause.desc"}}</p> + <p>{{.locale.Tr "admin.monitor.queue.pool.pause.desc"}}</p> <form method="POST" action="{{.Link}}/pause"> {{$.CsrfTokenHtml}} <div class="ui form"> - <button class="ui submit button">{{.i18n.Tr "admin.monitor.queue.pool.pause.submit"}}</button> + <button class="ui submit button">{{.locale.Tr "admin.monitor.queue.pool.pause.submit"}}</button> </div> </form> </div> {{end}} {{end}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queue.pool.flush.title"}} + {{.locale.Tr "admin.monitor.queue.pool.flush.title"}} </h4> <div class="ui attached segment"> - <p>{{.i18n.Tr "admin.monitor.queue.pool.flush.desc"}}</p> + <p>{{.locale.Tr "admin.monitor.queue.pool.flush.desc"}}</p> <form method="POST" action="{{.Link}}/flush"> {{$.CsrfTokenHtml}} <div class="ui form"> <div class="fields"> <div class="field"> - <label>{{.i18n.Tr "admin.monitor.queue.pool.timeout"}}</label> - <input name="timeout" type="text" placeholder="{{.i18n.Tr "admin.monitor.queue.pool.addworkers.timeout.placeholder"}}"> + <label>{{.locale.Tr "admin.monitor.queue.pool.timeout"}}</label> + <input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.pool.addworkers.timeout.placeholder"}}"> </div> </div> - <button class="ui submit button">{{.i18n.Tr "admin.monitor.queue.pool.flush.submit"}}</button> + <button class="ui submit button">{{.locale.Tr "admin.monitor.queue.pool.flush.submit"}}</button> </div> </form> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queue.pool.workers.title"}} + {{.locale.Tr "admin.monitor.queue.pool.workers.title"}} </h4> <div class="ui attached table segment"> <table class="ui very basic striped table"> <thead> <tr> - <th>{{.i18n.Tr "admin.monitor.queue.numberworkers"}}</th> - <th>{{.i18n.Tr "admin.monitor.start"}}</th> - <th>{{.i18n.Tr "admin.monitor.queue.pool.timeout"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.numberworkers"}}</th> + <th>{{.locale.Tr "admin.monitor.start"}}</th> + <th>{{.locale.Tr "admin.monitor.queue.pool.timeout"}}</th> <th></th> </tr> </thead> <tbody> {{range .Queue.Workers}} <tr> - <td>{{.Workers}}{{if .IsFlusher}}<span title="{{.i18n.Tr "admin.monitor.queue.flush"}}">{{svg "octicon-sync"}}</span>{{end}}</td> + <td>{{.Workers}}{{if .IsFlusher}}<span title="{{.locale.Tr "admin.monitor.queue.flush"}}">{{svg "octicon-sync"}}</span>{{end}}</td> <td>{{DateFmtLong .Start}}</td> <td>{{if .HasTimeout}}{{DateFmtLong .Timeout}}{{else}}-{{end}}</td> <td> - <a class="delete-button" href="" data-url="{{$.Link}}/cancel/{{.PID}}" data-id="{{.PID}}" data-name="{{.Workers}}"><span class="text red" title="{{$.i18n.Tr "remove"}}">{{svg "octicon-trash"}}</span></a> + <a class="delete-button" href="" data-url="{{$.Link}}/cancel/{{.PID}}" data-id="{{.PID}}" data-name="{{.Workers}}"><span class="text red" title="{{$.locale.Tr "remove"}}">{{svg "octicon-trash"}}</span></a> </td> </tr> {{else}} <tr> - <td colspan="4">{{.i18n.Tr "admin.monitor.queue.pool.workers.none" }} + <td colspan="4">{{.locale.Tr "admin.monitor.queue.pool.workers.none" }} </tr> {{end}} </tbody> @@ -174,7 +174,7 @@ </div> {{end}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.queue.configuration"}} + {{.locale.Tr "admin.monitor.queue.configuration"}} </h4> <div class="ui attached segment"> <pre>{{.Queue.Configuration | JsonPrettyPrint}} @@ -184,11 +184,11 @@ <div class="ui small basic delete modal"> <div class="ui icon header"> {{svg "octicon-x" 16 "close inside"}} - {{.i18n.Tr "admin.monitor.queue.pool.cancel"}} + {{.locale.Tr "admin.monitor.queue.pool.cancel"}} </div> <div class="content"> - <p>{{$.i18n.Tr "admin.monitor.queue.pool.cancel_notices" `<span class="name"></span>` | Safe}}</p> - <p>{{$.i18n.Tr "admin.monitor.queue.pool.cancel_desc"}}</p> + <p>{{$.locale.Tr "admin.monitor.queue.pool.cancel_notices" `<span class="name"></span>` | Safe}}</p> + <p>{{$.locale.Tr "admin.monitor.queue.pool.cancel_desc"}}</p> </div> {{template "base/delete_modal_actions" .}} </div> diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index 96f04b8fe4..b26ec2eb78 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -4,9 +4,9 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.repos.repo_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}) + {{.locale.Tr "admin.repos.repo_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos/unadopted">{{.i18n.Tr "admin.repos.unadopted"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos/unadopted">{{.locale.Tr "admin.repos.unadopted"}}</a> </div> </h4> <div class="ui attached segment"> @@ -17,27 +17,27 @@ <thead> <tr> <th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" $.SortType false}}</th> - <th>{{.i18n.Tr "admin.repos.owner"}}</th> + <th>{{.locale.Tr "admin.repos.owner"}}</th> <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically"> - {{.i18n.Tr "admin.repos.name"}} + {{.locale.Tr "admin.repos.name"}} {{SortArrow "alphabetically" "reversealphabetically" $.SortType false}} </th> - <th>{{.i18n.Tr "admin.repos.watches"}}</th> + <th>{{.locale.Tr "admin.repos.watches"}}</th> <th data-sortt-asc="moststars" data-sortt-desc="feweststars"> - {{.i18n.Tr "admin.repos.stars"}} + {{.locale.Tr "admin.repos.stars"}} {{SortArrow "moststars" "feweststars" $.SortType false}} </th> <th data-sortt-asc="mostforks" data-sortt-desc="fewestforks"> - {{.i18n.Tr "admin.repos.forks"}} + {{.locale.Tr "admin.repos.forks"}} {{SortArrow "mostforks" "fewestforks" $.SortType false}} </th> - <th>{{.i18n.Tr "admin.repos.issues"}}</th> + <th>{{.locale.Tr "admin.repos.issues"}}</th> <th data-sortt-asc="size" data-sortt-desc="reversesize"> - {{.i18n.Tr "admin.repos.size"}} + {{.locale.Tr "admin.repos.size"}} {{SortArrow "size" "reversesize" $.SortType false}} </th> - <th>{{.i18n.Tr "admin.users.created"}}</th> - <th>{{.i18n.Tr "admin.notices.op"}}</th> + <th>{{.locale.Tr "admin.users.created"}}</th> + <th>{{.locale.Tr "admin.notices.op"}}</th> </tr> </thead> <tbody> @@ -53,22 +53,22 @@ <td> <a href="{{.Link}}">{{.Name}}</a> {{if .IsArchived}} - <span class="ui basic mini label">{{$.i18n.Tr "repo.desc.archived"}}</span> + <span class="ui basic mini label">{{$.locale.Tr "repo.desc.archived"}}</span> {{end}} {{if .IsTemplate}} {{if .IsPrivate}} - <span class="ui basic mini label">{{$.i18n.Tr "repo.desc.private_template"}}</span> + <span class="ui basic mini label">{{$.locale.Tr "repo.desc.private_template"}}</span> {{else}} {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic mini label">{{$.i18n.Tr "repo.desc.internal_template"}}</span> + <span class="ui basic mini label">{{$.locale.Tr "repo.desc.internal_template"}}</span> {{end}} {{end}} {{else}} {{if .IsPrivate}} - <span class="ui basic mini label">{{$.i18n.Tr "repo.desc.private"}}</span> + <span class="ui basic mini label">{{$.locale.Tr "repo.desc.private"}}</span> {{else}} {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic mini label">{{$.i18n.Tr "repo.desc.internal"}}</span> + <span class="ui basic mini label">{{$.locale.Tr "repo.desc.internal"}}</span> {{end}} {{end}} {{end}} @@ -98,12 +98,12 @@ <div class="ui small basic delete modal"> <div class="ui icon header"> {{svg "octicon-trash"}} - {{.i18n.Tr "repo.settings.delete"}} + {{.locale.Tr "repo.settings.delete"}} </div> <div class="content"> - <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p> - {{.i18n.Tr "repo.settings.delete_notices_2" `<span class="name"></span>` | Safe}}<br> - {{.i18n.Tr "repo.settings.delete_notices_fork_1"}}<br> + <p>{{.locale.Tr "repo.settings.delete_desc"}}</p> + {{.locale.Tr "repo.settings.delete_notices_2" `<span class="name"></span>` | Safe}}<br> + {{.locale.Tr "repo.settings.delete_notices_fork_1"}}<br> </div> {{template "base/delete_modal_actions" .}} </div> diff --git a/templates/admin/repo/search.tmpl b/templates/admin/repo/search.tmpl index 7b9c44afd7..9c71211bce 100644 --- a/templates/admin/repo/search.tmpl +++ b/templates/admin/repo/search.tmpl @@ -2,28 +2,28 @@ <!-- Sort --> <div class="ui dropdown type jump item"> <span class="text"> - {{.i18n.Tr "repo.issues.filter_sort"}} + {{.locale.Tr "repo.issues.filter_sort"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} </span> <div class="menu"> - <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> - <a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> - <a class="{{if eq .SortType "alphabetically"}}active{{end}} item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> - <a class="{{if eq .SortType "reversealphabetically"}}active{{end}} item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> - <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> - <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> - <a class="{{if eq .SortType "moststars"}}active{{end}} item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.moststars"}}</a> - <a class="{{if eq .SortType "feweststars"}}active{{end}} item" href="{{$.Link}}?sort=feweststars&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.feweststars"}}</a> - <a class="{{if eq .SortType "mostforks"}}active{{end}} item" href="{{$.Link}}?sort=mostforks&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.mostforks"}}</a> - <a class="{{if eq .SortType "fewestforks"}}active{{end}} item" href="{{$.Link}}?sort=fewestforks&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.fewestforks"}}</a> - <a class="{{if eq .SortType "size"}}active{{end}} item" href="{{$.Link}}?sort=size&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.label.filter_sort.by_size"}}</a> - <a class="{{if eq .SortType "reversesize"}}active{{end}} item" href="{{$.Link}}?sort=reversesize&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.label.filter_sort.reverse_by_size"}}</a> + <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a> + <a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a> + <a class="{{if eq .SortType "alphabetically"}}active{{end}} item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> + <a class="{{if eq .SortType "reversealphabetically"}}active{{end}} item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> + <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> + <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> + <a class="{{if eq .SortType "moststars"}}active{{end}} item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.moststars"}}</a> + <a class="{{if eq .SortType "feweststars"}}active{{end}} item" href="{{$.Link}}?sort=feweststars&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.feweststars"}}</a> + <a class="{{if eq .SortType "mostforks"}}active{{end}} item" href="{{$.Link}}?sort=mostforks&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.mostforks"}}</a> + <a class="{{if eq .SortType "fewestforks"}}active{{end}} item" href="{{$.Link}}?sort=fewestforks&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.fewestforks"}}</a> + <a class="{{if eq .SortType "size"}}active{{end}} item" href="{{$.Link}}?sort=size&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.by_size"}}</a> + <a class="{{if eq .SortType "reversesize"}}active{{end}} item" href="{{$.Link}}?sort=reversesize&q={{$.Keyword}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_by_size"}}</a> </div> </div> </div> <form class="ui form ignore-dirty" style="max-width: 90%"> <div class="ui fluid action input"> - <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus> - <button class="ui primary button">{{.i18n.Tr "explore.search"}}</button> + <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}..." autofocus> + <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> </div> </form> diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl index cd04891d7e..0c27c80e93 100644 --- a/templates/admin/repo/unadopted.tmpl +++ b/templates/admin/repo/unadopted.tmpl @@ -4,17 +4,17 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.repos.unadopted"}} + {{.locale.Tr "admin.repos.unadopted"}} <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos">{{.i18n.Tr "admin.repos.repo_manage_panel"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos">{{.locale.Tr "admin.repos.repo_manage_panel"}}</a> </div> </h4> <div class="ui attached segment"> <form class="ui form ignore-dirty"> <div class="ui fluid action input"> <input name="search" value="true" type="hidden"> - <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "repo.adopt_search"}}" autofocus> - <button class="ui primary button">{{.i18n.Tr "explore.search"}}</button> + <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "repo.adopt_search"}}" autofocus> + <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> </div> </form> </div> @@ -28,14 +28,14 @@ <span class="icon">{{svg "octicon-file-directory-fill"}}</span> <span class="name">{{$dir}}</span> <div class="right floated content"> - <button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.i18n.Tr "repo.adopt_preexisting_label"}}</span></button> + <button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button> <div class="ui basic modal" id="adopt-unadopted-modal-{{$dirI}}"> {{svg "octicon-x" 16 "close inside"}} <div class="header"> - <span class="label">{{$.i18n.Tr "repo.adopt_preexisting"}}</span> + <span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span> </div> <div class="content"> - <p>{{$.i18n.Tr "repo.adopt_preexisting_content" $dir}}</p> + <p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p> </div> <form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted"> {{$.CsrfTokenHtml}} @@ -46,23 +46,23 @@ <div class="actions"> <div class="ui red basic inverted cancel button"> {{svg "octicon-trash" 16 "mr-2"}} - {{$.i18n.Tr "modal.no"}} + {{$.locale.Tr "modal.no"}} </div> <button class="ui green basic inverted ok button"> {{svg "octicon-check" 16 "mr-2"}} - {{$.i18n.Tr "modal.yes"}} + {{$.locale.Tr "modal.yes"}} </button> </div> </form> </div> - <button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.i18n.Tr "repo.delete_preexisting_label"}}</span></button> + <button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button> <div class="ui basic modal" id="delete-unadopted-modal-{{$dirI}}"> {{svg "octicon-x" 16 "close inside"}} <div class="header"> - <span class="label">{{$.i18n.Tr "repo.delete_preexisting"}}</span> + <span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span> </div> <div class="content"> - <p>{{$.i18n.Tr "repo.delete_preexisting_content" $dir}}</p> + <p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p> </div> <form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted"> {{$.CsrfTokenHtml}} @@ -73,11 +73,11 @@ <div class="actions"> <div class="ui red basic inverted cancel button"> {{svg "octicon-trash" 16 "mr-2"}} - {{$.i18n.Tr "modal.no"}} + {{$.locale.Tr "modal.no"}} </div> <button class="ui green basic inverted ok button"> {{svg "octicon-check" 16 "mr-2"}} - {{$.i18n.Tr "modal.yes"}} + {{$.locale.Tr "modal.yes"}} </button> </div> </form> @@ -90,7 +90,7 @@ {{template "base/paginate" .}} {{else}} <div class="item"> - {{.i18n.Tr "admin.repos.unadopted.no_more"}} + {{.locale.Tr "admin.repos.unadopted.no_more"}} </div> {{template "base/paginate" .}} {{end}} diff --git a/templates/admin/stacktrace-row.tmpl b/templates/admin/stacktrace-row.tmpl index af7ea36230..d8b337fc09 100644 --- a/templates/admin/stacktrace-row.tmpl +++ b/templates/admin/stacktrace-row.tmpl @@ -13,7 +13,7 @@ </div> <div class="content f1"> <div class="header">{{.Process.Description}}</div> - <div class="description">{{if ne .Process.Type "none"}}<span title="{{DateFmtLong .Process.Start}}">{{TimeSince .Process.Start .root.i18n}}</span>{{end}}</div> + <div class="description">{{if ne .Process.Type "none"}}<span title="{{DateFmtLong .Process.Start}}">{{TimeSince .Process.Start .root.locale}}</span>{{end}}</div> </div> <div> {{if or (eq .Process.Type "request") (eq .Process.Type "normal") }} diff --git a/templates/admin/stacktrace.tmpl b/templates/admin/stacktrace.tmpl index 5c3993e234..91929deaa8 100644 --- a/templates/admin/stacktrace.tmpl +++ b/templates/admin/stacktrace.tmpl @@ -4,9 +4,9 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.monitor.stacktrace"}}: {{.i18n.Tr "admin.monitor.goroutines" .GoroutineCount}} + {{.locale.Tr "admin.monitor.stacktrace"}}: {{.locale.Tr "admin.monitor.goroutines" .GoroutineCount}} <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/monitor">{{.i18n.Tr "admin.monitor"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/monitor">{{.locale.Tr "admin.monitor"}}</a> </div> </h4> <div class="ui attached segment"> @@ -21,11 +21,11 @@ <div class="ui small basic delete modal"> <div class="ui icon header"> {{svg "octicon-x" 16 "close inside"}} - {{.i18n.Tr "admin.monitor.process.cancel"}} + {{.locale.Tr "admin.monitor.process.cancel"}} </div> <div class="content"> - <p>{{$.i18n.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p> - <p>{{$.i18n.Tr "admin.monitor.process.cancel_desc"}}</p> + <p>{{$.locale.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p> + <p>{{$.locale.Tr "admin.monitor.process.cancel_desc"}}</p> </div> {{template "base/delete_modal_actions" .}} </div> diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 1ee46f3077..29dcaa127a 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -4,25 +4,25 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.users.edit_account"}} + {{.locale.Tr "admin.users.edit_account"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <div class="field {{if .Err_UserName}}error{{end}}"> - <label for="user_name">{{.i18n.Tr "username"}}</label> + <label for="user_name">{{.locale.Tr "username"}}</label> <input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal }}disabled{{end}}> </div> <!-- Types and name --> <div class="inline required field {{if .Err_LoginType}}error{{end}}"> - <label>{{.i18n.Tr "admin.users.auth_source"}}</label> + <label>{{.locale.Tr "admin.users.auth_source"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="login_type" name="login_type" value="{{.LoginSource.Type.Int}}-{{.LoginSource.ID}}" required> - <div class="text">{{.i18n.Tr "admin.users.local"}}</div> + <div class="text">{{.locale.Tr "admin.users.local"}}</div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="item" data-value="0-0">{{.i18n.Tr "admin.users.local"}}</div> + <div class="item" data-value="0-0">{{.locale.Tr "admin.users.local"}}</div> {{range .Sources}} <div class="item" data-value="{{.Type.Int}}-{{.ID}}">{{.Name}}</div> {{end}} @@ -31,25 +31,25 @@ </div> <div class="inline field {{if .Err_Visibility}}error{{end}}"> - <span class="inline required field"><label for="visibility">{{.i18n.Tr "settings.visibility"}}</label></span> + <span class="inline required field"><label for="visibility">{{.locale.Tr "settings.visibility"}}</label></span> <div class="ui selection type dropdown"> {{if .User.Visibility.IsPublic}}<input type="hidden" id="visibility" name="visibility" value="0">{{end}} {{if .User.Visibility.IsLimited}}<input type="hidden" id="visibility" name="visibility" value="1">{{end}} {{if .User.Visibility.IsPrivate}}<input type="hidden" id="visibility" name="visibility" value="2">{{end}} <div class="text"> - {{if .User.Visibility.IsPublic}}{{.i18n.Tr "settings.visibility.public"}}{{end}} - {{if .User.Visibility.IsLimited}}{{.i18n.Tr "settings.visibility.limited"}}{{end}} - {{if .User.Visibility.IsPrivate}}{{.i18n.Tr "settings.visibility.private"}}{{end}} + {{if .User.Visibility.IsPublic}}{{.locale.Tr "settings.visibility.public"}}{{end}} + {{if .User.Visibility.IsLimited}}{{.locale.Tr "settings.visibility.limited"}}{{end}} + {{if .User.Visibility.IsPrivate}}{{.locale.Tr "settings.visibility.private"}}{{end}} </div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> {{range $mode := .AllowedUserVisibilityModes}} {{if $mode.IsPublic}} - <div class="item tooltip" data-content="{{$.i18n.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.i18n.Tr "settings.visibility.public"}}</div> + <div class="item tooltip" data-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div> {{else if $mode.IsLimited}} - <div class="item tooltip" data-content="{{$.i18n.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.i18n.Tr "settings.visibility.limited"}}</div> + <div class="item tooltip" data-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div> {{else if $mode.IsPrivate}} - <div class="item tooltip" data-content="{{$.i18n.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.i18n.Tr "settings.visibility.private"}}</div> + <div class="item tooltip" data-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div> {{end}} {{end}} </div> @@ -57,81 +57,81 @@ </div> <div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}hide{{end}}"> - <label for="login_name">{{.i18n.Tr "admin.users.auth_login_name"}}</label> + <label for="login_name">{{.locale.Tr "admin.users.auth_login_name"}}</label> <input id="login_name" name="login_name" value="{{.User.LoginName}}" autofocus> </div> <div class="field {{if .Err_FullName}}error{{end}}"> - <label for="full_name">{{.i18n.Tr "settings.full_name"}}</label> + <label for="full_name">{{.locale.Tr "settings.full_name"}}</label> <input id="full_name" name="full_name" value="{{.User.FullName}}"> </div> <div class="required field {{if .Err_Email}}error{{end}}"> - <label for="email">{{.i18n.Tr "email"}}</label> + <label for="email">{{.locale.Tr "email"}}</label> <input id="email" name="email" type="email" value="{{.User.Email}}" autofocus required> </div> <div class="local field {{if .Err_Password}}error{{end}} {{if not (or (.User.IsLocal) (.User.IsOAuth2))}}hide{{end}}"> - <label for="password">{{.i18n.Tr "password"}}</label> + <label for="password">{{.locale.Tr "password"}}</label> <input id="password" name="password" type="password" autocomplete="new-password"> - <p class="help">{{.i18n.Tr "admin.users.password_helper"}}</p> + <p class="help">{{.locale.Tr "admin.users.password_helper"}}</p> </div> <div class="field {{if .Err_Website}}error{{end}}"> - <label for="website">{{.i18n.Tr "settings.website"}}</label> + <label for="website">{{.locale.Tr "settings.website"}}</label> <input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="e.g. http://mydomain.com or https://mydomain.com"> </div> <div class="field {{if .Err_Location}}error{{end}}"> - <label for="location">{{.i18n.Tr "settings.location"}}</label> + <label for="location">{{.locale.Tr "settings.location"}}</label> <input id="location" name="location" value="{{.User.Location}}"> </div> <div class="ui divider"></div> <div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}"> - <label for="max_repo_creation">{{.i18n.Tr "admin.users.max_repo_creation"}}</label> + <label for="max_repo_creation">{{.locale.Tr "admin.users.max_repo_creation"}}</label> <input id="max_repo_creation" name="max_repo_creation" type="number" value="{{.User.MaxRepoCreation}}"> - <p class="help">{{.i18n.Tr "admin.users.max_repo_creation_desc"}}</p> + <p class="help">{{.locale.Tr "admin.users.max_repo_creation_desc"}}</p> </div> <div class="ui divider"></div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.users.is_activated"}}</strong></label> + <label><strong>{{.locale.Tr "admin.users.is_activated"}}</strong></label> <input name="active" type="checkbox" {{if .User.IsActive}}checked{{end}}> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.users.prohibit_login"}}</strong></label> + <label><strong>{{.locale.Tr "admin.users.prohibit_login"}}</strong></label> <input name="prohibit_login" type="checkbox" {{if .User.ProhibitLogin}}checked{{end}} {{if (eq .User.ID .SignedUserID)}}disabled{{end}}> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.users.is_admin"}}</strong></label> + <label><strong>{{.locale.Tr "admin.users.is_admin"}}</strong></label> <input name="admin" type="checkbox" {{if .User.IsAdmin}}checked{{end}}> </div> </div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.users.is_restricted"}}</strong></label> + <label><strong>{{.locale.Tr "admin.users.is_restricted"}}</strong></label> <input name="restricted" type="checkbox" {{if .User.IsRestricted}}checked{{end}}> </div> </div> <div class="inline field"{{if DisableGitHooks}} hidden{{end}}> - <div class="ui checkbox tooltip" data-content="{{.i18n.Tr "admin.users.allow_git_hook_tooltip"}}" data-variation="very wide"> - <label><strong>{{.i18n.Tr "admin.users.allow_git_hook"}}</strong></label> + <div class="ui checkbox tooltip" data-content="{{.locale.Tr "admin.users.allow_git_hook_tooltip"}}" data-variation="very wide"> + <label><strong>{{.locale.Tr "admin.users.allow_git_hook"}}</strong></label> <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if DisableGitHooks}}disabled{{end}}> </div> </div> <div class="inline field" {{if or (DisableImportLocal) (.DisableMigrations)}}hidden{{end}}> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.users.allow_import_local"}}</strong></label> + <label><strong>{{.locale.Tr "admin.users.allow_import_local"}}</strong></label> <input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if DisableImportLocal}}disabled{{end}}> </div> </div> {{if not .DisableRegularOrgCreation}} <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.users.allow_create_organization"}}</strong></label> + <label><strong>{{.locale.Tr "admin.users.allow_create_organization"}}</strong></label> <input name="allow_create_organization" type="checkbox" {{if .User.CanCreateOrganization}}checked{{end}}> </div> </div> @@ -141,7 +141,7 @@ <div class="ui divider"></div> <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.users.reset_2fa"}}</strong></label> + <label><strong>{{.locale.Tr "admin.users.reset_2fa"}}</strong></label> <input name="reset_2fa" type="checkbox"> </div> </div> @@ -150,14 +150,14 @@ <div class="ui divider"></div> <div class="field"> - <button class="ui green button">{{.i18n.Tr "admin.users.update_profile"}}</button> - <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.User.ID}}">{{.i18n.Tr "admin.users.delete_account"}}</div> + <button class="ui green button">{{.locale.Tr "admin.users.update_profile"}}</button> + <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.User.ID}}">{{.locale.Tr "admin.users.delete_account"}}</div> </div> </form> </div> <h4 class="ui top attached header"> - {{.i18n.Tr "settings.avatar"}} + {{.locale.Tr "settings.avatar"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data"> @@ -166,11 +166,11 @@ <div class="inline field"> <div class="ui radio checkbox"> <input name="source" value="lookup" type="radio" {{if not .User.UseCustomAvatar}}checked{{end}}> - <label>{{.i18n.Tr "settings.lookup_avatar_by_mail"}}</label> + <label>{{.locale.Tr "settings.lookup_avatar_by_mail"}}</label> </div> </div> <div class="field {{if .Err_Gravatar}}error{{end}}"> - <label for="gravatar">Avatar {{.i18n.Tr "email"}}</label> + <label for="gravatar">Avatar {{.locale.Tr "email"}}</label> <input id="gravatar" name="gravatar" value="{{.User.AvatarEmail}}" /> </div> {{end}} @@ -178,18 +178,18 @@ <div class="inline field"> <div class="ui radio checkbox"> <input name="source" value="local" type="radio" {{if .User.UseCustomAvatar}}checked{{end}}> - <label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label> + <label>{{.locale.Tr "settings.enable_custom_avatar"}}</label> </div> </div> <div class="inline field"> - <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label> + <label for="avatar">{{.locale.Tr "settings.choose_new_avatar"}}</label> <input name="avatar" type="file" > </div> <div class="field"> - <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button> - <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a> + <button class="ui green button">{{$.locale.Tr "settings.update_avatar"}}</button> + <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.locale.Tr "settings.delete_current_avatar"}}</a> </div> </form> </div> @@ -199,10 +199,10 @@ <div class="ui small basic delete modal"> <div class="ui icon header"> {{svg "octicon-trash"}} - {{.i18n.Tr "settings.delete_account_title"}} + {{.locale.Tr "settings.delete_account_title"}} </div> <div class="content"> - <p>{{.i18n.Tr "settings.delete_account_desc"}}</p> + <p>{{.locale.Tr "settings.delete_account_desc"}}</p> </div> {{template "base/delete_modal_actions" .}} </div> diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 963a440e29..061e663850 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -4,9 +4,9 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.users.user_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}) + {{.locale.Tr "admin.users.user_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) <div class="ui right"> - <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/users/new">{{.i18n.Tr "admin.users.new_account"}}</a> + <a class="ui primary tiny button" href="{{AppSubUrl}}/admin/users/new">{{.locale.Tr "admin.users.new_account"}}</a> </div> </h4> <div class="ui attached segment"> @@ -16,47 +16,47 @@ <div class="ui right floated secondary filter menu"> <!-- Status Filter Menu Item --> <div class="ui dropdown type jump item"> - <span class="text">{{.i18n.Tr "admin.users.list_status_filter.menu_text"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}</span> + <span class="text">{{.locale.Tr "admin.users.list_status_filter.menu_text"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}</span> <div class="menu"> - <a class="item j-reset-status-filter">{{.i18n.Tr "admin.users.list_status_filter.reset"}}</a> + <a class="item j-reset-status-filter">{{.locale.Tr "admin.users.list_status_filter.reset"}}</a> <div class="ui divider"></div> - <label class="item"><input type="radio" name="status_filter[is_admin]" value="1"> {{.i18n.Tr "admin.users.list_status_filter.is_admin"}}</label> - <label class="item"><input type="radio" name="status_filter[is_admin]" value="0"> {{.i18n.Tr "admin.users.list_status_filter.not_admin"}}</label> + <label class="item"><input type="radio" name="status_filter[is_admin]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_admin"}}</label> + <label class="item"><input type="radio" name="status_filter[is_admin]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_admin"}}</label> <div class="ui divider"></div> - <label class="item"><input type="radio" name="status_filter[is_active]" value="1"> {{.i18n.Tr "admin.users.list_status_filter.is_active"}}</label> - <label class="item"><input type="radio" name="status_filter[is_active]" value="0"> {{.i18n.Tr "admin.users.list_status_filter.not_active"}}</label> + <label class="item"><input type="radio" name="status_filter[is_active]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_active"}}</label> + <label class="item"><input type="radio" name="status_filter[is_active]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_active"}}</label> <div class="ui divider"></div> - <label class="item"><input type="radio" name="status_filter[is_restricted]" value="0"> {{.i18n.Tr "admin.users.list_status_filter.not_restricted"}}</label> - <label class="item"><input type="radio" name="status_filter[is_restricted]" value="1"> {{.i18n.Tr "admin.users.list_status_filter.is_restricted"}}</label> + <label class="item"><input type="radio" name="status_filter[is_restricted]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_restricted"}}</label> + <label class="item"><input type="radio" name="status_filter[is_restricted]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_restricted"}}</label> <div class="ui divider"></div> - <label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="0"> {{.i18n.Tr "admin.users.list_status_filter.not_prohibit_login"}}</label> - <label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="1"> {{.i18n.Tr "admin.users.list_status_filter.is_prohibit_login"}}</label> + <label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_prohibit_login"}}</label> + <label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_prohibit_login"}}</label> <div class="ui divider"></div> - <label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="1"> {{.i18n.Tr "admin.users.list_status_filter.is_2fa_enabled"}}</label> - <label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="0"> {{.i18n.Tr "admin.users.list_status_filter.not_2fa_enabled"}}</label> + <label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="1"> {{.locale.Tr "admin.users.list_status_filter.is_2fa_enabled"}}</label> + <label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="0"> {{.locale.Tr "admin.users.list_status_filter.not_2fa_enabled"}}</label> </div> </div> <!-- Sort Menu Item --> <div class="ui dropdown type jump item"> <span class="text"> - {{.i18n.Tr "repo.issues.filter_sort"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} + {{.locale.Tr "repo.issues.filter_sort"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}} </span> <div class="menu"> - <button class="item" name="sort" value="oldest">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</button> - <button class="item" name="sort" value="newest">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</button> - <button class="item" name="sort" value="alphabetically">{{.i18n.Tr "repo.issues.label.filter_sort.alphabetically"}}</button> - <button class="item" name="sort" value="reversealphabetically">{{.i18n.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</button> - <button class="item" name="sort" value="recentupdate">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</button> - <button class="item" name="sort" value="leastupdate">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</button> + <button class="item" name="sort" value="oldest">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</button> + <button class="item" name="sort" value="newest">{{.locale.Tr "repo.issues.filter_sort.latest"}}</button> + <button class="item" name="sort" value="alphabetically">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</button> + <button class="item" name="sort" value="reversealphabetically">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</button> + <button class="item" name="sort" value="recentupdate">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</button> + <button class="item" name="sort" value="leastupdate">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</button> </div> </div> </div> <!-- Search Text --> <div class="ui fluid action input" style="max-width: 70%;"> - <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus> - <button class="ui primary button">{{.i18n.Tr "explore.search"}}</button> + <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}..." autofocus> + <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> </div> </form> </div> @@ -66,21 +66,21 @@ <tr> <th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" .SortType false}}</th> <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically" data-sortt-default="true"> - {{.i18n.Tr "admin.users.name"}} + {{.locale.Tr "admin.users.name"}} {{SortArrow "alphabetically" "reversealphabetically" $.SortType true}} </th> - <th>{{.i18n.Tr "email"}}</th> - <th>{{.i18n.Tr "admin.users.activated"}}</th> - <th>{{.i18n.Tr "admin.users.admin"}}</th> - <th>{{.i18n.Tr "admin.users.restricted"}}</th> - <th>{{.i18n.Tr "admin.users.2fa"}}</th> - <th>{{.i18n.Tr "admin.users.repos"}}</th> - <th>{{.i18n.Tr "admin.users.created"}}</th> + <th>{{.locale.Tr "email"}}</th> + <th>{{.locale.Tr "admin.users.activated"}}</th> + <th>{{.locale.Tr "admin.users.admin"}}</th> + <th>{{.locale.Tr "admin.users.restricted"}}</th> + <th>{{.locale.Tr "admin.users.2fa"}}</th> + <th>{{.locale.Tr "admin.users.repos"}}</th> + <th>{{.locale.Tr "admin.users.created"}}</th> <th data-sortt-asc="leastupdate" data-sortt-desc="recentupdate"> - {{.i18n.Tr "admin.users.last_login"}} + {{.locale.Tr "admin.users.last_login"}} {{SortArrow "leastupdate" "recentupdate" $.SortType false}} </th> - <th>{{.i18n.Tr "admin.users.edit"}}</th> + <th>{{.locale.Tr "admin.users.edit"}}</th> </tr> </thead> <tbody> @@ -98,7 +98,7 @@ {{if .LastLoginUnix}} <td><span title="{{.LastLoginUnix.FormatLong}}">{{.LastLoginUnix.FormatShort}}</span></td> {{else}} - <td><span>{{$.i18n.Tr "admin.users.never_login"}}</span></td> + <td><span>{{$.locale.Tr "admin.users.never_login"}}</span></td> {{end}} <td><a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a></td> </tr> diff --git a/templates/admin/user/new.tmpl b/templates/admin/user/new.tmpl index 6e3861fa50..b8fd8c0ad1 100644 --- a/templates/admin/user/new.tmpl +++ b/templates/admin/user/new.tmpl @@ -4,7 +4,7 @@ <div class="ui container"> {{template "base/alert" .}} <h4 class="ui top attached header"> - {{.i18n.Tr "admin.users.new_account"}} + {{.locale.Tr "admin.users.new_account"}} </h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> @@ -12,13 +12,13 @@ {{.CsrfTokenHtml}} <!-- Types and name --> <div class="inline required field {{if .Err_LoginType}}error{{end}}"> - <label>{{.i18n.Tr "admin.users.auth_source"}}</label> + <label>{{.locale.Tr "admin.users.auth_source"}}</label> <div class="ui selection type dropdown"> <input type="hidden" id="login_type" name="login_type" value="{{.login_type}}" data-password="required" required> - <div class="text">{{.i18n.Tr "admin.users.local"}}</div> + <div class="text">{{.locale.Tr "admin.users.local"}}</div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="item" data-value="0-0">{{.i18n.Tr "admin.users.local"}}</div> + <div class="item" data-value="0-0">{{.locale.Tr "admin.users.local"}}</div> {{range .Sources}} <div class="item" data-value="{{.Type.Int}}-{{.ID}}">{{.Name}}</div> {{end}} @@ -27,23 +27,23 @@ </div> <div class="inline field {{if .Err_Visibility}}error{{end}}"> - <span class="inline required field"><label for="visibility">{{.i18n.Tr "settings.visibility"}}</label></span> + <span class="inline required field"><label for="visibility">{{.locale.Tr "settings.visibility"}}</label></span> <div class="ui selection type dropdown"> <input type="hidden" id="visibility" name="visibility" value="{{if .visibility}}{{.visibility}}{{else}}{{printf "%d" .DefaultUserVisibilityMode}}{{end}}"> <div class="text"> - {{if .DefaultUserVisibilityMode.IsPublic}}{{.i18n.Tr "settings.visibility.public"}}{{end}} - {{if .DefaultUserVisibilityMode.IsLimited}}{{.i18n.Tr "settings.visibility.limited"}}{{end}} - {{if .DefaultUserVisibilityMode.IsPrivate}}{{.i18n.Tr "settings.visibility.private"}}{{end}} + {{if .DefaultUserVisibilityMode.IsPublic}}{{.locale.Tr "settings.visibility.public"}}{{end}} + {{if .DefaultUserVisibilityMode.IsLimited}}{{.locale.Tr "settings.visibility.limited"}}{{end}} + {{if .DefaultUserVisibilityMode.IsPrivate}}{{.locale.Tr "settings.visibility.private"}}{{end}} </div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> {{range $mode := .AllowedUserVisibilityModes}} {{if $mode.IsPublic}} - <div class="item tooltip" data-content="{{$.i18n.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.i18n.Tr "settings.visibility.public"}}</div> + <div class="item tooltip" data-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div> {{else if $mode.IsLimited}} - <div class="item tooltip" data-content="{{$.i18n.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.i18n.Tr "settings.visibility.limited"}}</div> + <div class="item tooltip" data-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div> {{else if $mode.IsPrivate}} - <div class="item tooltip" data-content="{{$.i18n.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.i18n.Tr "settings.visibility.private"}}</div> + <div class="item tooltip" data-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div> {{end}} {{end}} </div> @@ -51,25 +51,25 @@ </div> <div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .login_type "0-0"}}hide{{end}}"> - <label for="login_name">{{.i18n.Tr "admin.users.auth_login_name"}}</label> + <label for="login_name">{{.locale.Tr "admin.users.auth_login_name"}}</label> <input id="login_name" name="login_name" value="{{.login_name}}"> </div> <div class="required field {{if .Err_UserName}}error{{end}}"> - <label for="user_name">{{.i18n.Tr "username"}}</label> + <label for="user_name">{{.locale.Tr "username"}}</label> <input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required> </div> <div class="required field {{if .Err_Email}}error{{end}}"> - <label for="email">{{.i18n.Tr "email"}}</label> + <label for="email">{{.locale.Tr "email"}}</label> <input id="email" name="email" type="email" value="{{.email}}" required> </div> <div class="required local field {{if .Err_Password}}error{{end}} {{if not (eq .login_type "0-0")}}hide{{end}}"> - <label for="password">{{.i18n.Tr "password"}}</label> + <label for="password">{{.locale.Tr "password"}}</label> <input id="password" name="password" type="password" autocomplete="new-password" value="{{.password}}" {{if eq .login_type "0-0"}}required{{end}}> </div> <div class="inline field local{{if ne .login_type "0-0"}} hide{{end}}"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "auth.allow_password_change" }}</strong></label> + <label><strong>{{.locale.Tr "auth.allow_password_change" }}</strong></label> <input name="must_change_password" type="checkbox" checked> </div> </div> @@ -78,14 +78,14 @@ {{if .CanSendEmail}} <div class="inline field"> <div class="ui checkbox"> - <label><strong>{{.i18n.Tr "admin.users.send_register_notify"}}</strong></label> + <label><strong>{{.locale.Tr "admin.users.send_register_notify"}}</strong></label> <input name="send_notify" type="checkbox" {{if .send_notify}}checked{{end}}> </div> </div> {{end}} <div class="field"> - <button class="ui green button">{{.i18n.Tr "admin.users.new_account"}}</button> + <button class="ui green button">{{.locale.Tr "admin.users.new_account"}}</button> </div> </form> </div> |