diff --git a/templates/admin/applications/list.tmpl b/templates/admin/applications/list.tmpl
index a292051fd0..cbb66b1605 100644
--- a/templates/admin/applications/list.tmpl
+++ b/templates/admin/applications/list.tmpl
@@ -1,7 +1,7 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-				{{.locale.Tr "settings.applications"}}
+				{{ctx.Locale.Tr "settings.applications"}}
 		</h4>
 		{{template "user/settings/applications_oauth2_list" .}}
 	</div>
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl
index 814bddd8a4..25abefae00 100644
--- a/templates/admin/auth/edit.tmpl
+++ b/templates/admin/auth/edit.tmpl
@@ -1,7 +1,7 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin edit authentication")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.auths.edit"}}
+			{{ctx.Locale.Tr "admin.auths.edit"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="{{.Link}}" method="post">
@@ -9,12 +9,12 @@
 				{{.CsrfTokenHtml}}
 				<input type="hidden" name="id" value="{{.Source.ID}}">
 				<div class="inline field">
-					<label>{{$.locale.Tr "admin.auths.auth_type"}}</label>
+					<label>{{ctx.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="auth_name">{{.locale.Tr "admin.auths.auth_name"}}</label>
+					<label for="auth_name">{{ctx.Locale.Tr "admin.auths.auth_name"}}</label>
 					<input id="auth_name" name="name" value="{{.Source.Name}}" autofocus required>
 				</div>
 
@@ -22,7 +22,7 @@
 				{{if or .Source.IsLDAP .Source.IsDLDAP}}
 					{{$cfg:=.Source.Cfg}}
 					<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
-						<label>{{.locale.Tr "admin.auths.security_protocol"}}</label>
+						<label>{{ctx.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>
@@ -35,107 +35,107 @@
 						</div>
 					</div>
 					<div class="required field">
-						<label for="host">{{.locale.Tr "admin.auths.host"}}</label>
+						<label for="host">{{ctx.Locale.Tr "admin.auths.host"}}</label>
 						<input id="host" name="host" value="{{$cfg.Host}}" placeholder="mydomain.com" required>
 					</div>
 					<div class="required field">
-						<label for="port">{{.locale.Tr "admin.auths.port"}}</label>
+						<label for="port">{{ctx.Locale.Tr "admin.auths.port"}}</label>
 						<input id="port" name="port" value="{{$cfg.Port}}"  placeholder="636" required>
 					</div>
 					<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
 						<div class="ui checkbox">
-							<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
+							<label><strong>{{ctx.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">{{.locale.Tr "admin.auths.bind_dn"}}</label>
+							<label for="bind_dn">{{ctx.Locale.Tr "admin.auths.bind_dn"}}</label>
 							<input id="bind_dn" name="bind_dn" value="{{$cfg.BindDN}}" placeholder="cn=Search,dc=mydomain,dc=com">
 						</div>
 						<div class="field">
-							<label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label>
+							<label for="bind_password">{{ctx.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">{{.locale.Tr "admin.auths.user_base"}}</label>
+							<label for="user_base">{{ctx.Locale.Tr "admin.auths.user_base"}}</label>
 							<input id="user_base" name="user_base" value="{{$cfg.UserBase}}" placeholder="ou=Users,dc=mydomain,dc=com" {{if .Source.IsLDAP}}required{{end}}>
 					</div>
 					{{if .Source.IsDLDAP}}
 						<div class="required field">
-							<label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label>
+							<label for="user_dn">{{ctx.Locale.Tr "admin.auths.user_dn"}}</label>
 							<input id="user_dn" name="user_dn" value="{{$cfg.UserDN}}" placeholder="uid=%s,ou=Users,dc=mydomain,dc=com" required>
 						</div>
 					{{end}}
 					<div class="required field">
-						<label for="filter">{{.locale.Tr "admin.auths.filter"}}</label>
+						<label for="filter">{{ctx.Locale.Tr "admin.auths.filter"}}</label>
 						<input id="filter" name="filter" value="{{$cfg.Filter}}" placeholder="(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))" required>
 					</div>
 					<div class="field">
-						<label for="admin_filter">{{.locale.Tr "admin.auths.admin_filter"}}</label>
+						<label for="admin_filter">{{ctx.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">{{.locale.Tr "admin.auths.restricted_filter"}}</label>
+						<label for="restricted_filter">{{ctx.Locale.Tr "admin.auths.restricted_filter"}}</label>
 						<input id="restricted_filter" name="restricted_filter" value="{{$cfg.RestrictedFilter}}">
-						<p class="help">{{.locale.Tr "admin.auths.restricted_filter_helper"}}</p>
+						<p class="help">{{ctx.Locale.Tr "admin.auths.restricted_filter_helper"}}</p>
 					</div>
 					<div class="field">
-						<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"}}">
+						<label for="attribute_username">{{ctx.Locale.Tr "admin.auths.attribute_username"}}</label>
+						<input id="attribute_username" name="attribute_username" value="{{$cfg.AttributeUsername}}" placeholder="{{ctx.Locale.Tr "admin.auths.attribute_username_placeholder"}}">
 					</div>
 					<div class="field">
-						<label for="attribute_name">{{.locale.Tr "admin.auths.attribute_name"}}</label>
+						<label for="attribute_name">{{ctx.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">{{.locale.Tr "admin.auths.attribute_surname"}}</label>
+						<label for="attribute_surname">{{ctx.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">{{.locale.Tr "admin.auths.attribute_mail"}}</label>
+						<label for="attribute_mail">{{ctx.Locale.Tr "admin.auths.attribute_mail"}}</label>
 						<input id="attribute_mail" name="attribute_mail" value="{{$cfg.AttributeMail}}" placeholder="mail" required>
 					</div>
 					<div class="field">
-						<label for="attribute_ssh_public_key">{{.locale.Tr "admin.auths.attribute_ssh_public_key"}}</label>
+						<label for="attribute_ssh_public_key">{{ctx.Locale.Tr "admin.auths.attribute_ssh_public_key"}}</label>
 						<input id="attribute_ssh_public_key" name="attribute_ssh_public_key" value="{{$cfg.AttributeSSHPublicKey}}" placeholder="SshPublicKey">
 					</div>
 					<div class="field">
-						<label for="attribute_avatar">{{.locale.Tr "admin.auths.attribute_avatar"}}</label>
+						<label for="attribute_avatar">{{ctx.Locale.Tr "admin.auths.attribute_avatar"}}</label>
 						<input id="attribute_avatar" name="attribute_avatar" value="{{$cfg.AttributeAvatar}}" placeholder="jpegPhoto">
 					</div>
 
 					<!-- ldap group begin -->
 					<div class="inline field">
 						<div class="ui checkbox">
-							<label><strong>{{.locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label>
+							<label><strong>{{ctx.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}}gt-hidden{{end}}">
 						<div class="field">
-							<label>{{.locale.Tr "admin.auths.group_search_base"}}</label>
+							<label>{{ctx.Locale.Tr "admin.auths.group_search_base"}}</label>
 							<input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="ou=group,dc=mydomain,dc=com">
 						</div>
 						<div class="field">
-							<label>{{.locale.Tr "admin.auths.group_attribute_list_users"}}</label>
+							<label>{{ctx.Locale.Tr "admin.auths.group_attribute_list_users"}}</label>
 							<input name="group_member_uid" value="{{$cfg.GroupMemberUID}}" placeholder="memberUid">
 						</div>
 						<div class="field">
-							<label>{{.locale.Tr "admin.auths.user_attribute_in_group"}}</label>
+							<label>{{ctx.Locale.Tr "admin.auths.user_attribute_in_group"}}</label>
 							<input name="user_uid" value="{{$cfg.UserUID}}" placeholder="uid">
 						</div>
 						<div class="field">
-							<label>{{.locale.Tr "admin.auths.verify_group_membership"}}</label>
+							<label>{{ctx.Locale.Tr "admin.auths.verify_group_membership"}}</label>
 							<input name="group_filter" value="{{$cfg.GroupFilter}}" placeholder="(|(cn=gitea_users)(cn=admins))">
 						</div>
 						<div class="field">
-							<label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label>
+							<label>{{ctx.Locale.Tr "admin.auths.map_group_to_team"}}</label>
 							<textarea name="group_team_map" rows="5" placeholder='{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
 						</div>
 						<div class="ui checkbox">
-							<label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label>
+							<label>{{ctx.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>
@@ -144,31 +144,31 @@
 					{{if .Source.IsLDAP}}
 						<div class="inline field">
 							<div class="ui checkbox">
-								<label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label>
+								<label for="use_paged_search"><strong>{{ctx.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}} gt-hidden{{end}}">
-							<label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label>
+							<label for="search_page_size">{{ctx.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>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label>
+								<label><strong>{{ctx.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>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+							<label for="skip_local_two_fa"><strong>{{ctx.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">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+							<p class="help">{{ctx.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>{{.locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label>
+							<label for="allow_deactivate_all"><strong>{{ctx.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>
@@ -178,7 +178,7 @@
 				{{if .Source.IsSMTP}}
 					{{$cfg:=.Source.Cfg}}
 					<div class="inline required field">
-						<label>{{.locale.Tr "admin.auths.smtp_auth"}}</label>
+						<label>{{ctx.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>
@@ -191,47 +191,47 @@
 						</div>
 					</div>
 					<div class="required field">
-						<label for="smtp_host">{{.locale.Tr "admin.auths.smtphost"}}</label>
+						<label for="smtp_host">{{ctx.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">{{.locale.Tr "admin.auths.smtpport"}}</label>
+						<label for="smtp_port">{{ctx.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>{{.locale.Tr "admin.auths.force_smtps"}}</strong></label>
+							<label for="force_smtps"><strong>{{ctx.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">{{.locale.Tr "admin.auths.force_smtps_helper"}}</p>
+						<p class="help">{{ctx.Locale.Tr "admin.auths.force_smtps_helper"}}</p>
 					</div>
 					<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
 						<div class="ui checkbox">
-							<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
+							<label><strong>{{ctx.Locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
 							<input name="skip_verify" type="checkbox" {{if $cfg.SkipVerify}}checked{{end}}>
 						</div>
 					</div>
 					<div class="field">
-						<label for="helo_hostname">{{.locale.Tr "admin.auths.helo_hostname"}}</label>
+						<label for="helo_hostname">{{ctx.Locale.Tr "admin.auths.helo_hostname"}}</label>
 						<input id="helo_hostname" name="helo_hostname" value="{{$cfg.HeloHostname}}">
-						<p class="help">{{.locale.Tr "admin.auths.helo_hostname_helper"}}</p>
+						<p class="help">{{ctx.Locale.Tr "admin.auths.helo_hostname_helper"}}</p>
 					</div>
 					<div class="inline field">
 						<div class="ui checkbox">
-							<label for="disable_helo"><strong>{{.locale.Tr "admin.auths.disable_helo"}}</strong></label>
+							<label for="disable_helo"><strong>{{ctx.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">{{.locale.Tr "admin.auths.allowed_domains"}}</label>
+						<label for="allowed_domains">{{ctx.Locale.Tr "admin.auths.allowed_domains"}}</label>
 						<input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}">
-						<p class="help">{{.locale.Tr "admin.auths.allowed_domains_helper"}}</p>
+						<p class="help">{{ctx.Locale.Tr "admin.auths.allowed_domains_helper"}}</p>
 					</div>
 					<div class="optional field">
 						<div class="ui checkbox">
-							<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+							<label for="skip_local_two_fa"><strong>{{ctx.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">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+							<p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
 						</div>
 					</div>
 				{{end}}
@@ -240,18 +240,18 @@
 				{{if .Source.IsPAM}}
 					{{$cfg:=.Source.Cfg}}
 					<div class="required field">
-						<label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label>
+						<label for="pam_service_name">{{ctx.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">{{.locale.Tr "admin.auths.pam_email_domain"}}</label>
+						<label for="pam_email_domain">{{ctx.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>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+							<label for="skip_local_two_fa"><strong>{{ctx.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">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+							<p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
 						</div>
 					</div>
 				{{end}}
@@ -260,7 +260,7 @@
 				{{if .Source.IsOAuth2}}
 					{{$cfg:=.Source.Cfg}}
 					<div class="inline required field">
-						<label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label>
+						<label>{{ctx.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>
@@ -273,52 +273,52 @@
 						</div>
 					</div>
 					<div class="required field">
-						<label for="oauth2_key">{{.locale.Tr "admin.auths.oauth2_clientID"}}</label>
+						<label for="oauth2_key">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_clientSecret"}}</label>
+						<label for="oauth2_secret">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_icon_url"}}</label>
+						<label for="oauth2_icon_url">{{ctx.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">{{.locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
+						<label for="open_id_connect_auto_discovery_url">{{ctx.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>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+							<label for="skip_local_two_fa"><strong>{{ctx.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">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+							<p class="help">{{ctx.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>{{.locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label>
+							<label><strong>{{ctx.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">{{.locale.Tr "admin.auths.oauth2_authURL"}}</label>
+						<label for="oauth2_auth_url">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_tokenURL"}}</label>
+						<label for="oauth2_token_url">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_profileURL"}}</label>
+						<label for="oauth2_profile_url">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_emailURL"}}</label>
+						<label for="oauth2_email_url">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_tenant"}}</label>
+						<label for="oauth2_tenant">{{ctx.Locale.Tr "admin.auths.oauth2_tenant"}}</label>
 						<input id="oauth2_tenant" name="oauth2_tenant" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.Tenant}}{{end}}">
 					</div>
 
@@ -332,37 +332,37 @@
 					{{end}}{{end}}
 
 					<div class="field">
-						<label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label>
+						<label for="oauth2_scopes">{{ctx.Locale.Tr "admin.auths.oauth2_scopes"}}</label>
 						<input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{StringUtils.Join $cfg.Scopes ","}}{{end}}">
 					</div>
 					<div class="field">
-						<label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
+						<label for="oauth2_required_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
 						<input id="oauth2_required_claim_name" name="oauth2_required_claim_name" value="{{$cfg.RequiredClaimName}}">
-						<p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p>
+						<p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p>
 					</div>
 					<div class="field">
-						<label for="oauth2_required_claim_value">{{.locale.Tr "admin.auths.oauth2_required_claim_value"}}</label>
+						<label for="oauth2_required_claim_value">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value"}}</label>
 						<input id="oauth2_required_claim_value" name="oauth2_required_claim_value" value="{{$cfg.RequiredClaimValue}}">
-						<p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p>
+						<p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p>
 					</div>
 					<div class="field">
-						<label for="oauth2_group_claim_name">{{.locale.Tr "admin.auths.oauth2_group_claim_name"}}</label>
+						<label for="oauth2_group_claim_name">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_admin_group"}}</label>
+						<label for="oauth2_admin_group">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_restricted_group"}}</label>
+						<label for="oauth2_restricted_group">{{ctx.Locale.Tr "admin.auths.oauth2_restricted_group"}}</label>
 						<input id="oauth2_restricted_group" name="oauth2_restricted_group" value="{{$cfg.RestrictedGroup}}">
 					</div>
 					<div class="field">
-						<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
+						<label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
 						<textarea name="oauth2_group_team_map" rows="5" placeholder='{"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
 					</div>
 					<div class="ui checkbox">
-						<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>
+						<label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>
 						<input name="oauth2_group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}>
 					</div>
 				{{end}}
@@ -372,32 +372,32 @@
 					{{$cfg:=.Source.Cfg}}
 					<div class="field">
 						<div class="ui checkbox">
-							<label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label>
+							<label for="sspi_auto_create_users"><strong>{{ctx.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">{{.locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p>
+							<p class="help">{{ctx.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>{{.locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label>
+							<label for="sspi_auto_activate_users"><strong>{{ctx.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">{{.locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p>
+							<p class="help">{{ctx.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>{{.locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label>
+							<label for="sspi_strip_domain_names"><strong>{{ctx.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">{{.locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p>
+							<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p>
 						</div>
 					</div>
 					<div class="required field">
-						<label for="sspi_separator_replacement">{{.locale.Tr "admin.auths.sspi_separator_replacement"}}</label>
+						<label for="sspi_separator_replacement">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement"}}</label>
 						<input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{$cfg.SeparatorReplacement}}" required>
-						<p class="help">{{.locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p>
+						<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p>
 					</div>
 					<div class="field">
-						<label for="sspi_default_language">{{.locale.Tr "admin.auths.sspi_default_language"}}</label>
+						<label for="sspi_default_language">{{ctx.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"}}
@@ -409,50 +409,50 @@
 							{{end}}
 							</div>
 						</div>
-						<p class="help">{{.locale.Tr "admin.auths.sspi_default_language_helper"}}</p>
+						<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_default_language_helper"}}</p>
 					</div>
 				{{end}}
 				{{if .Source.IsLDAP}}
 					<div class="inline field">
 						<div class="ui checkbox">
-							<label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label>
+							<label><strong>{{ctx.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>{{.locale.Tr "admin.auths.activated"}}</strong></label>
+						<label><strong>{{ctx.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 primary button">{{.locale.Tr "admin.auths.update"}}</button>
-					<button class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.locale.Tr "admin.auths.delete"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "admin.auths.update"}}</button>
+					<button class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{ctx.Locale.Tr "admin.auths.delete"}}</button>
 				</div>
 			</form>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.auths.tips"}}
+			{{ctx.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 class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general"}}:</h5>
-			<p class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p>
+			<h5 class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general"}}:</h5>
+			<p class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p>
 		</div>
 	</div>
 
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "admin.auths.delete_auth_title"}}
+		{{ctx.Locale.Tr "admin.auths.delete_auth_title"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "admin.auths.delete_auth_desc"}}</p>
+		<p>{{ctx.Locale.Tr "admin.auths.delete_auth_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl
index c9f7c0d516..6483ec800c 100644
--- a/templates/admin/auth/list.tmpl
+++ b/templates/admin/auth/list.tmpl
@@ -1,9 +1,9 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin authentication")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.auths.auth_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
+			{{ctx.Locale.Tr "admin.auths.auth_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
 			<div class="ui right">
-				<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/auths/new">{{.locale.Tr "admin.auths.new"}}</a>
+				<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/auths/new">{{ctx.Locale.Tr "admin.auths.new"}}</a>
 			</div>
 		</h4>
 		<div class="ui attached table segment">
@@ -11,12 +11,12 @@
 				<thead>
 					<tr>
 						<th>ID</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>
+						<th>{{ctx.Locale.Tr "admin.auths.name"}}</th>
+						<th>{{ctx.Locale.Tr "admin.auths.type"}}</th>
+						<th>{{ctx.Locale.Tr "admin.auths.enabled"}}</th>
+						<th>{{ctx.Locale.Tr "admin.auths.updated"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.created"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.edit"}}</th>
 					</tr>
 				</thead>
 				<tbody>
diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl
index 31efa62e71..f32f77d5dc 100644
--- a/templates/admin/auth/new.tmpl
+++ b/templates/admin/auth/new.tmpl
@@ -1,7 +1,7 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin new authentication")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.auths.new"}}
+			{{ctx.Locale.Tr "admin.auths.new"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="{{.Link}}" method="post">
@@ -9,7 +9,7 @@
 				{{.CsrfTokenHtml}}
 				<!-- Types and name -->
 				<div class="inline required field {{if .Err_Type}}error{{end}}">
-					<label>{{.locale.Tr "admin.auths.auth_type"}}</label>
+					<label>{{ctx.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>
@@ -22,7 +22,7 @@
 					</div>
 				</div>
 				<div class="required inline field {{if .Err_Name}}error{{end}}">
-					<label for="auth_name">{{.locale.Tr "admin.auths.auth_name"}}</label>
+					<label for="auth_name">{{ctx.Locale.Tr "admin.auths.auth_name"}}</label>
 					<input id="auth_name" name="name" value="{{.name}}" autofocus required>
 				</div>
 
@@ -34,16 +34,16 @@
 
 				<!-- PAM -->
 				<div class="pam required field {{if not (eq .type 4)}}gt-hidden{{end}}">
-					<label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label>
+					<label for="pam_service_name">{{ctx.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">{{.locale.Tr "admin.auths.pam_email_domain"}}</label>
+					<label for="pam_email_domain">{{ctx.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)}}gt-hidden{{end}}">
 					<div class="ui checkbox">
-						<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+						<label for="skip_local_two_fa"><strong>{{ctx.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">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+						<p class="help">{{ctx.Locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
 					</div>
 				</div>
 
@@ -55,67 +55,67 @@
 
 				<div class="ldap field">
 					<div class="ui checkbox">
-						<label><strong>{{.locale.Tr "admin.auths.attributes_in_bind"}}</strong></label>
+						<label><strong>{{ctx.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)}}gt-hidden{{end}}">
 					<div class="ui checkbox">
-						<label><strong>{{.locale.Tr "admin.auths.syncenabled"}}</strong></label>
+						<label><strong>{{ctx.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>{{.locale.Tr "admin.auths.activated"}}</strong></label>
+						<label><strong>{{ctx.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 primary button">{{.locale.Tr "admin.auths.new"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "admin.auths.new"}}</button>
 				</div>
 			</form>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.auths.tips"}}
+			{{ctx.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 class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general"}}:</h5>
-			<p class="oauth2">{{.locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p>
+			<h5 class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general"}}:</h5>
+			<p class="oauth2">{{ctx.Locale.Tr "admin.auths.tips.oauth2.general.tip"}} <b id="oauth2-callback-url"></b></p>
 
-			<h5 class="ui top attached header">{{.locale.Tr "admin.auths.tip.oauth2_provider"}}</h5>
+			<h5 class="ui top attached header">{{ctx.Locale.Tr "admin.auths.tip.oauth2_provider"}}</h5>
 			<div class="ui attached segment">
 				<li>Bitbucket</li>
-				<span>{{.locale.Tr "admin.auths.tip.bitbucket"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.bitbucket"}}</span>
 				<li>Dropbox</li>
-				<span>{{.locale.Tr "admin.auths.tip.dropbox"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.dropbox"}}</span>
 				<li>Facebook</li>
-				<span>{{.locale.Tr "admin.auths.tip.facebook"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.facebook"}}</span>
 				<li>GitHub</li>
-				<span>{{.locale.Tr "admin.auths.tip.github"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.github"}}</span>
 				<li>GitLab</li>
-				<span>{{.locale.Tr "admin.auths.tip.gitlab"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.gitlab"}}</span>
 				<li>Google</li>
-				<span>{{.locale.Tr "admin.auths.tip.google_plus"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.google_plus"}}</span>
 				<li>OpenID Connect</li>
-				<span>{{.locale.Tr "admin.auths.tip.openid_connect"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.openid_connect"}}</span>
 				<li>Twitter</li>
-				<span>{{.locale.Tr "admin.auths.tip.twitter"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.twitter"}}</span>
 				<li>Discord</li>
-				<span>{{.locale.Tr "admin.auths.tip.discord"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.discord"}}</span>
 				<li>Gitea</li>
-				<span>{{.locale.Tr "admin.auths.tip.gitea"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.gitea"}}</span>
 				<li>Nextcloud</li>
-				<span>{{.locale.Tr "admin.auths.tip.nextcloud"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.nextcloud"}}</span>
 				<li>Yandex</li>
-				<span>{{.locale.Tr "admin.auths.tip.yandex"}}</span>
+				<span>{{ctx.Locale.Tr "admin.auths.tip.yandex"}}</span>
 				<li>Mastodon</li>
-				<span>{{.locale.Tr "admin.auths.tip.mastodon"}}</span>
+				<span>{{ctx.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 a2bd37be0c..a584ac7628 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))}}gt-hidden{{end}}">
 	<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
-		<label>{{.locale.Tr "admin.auths.security_protocol"}}</label>
+		<label>{{ctx.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">{{.locale.Tr "admin.auths.host"}}</label>
+		<label for="host">{{ctx.Locale.Tr "admin.auths.host"}}</label>
 		<input id="host" name="host" value="{{.host}}" placeholder="mydomain.com">
 	</div>
 	<div class="required field">
-		<label for="port">{{.locale.Tr "admin.auths.port"}}</label>
+		<label for="port">{{ctx.Locale.Tr "admin.auths.port"}}</label>
 		<input id="port" name="port" value="{{.port}}"  placeholder="636">
 	</div>
 	<div class="has-tls inline field {{if not .HasTLS}}gt-hidden{{end}}">
 		<div class="ui checkbox">
-			<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
+			<label><strong>{{ctx.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)}}gt-hidden{{end}}">
-		<label for="bind_dn">{{.locale.Tr "admin.auths.bind_dn"}}</label>
+		<label for="bind_dn">{{ctx.Locale.Tr "admin.auths.bind_dn"}}</label>
 		<input id="bind_dn" name="bind_dn" value="{{.bind_dn}}" placeholder="cn=Search,dc=mydomain,dc=com">
 	</div>
 	<div class="ldap field {{if not (eq .type 2)}}gt-hidden{{end}}">
-		<label for="bind_password">{{.locale.Tr "admin.auths.bind_password"}}</label>
+		<label for="bind_password">{{ctx.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">{{.locale.Tr "admin.auths.user_base"}}</label>
+		<label for="user_base">{{ctx.Locale.Tr "admin.auths.user_base"}}</label>
 		<input id="user_base" name="user_base" value="{{.user_base}}" placeholder="ou=Users,dc=mydomain,dc=com">
 	</div>
 	<div class="dldap required field {{if not (eq .type 5)}}gt-hidden{{end}}">
-		<label for="user_dn">{{.locale.Tr "admin.auths.user_dn"}}</label>
+		<label for="user_dn">{{ctx.Locale.Tr "admin.auths.user_dn"}}</label>
 		<input id="user_dn" name="user_dn" value="{{.user_dn}}" placeholder="uid=%s,ou=Users,dc=mydomain,dc=com">
 	</div>
 	<div class="required field">
-		<label for="filter">{{.locale.Tr "admin.auths.filter"}}</label>
+		<label for="filter">{{ctx.Locale.Tr "admin.auths.filter"}}</label>
 		<input id="filter" name="filter" value="{{.filter}}" placeholder="(&(objectClass=posixAccount)(|(uid=%[1]s)(mail=%[1]s)))">
 	</div>
 	<div class="field">
-		<label for="admin_filter">{{.locale.Tr "admin.auths.admin_filter"}}</label>
+		<label for="admin_filter">{{ctx.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">{{.locale.Tr "admin.auths.restricted_filter"}}</label>
+		<label for="restricted_filter">{{ctx.Locale.Tr "admin.auths.restricted_filter"}}</label>
 		<input id="restricted_filter" name="restricted_filter" value="{{.restricted_filter}}">
-		<p class="help">{{.locale.Tr "admin.auths.restricted_filter_helper"}}</p>
+		<p class="help">{{ctx.Locale.Tr "admin.auths.restricted_filter_helper"}}</p>
 	</div>
 	<div class="field">
-		<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"}}">
+		<label for="attribute_username">{{ctx.Locale.Tr "admin.auths.attribute_username"}}</label>
+		<input id="attribute_username" name="attribute_username" value="{{.attribute_username}}" placeholder="{{ctx.Locale.Tr "admin.auths.attribute_username_placeholder"}}">
 	</div>
 	<div class="field">
-		<label for="attribute_name">{{.locale.Tr "admin.auths.attribute_name"}}</label>
+		<label for="attribute_name">{{ctx.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">{{.locale.Tr "admin.auths.attribute_surname"}}</label>
+		<label for="attribute_surname">{{ctx.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">{{.locale.Tr "admin.auths.attribute_mail"}}</label>
+		<label for="attribute_mail">{{ctx.Locale.Tr "admin.auths.attribute_mail"}}</label>
 		<input id="attribute_mail" name="attribute_mail" value="{{.attribute_mail}}" placeholder="mail">
 	</div>
 	<div class="field">
-		<label for="attribute_ssh_public_key">{{.locale.Tr "admin.auths.attribute_ssh_public_key"}}</label>
+		<label for="attribute_ssh_public_key">{{ctx.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="SshPublicKey">
 	</div>
 	<div class="field">
-		<label for="attribute_avatar">{{.locale.Tr "admin.auths.attribute_avatar"}}</label>
+		<label for="attribute_avatar">{{ctx.Locale.Tr "admin.auths.attribute_avatar"}}</label>
 		<input id="attribute_avatar" name="attribute_avatar" value="{{.attribute_avatar}}" placeholder="jpegPhoto">
 	</div>
 
 	<!-- ldap group begin -->
 	<div class="inline field">
 		<div class="ui checkbox">
-			<label><strong>{{.locale.Tr "admin.auths.enable_ldap_groups"}}</strong></label>
+			<label><strong>{{ctx.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>{{.locale.Tr "admin.auths.group_search_base"}}</label>
+			<label>{{ctx.Locale.Tr "admin.auths.group_search_base"}}</label>
 			<input name="group_dn" value="{{.group_dn}}" placeholder="ou=group,dc=mydomain,dc=com">
 		</div>
 		<div class="field">
-			<label>{{.locale.Tr "admin.auths.group_attribute_list_users"}}</label>
+			<label>{{ctx.Locale.Tr "admin.auths.group_attribute_list_users"}}</label>
 			<input name="group_member_uid" value="{{.group_member_uid}}" placeholder="memberUid">
 		</div>
 		<div class="field">
-			<label>{{.locale.Tr "admin.auths.user_attribute_in_group"}}</label>
+			<label>{{ctx.Locale.Tr "admin.auths.user_attribute_in_group"}}</label>
 			<input name="user_uid" value="{{.user_uid}}" placeholder="uid">
 		</div>
 		<div class="field">
-			<label>{{.locale.Tr "admin.auths.verify_group_membership"}}</label>
+			<label>{{ctx.Locale.Tr "admin.auths.verify_group_membership"}}</label>
 			<input name="group_filter" value="{{.group_filter}}" placeholder="(|(cn=gitea_users)(cn=admins))">
 		</div>
 		<div class="field">
-			<label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label>
+			<label>{{ctx.Locale.Tr "admin.auths.map_group_to_team"}}</label>
 			<textarea name="group_team_map" rows="5" placeholder='{"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.group_team_map}}</textarea>
 		</div>
 		<div class="ui checkbox">
-			<label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label>
+			<label>{{ctx.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)}}gt-hidden{{end}}">
 		<div class="ui checkbox">
-			<label for="use_paged_search"><strong>{{.locale.Tr "admin.auths.use_paged_search"}}</strong></label>
+			<label for="use_paged_search"><strong>{{ctx.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)}}gt-hidden{{end}}">
-		<label for="search_page_size">{{.locale.Tr "admin.auths.search_page_size"}}</label>
+		<label for="search_page_size">{{ctx.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>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+			<label for="skip_local_two_fa"><strong>{{ctx.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">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+			<p class="help">{{ctx.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>{{.locale.Tr "admin.auths.allow_deactivate_all"}}</strong></label>
+			<label for="allow_deactivate_all"><strong>{{ctx.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 aaa8b7fe2d..63ad77e67b 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)}}gt-hidden{{end}}">
 	<div class="inline required field">
-		<label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label>
+		<label>{{ctx.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">{{.locale.Tr "admin.auths.oauth2_clientID"}}</label>
+		<label for="oauth2_key">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_clientSecret"}}</label>
+		<label for="oauth2_secret">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_icon_url"}}</label>
+		<label for="oauth2_icon_url">{{ctx.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{{if .Err_DiscoveryURL}} error{{end}}">
-		<label for="open_id_connect_auto_discovery_url">{{.locale.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label>
+		<label for="open_id_connect_auto_discovery_url">{{ctx.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>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+			<label for="skip_local_two_fa"><strong>{{ctx.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">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+			<p class="help">{{ctx.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>{{.locale.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label>
+			<label><strong>{{ctx.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">{{.locale.Tr "admin.auths.oauth2_authURL"}}</label>
+		<label for="oauth2_auth_url">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_tokenURL"}}</label>
+		<label for="oauth2_token_url">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_profileURL"}}</label>
+		<label for="oauth2_profile_url">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_emailURL"}}</label>
+		<label for="oauth2_email_url">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_tenant"}}</label>
+		<label for="oauth2_tenant">{{ctx.Locale.Tr "admin.auths.oauth2_tenant"}}</label>
 		<input id="oauth2_tenant" name="oauth2_tenant" value="{{.oauth2_tenant}}">
 	</div>
 
@@ -73,37 +73,37 @@
 	{{end}}{{end}}
 
 	<div class="field">
-		<label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label>
+		<label for="oauth2_scopes">{{ctx.Locale.Tr "admin.auths.oauth2_scopes"}}</label>
 		<input id="oauth2_scopes" name="oauth2_scopes" value="{{.oauth2_scopes}}">
 	</div>
 	<div class="field">
-		<label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
+		<label for="oauth2_required_claim_name">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
 		<input id="oauth2_required_claim_name" name="oauth2_required_claim_name" value="{{.oauth2_required_claim_name}}">
-		<p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p>
+		<p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_name_helper"}}</p>
 	</div>
 	<div class="field">
-		<label for="oauth2_required_claim_value">{{.locale.Tr "admin.auths.oauth2_required_claim_value"}}</label>
+		<label for="oauth2_required_claim_value">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value"}}</label>
 		<input id="oauth2_required_claim_value" name="oauth2_required_claim_value" value="{{.oauth2_required_claim_value}}">
-		<p class="help">{{.locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p>
+		<p class="help">{{ctx.Locale.Tr "admin.auths.oauth2_required_claim_value_helper"}}</p>
 	</div>
 	<div class="field">
-		<label for="oauth2_group_claim_name">{{.locale.Tr "admin.auths.oauth2_group_claim_name"}}</label>
+		<label for="oauth2_group_claim_name">{{ctx.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">{{.locale.Tr "admin.auths.oauth2_admin_group"}}</label>
+		<label for="oauth2_admin_group">{{ctx.Locale.Tr "admin.auths.oauth2_admin_group"}}</label>
 		<input id="oauth2_admin_group" name="oauth2_admin_group" value="{{.oauth2_admin_group}}">
 	</div>
 	<div class="field">
-		<label for="oauth2_restricted_group">{{.locale.Tr "admin.auths.oauth2_restricted_group"}}</label>
+		<label for="oauth2_restricted_group">{{ctx.Locale.Tr "admin.auths.oauth2_restricted_group"}}</label>
 		<input id="oauth2_restricted_group" name="oauth2_restricted_group" value="{{.oauth2_restricted_group}}">
 	</div>
 	<div class="field">
-		<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
+		<label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
 		<textarea name="oauth2_group_team_map" rows="5" placeholder='{"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.oauth2_group_team_map}}</textarea>
 	</div>
 	<div class="ui checkbox">
-		<label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>
+		<label>{{ctx.Locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>
 		<input name="oauth2_group_team_map_removal" type="checkbox" {{if .oauth2_group_team_map_removal}}checked{{end}}>
 	</div>
 </div>
diff --git a/templates/admin/auth/source/smtp.tmpl b/templates/admin/auth/source/smtp.tmpl
index e83f7afb69..c4b0b0e7e4 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)}}gt-hidden{{end}}">
 	<div class="inline required field">
-		<label>{{.locale.Tr "admin.auths.smtp_auth"}}</label>
+		<label>{{ctx.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">{{.locale.Tr "admin.auths.smtphost"}}</label>
+		<label for="smtp_host">{{ctx.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">{{.locale.Tr "admin.auths.smtpport"}}</label>
+		<label for="smtp_port">{{ctx.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>{{.locale.Tr "admin.auths.force_smtps"}}</strong></label>
+			<label for="force_smtps"><strong>{{ctx.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">{{.locale.Tr "admin.auths.force_smtps_helper"}}</p>
+			<p class="help">{{ctx.Locale.Tr "admin.auths.force_smtps_helper"}}</p>
 		</div>
 	</div>
 	<div class="inline field">
 		<div class="ui checkbox">
-			<label><strong>{{.locale.Tr "admin.auths.skip_tls_verify"}}</strong></label>
+			<label><strong>{{ctx.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">{{.locale.Tr "admin.auths.helo_hostname"}}</label>
+		<label for="helo_hostname">{{ctx.Locale.Tr "admin.auths.helo_hostname"}}</label>
 		<input id="helo_hostname" name="helo_hostname" value="{{.helo_hostname}}">
-		<p class="help">{{.locale.Tr "admin.auths.helo_hostname_helper"}}</p>
+		<p class="help">{{ctx.Locale.Tr "admin.auths.helo_hostname_helper"}}</p>
 	</div>
 	<div class="inline field">
 		<div class="ui checkbox">
-			<label for="disable_helo"><strong>{{.locale.Tr "admin.auths.disable_helo"}}</strong></label>
+			<label for="disable_helo"><strong>{{ctx.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">{{.locale.Tr "admin.auths.allowed_domains"}}</label>
+		<label for="allowed_domains">{{ctx.Locale.Tr "admin.auths.allowed_domains"}}</label>
 		<input id="allowed_domains" name="allowed_domains" value="{{.allowed_domains}}">
-		<p class="help">{{.locale.Tr "admin.auths.allowed_domains_helper"}}</p>
+		<p class="help">{{ctx.Locale.Tr "admin.auths.allowed_domains_helper"}}</p>
 	</div>
 	<div class="optional field">
 		<div class="ui checkbox">
-			<label for="skip_local_two_fa"><strong>{{.locale.Tr "admin.auths.skip_local_two_fa"}}</strong></label>
+			<label for="skip_local_two_fa"><strong>{{ctx.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">{{.locale.Tr "admin.auths.skip_local_two_fa_helper"}}</p>
+			<p class="help">{{ctx.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 9608616e1b..f835e89bdf 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)}}gt-hidden{{end}}">
 	<div class="field">
 		<div class="ui checkbox">
-			<label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label>
+			<label for="sspi_auto_create_users"><strong>{{ctx.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">{{.locale.Tr "admin.auths.sspi_auto_create_users_helper"}}</p>
+			<p class="help">{{ctx.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>{{.locale.Tr "admin.auths.sspi_auto_activate_users"}}</strong></label>
+			<label for="sspi_auto_activate_users"><strong>{{ctx.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">{{.locale.Tr "admin.auths.sspi_auto_activate_users_helper"}}</p>
+			<p class="help">{{ctx.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>{{.locale.Tr "admin.auths.sspi_strip_domain_names"}}</strong></label>
+			<label for="sspi_strip_domain_names"><strong>{{ctx.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">{{.locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p>
+			<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_strip_domain_names_helper"}}</p>
 		</div>
 	</div>
 	<div class="required field">
-		<label for="sspi_separator_replacement">{{.locale.Tr "admin.auths.sspi_separator_replacement"}}</label>
+		<label for="sspi_separator_replacement">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement"}}</label>
 		<input id="sspi_separator_replacement" name="sspi_separator_replacement" value="{{.SSPISeparatorReplacement}}">
-		<p class="help">{{.locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p>
+		<p class="help">{{ctx.Locale.Tr "admin.auths.sspi_separator_replacement_helper"}}</p>
 	</div>
 	<div class="field">
-		<label for="sspi_default_language">{{.locale.Tr "admin.auths.sspi_default_language"}}</label>
+		<label for="sspi_default_language">{{ctx.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">{{.locale.Tr "admin.auths.sspi_default_language_helper"}}</p>
+		<p class="help">{{ctx.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 22f839bf05..d4bba8c042 100644
--- a/templates/admin/base/search.tmpl
+++ b/templates/admin/base/search.tmpl
@@ -2,22 +2,22 @@
 	<form class="ui form ignore-dirty gt-f1">
 		<div class="ui fluid action input">
 			{{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}}
-			<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+			<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 		</div>
 	</form>
 	<!-- Sort -->
 	<div class="ui dropdown type jump item gt-mr-0">
 		<span class="text">
-			{{.locale.Tr "repo.issues.filter_sort"}}
+			{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 		</span>
 		{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 		<div class="menu">
-			<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 or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+			<a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
+			<a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
+			<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.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}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+			<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
 		</div>
 	</div>
 </div>
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index c29d1dbf30..57722f9898 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -1,82 +1,82 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.config.server_config"}}
+			{{ctx.Locale.Tr "admin.config.server_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.app_name"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.app_name"}}</dt>
 				<dd>{{AppName}}</dd>
-				<dt>{{.locale.Tr "admin.config.app_ver"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.app_ver"}}</dt>
 				<dd>{{AppVer}}{{.AppBuiltWith}}</dd>
-				<dt>{{.locale.Tr "admin.config.custom_conf"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.custom_conf"}}</dt>
 				<dd>{{.CustomConf}}</dd>
-				<dt>{{.locale.Tr "admin.config.app_url"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.app_url"}}</dt>
 				<dd>{{.AppUrl}}</dd>
-				<dt>{{.locale.Tr "admin.config.domain"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.domain"}}</dt>
 				<dd>{{.Domain}}</dd>
-				<dt>{{.locale.Tr "admin.config.offline_mode"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.offline_mode"}}</dt>
 				<dd>{{if .OfflineMode}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.disable_router_log"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.disable_router_log"}}</dt>
 				<dd>{{if .DisableRouterLog}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
 
 				<div class="divider"></div>
 
-				<dt>{{.locale.Tr "admin.config.run_user"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.run_user"}}</dt>
 				<dd>{{.RunUser}}</dd>
-				<dt>{{.locale.Tr "admin.config.run_mode"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.run_mode"}}</dt>
 				<dd>{{.RunMode}}</dd>
 
 				<div class="divider"></div>
 
-				<dt>{{.locale.Tr "admin.config.git_version"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.git_version"}}</dt>
 				<dd>{{.GitVersion}}</dd>
 
 				<div class="divider"></div>
 
-				<dt>{{.locale.Tr "admin.config.app_data_path"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.app_data_path"}}</dt>
 				<dd>{{.AppDataPath}}</dd>
-				<dt>{{.locale.Tr "admin.config.repo_root_path"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.repo_root_path"}}</dt>
 				<dd>{{.RepoRootPath}}</dd>
-				<dt>{{.locale.Tr "admin.config.custom_file_root_path"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.custom_file_root_path"}}</dt>
 				<dd>{{.CustomRootPath}}</dd>
-				<dt>{{.locale.Tr "admin.config.log_file_root_path"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.log_file_root_path"}}</dt>
 				<dd>{{.LogRootPath}}</dd>
-				<dt>{{.locale.Tr "admin.config.script_type"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.script_type"}}</dt>
 				<dd>{{.ScriptType}}</dd>
-				<dt>{{.locale.Tr "admin.config.reverse_auth_user"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.reverse_auth_user"}}</dt>
 				<dd>{{.ReverseProxyAuthUser}}</dd>
 			</dl>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.config.ssh_config"}}
+			{{ctx.Locale.Tr "admin.config.ssh_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.ssh_enabled"}}</dt>
+				<dt>{{ctx.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>{{.locale.Tr "admin.config.ssh_start_builtin_server"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.ssh_start_builtin_server"}}</dt>
 					<dd>{{if .SSH.StartBuiltinServer}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-					<dt>{{.locale.Tr "admin.config.ssh_domain"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.ssh_domain"}}</dt>
 					<dd>{{.SSH.Domain}}</dd>
-					<dt>{{.locale.Tr "admin.config.ssh_port"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.ssh_port"}}</dt>
 					<dd>{{.SSH.Port}}</dd>
-					<dt>{{.locale.Tr "admin.config.ssh_listen_port"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.ssh_listen_port"}}</dt>
 					<dd>{{.SSH.ListenPort}}</dd>
 
 					{{if not .SSH.StartBuiltinServer}}
-						<dt>{{.locale.Tr "admin.config.ssh_root_path"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.ssh_root_path"}}</dt>
 						<dd>{{.SSH.RootPath}}</dd>
-						<dt>{{.locale.Tr "admin.config.ssh_key_test_path"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.ssh_key_test_path"}}</dt>
 						<dd>{{.SSH.KeyTestPath}}</dd>
-						<dt>{{.locale.Tr "admin.config.ssh_keygen_path"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.ssh_keygen_path"}}</dt>
 						<dd>{{.SSH.KeygenPath}}</dd>
-						<dt>{{.locale.Tr "admin.config.ssh_minimum_key_size_check"}}</dt>
+						<dt>{{ctx.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>{{.locale.Tr "admin.config.ssh_minimum_key_sizes"}}</dt>
+							<dt>{{ctx.Locale.Tr "admin.config.ssh_minimum_key_sizes"}}</dt>
 							<dd>{{.SSH.MinimumKeySizes}}</dd>
 						{{end}}
 					{{end}}
@@ -85,160 +85,160 @@
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.config.lfs_config"}}
+			{{ctx.Locale.Tr "admin.config.lfs_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.lfs_enabled"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.lfs_enabled"}}</dt>
 				<dd>{{if .LFS.StartServer}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
 				{{if .LFS.StartServer}}
-					<dt>{{.locale.Tr "admin.config.lfs_content_path"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.lfs_content_path"}}</dt>
 					<dd>{{JsonUtils.EncodeToString .LFS.Storage.ToShadowCopy}}</dd>
-					<dt>{{.locale.Tr "admin.config.lfs_http_auth_expiry"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.lfs_http_auth_expiry"}}</dt>
 					<dd>{{.LFS.HTTPAuthExpiry}}</dd>
 				{{end}}
 			</dl>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.config.db_config"}}
+			{{ctx.Locale.Tr "admin.config.db_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.db_type"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.db_type"}}</dt>
 				<dd>{{.DbCfg.Type}}</dd>
 				{{if not (eq .DbCfg.Type "sqlite3")}}
-					<dt>{{.locale.Tr "admin.config.db_host"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.db_host"}}</dt>
 					<dd>{{if .DbCfg.Host}}{{.DbCfg.Host}}{{else}}-{{end}}</dd>
-					<dt>{{.locale.Tr "admin.config.db_name"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.db_name"}}</dt>
 					<dd>{{if .DbCfg.Name}}{{.DbCfg.Name}}{{else}}-{{end}}</dd>
-					<dt>{{.locale.Tr "admin.config.db_user"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.db_user"}}</dt>
 					<dd>{{if .DbCfg.User}}{{.DbCfg.User}}{{else}}-{{end}}</dd>
 				{{end}}
 				{{if eq .DbCfg.Type "postgres"}}
-					<dt>{{.locale.Tr "admin.config.db_schema"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.db_schema"}}</dt>
 					<dd>{{if .DbCfg.Schema}}{{.DbCfg.Schema}}{{else}}-{{end}}</dd>
-					<dt>{{.locale.Tr "admin.config.db_ssl_mode"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.db_ssl_mode"}}</dt>
 					<dd>{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}}</dd>
 				{{end}}
 				{{if eq .DbCfg.Type "sqlite3"}}
-					<dt>{{.locale.Tr "admin.config.db_path"}}</dt>
+					<dt>{{ctx.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">
-			{{.locale.Tr "admin.config.service_config"}}
+			{{ctx.Locale.Tr "admin.config.service_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.register_email_confirm"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.register_email_confirm"}}</dt>
 				<dd>{{if .Service.RegisterEmailConfirm}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.disable_register"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.disable_register"}}</dt>
 				<dd>{{if .Service.DisableRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.allow_only_internal_registration"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.allow_only_internal_registration"}}</dt>
 				<dd>{{if .Service.AllowOnlyInternalRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.allow_only_external_registration"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.allow_only_external_registration"}}</dt>
 				<dd>{{if .Service.AllowOnlyExternalRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.show_registration_button"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.show_registration_button"}}</dt>
 				<dd>{{if .Service.ShowRegistrationButton}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.enable_openid_signup"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.enable_openid_signup"}}</dt>
 				<dd>{{if .Service.EnableOpenIDSignUp}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.enable_openid_signin"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.enable_openid_signin"}}</dt>
 				<dd>{{if .Service.EnableOpenIDSignIn}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.require_sign_in_view"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.require_sign_in_view"}}</dt>
 				<dd>{{if .Service.RequireSignInView}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.mail_notify"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.mail_notify"}}</dt>
 				<dd>{{if .Service.EnableNotifyMail}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.disable_key_size_check"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.disable_key_size_check"}}</dt>
 				<dd>{{if .SSH.MinimumKeySizeCheck}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.enable_captcha"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.enable_captcha"}}</dt>
 				<dd>{{if .Service.EnableCaptcha}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.default_keep_email_private"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.default_keep_email_private"}}</dt>
 				<dd>{{if .Service.DefaultKeepEmailPrivate}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.default_allow_create_organization"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.default_allow_create_organization"}}</dt>
 				<dd>{{if .Service.DefaultAllowCreateOrganization}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.enable_timetracking"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.enable_timetracking"}}</dt>
 				<dd>{{if .Service.EnableTimetracking}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
 				{{if .Service.EnableTimetracking}}
-					<dt>{{.locale.Tr "admin.config.default_enable_timetracking"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.default_enable_timetracking"}}</dt>
 					<dd>{{if .Service.DefaultEnableTimetracking}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-					<dt>{{.locale.Tr "admin.config.default_allow_only_contributors_to_track_time"}}</dt>
+					<dt>{{ctx.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>{{.locale.Tr "admin.config.default_visibility_organization"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.default_visibility_organization"}}</dt>
 				<dd>{{.Service.DefaultOrgVisibility}}</dd>
 
-				<dt>{{.locale.Tr "admin.config.no_reply_address"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.no_reply_address"}}</dt>
 				<dd>{{if .Service.NoReplyAddress}}{{.Service.NoReplyAddress}}{{else}}-{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.default_enable_dependencies"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.default_enable_dependencies"}}</dt>
 				<dd>{{if .Service.DefaultEnableDependencies}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
 				<div class="divider"></div>
-				<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>
+				<dt>{{ctx.Locale.Tr "admin.config.active_code_lives"}}</dt>
+				<dd>{{.Service.ActiveCodeLives}} {{ctx.Locale.Tr "tool.raw_minutes"}}</dd>
+				<dt>{{ctx.Locale.Tr "admin.config.reset_password_code_lives"}}</dt>
+				<dd>{{.Service.ResetPwdCodeLives}} {{ctx.Locale.Tr "tool.raw_minutes"}}</dd>
 			</dl>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.config.webhook_config"}}
+			{{ctx.Locale.Tr "admin.config.webhook_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.queue_length"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.queue_length"}}</dt>
 				<dd>{{.Webhook.QueueLength}}</dd>
-				<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>
+				<dt>{{ctx.Locale.Tr "admin.config.deliver_timeout"}}</dt>
+				<dd>{{.Webhook.DeliverTimeout}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
+				<dt>{{ctx.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">
-			{{.locale.Tr "admin.config.mailer_config"}}
+			{{ctx.Locale.Tr "admin.config.mailer_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.mailer_enabled"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.mailer_enabled"}}</dt>
 				<dd>{{if .MailerEnabled}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
 				{{if .MailerEnabled}}
-					<dt>{{.locale.Tr "admin.config.mailer_name"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.mailer_name"}}</dt>
 					<dd>{{.Mailer.Name}}</dd>
 					{{if eq .Mailer.Protocol "sendmail"}}
-						<dt>{{.locale.Tr "admin.config.mailer_use_sendmail"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.mailer_use_sendmail"}}</dt>
 						<dd>{{svg "octicon-check"}}</dd>
-						<dt>{{.locale.Tr "admin.config.mailer_sendmail_path"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.mailer_sendmail_path"}}</dt>
 						<dd>{{.Mailer.SendmailPath}}</dd>
-						<dt>{{.locale.Tr "admin.config.mailer_sendmail_args"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.mailer_sendmail_args"}}</dt>
 						<dd>{{.Mailer.SendmailArgs}}</dd>
-						<dt>{{.locale.Tr "admin.config.mailer_sendmail_timeout"}}</dt>
-						<dd>{{.Mailer.SendmailTimeout}} {{.locale.Tr "tool.raw_seconds"}}</dd>
+						<dt>{{ctx.Locale.Tr "admin.config.mailer_sendmail_timeout"}}</dt>
+						<dd>{{.Mailer.SendmailTimeout}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
 					{{else if eq .Mailer.Protocol "dummy"}}
-						<dt>{{.locale.Tr "admin.config.mailer_use_dummy"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.mailer_use_dummy"}}</dt>
 						<dd>{{svg "octicon-check"}}</dd>
 					{{else}}{{/* SMTP family */}}
-						<dt>{{.locale.Tr "admin.config.mailer_protocol"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.mailer_protocol"}}</dt>
 						<dd>{{.Mailer.Protocol}}</dd>
-						<dt>{{.locale.Tr "admin.config.mailer_enable_helo"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.mailer_enable_helo"}}</dt>
 						<dd>{{if .Mailer.EnableHelo}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-						<dt>{{.locale.Tr "admin.config.mailer_smtp_addr"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.mailer_smtp_addr"}}</dt>
 						<dd>{{.Mailer.SMTPAddr}}</dd>
-						<dt>{{.locale.Tr "admin.config.mailer_smtp_port"}}</dt>
+						<dt>{{ctx.Locale.Tr "admin.config.mailer_smtp_port"}}</dt>
 						<dd>{{.Mailer.SMTPPort}}</dd>
 					{{end}}
-					<dt>{{.locale.Tr "admin.config.mailer_user"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.mailer_user"}}</dt>
 					<dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd>
 					<div class="divider"></div>
-					<dt class="gt-py-2">{{.locale.Tr "admin.config.send_test_mail"}}</dt>
+					<dt class="gt-py-2">{{ctx.Locale.Tr "admin.config.send_test_mail"}}</dt>
 					<dd>
 						<form class="ui form ignore-dirty" action="{{AppSubUrl}}/admin/config/test_mail" method="post">
 							{{.CsrfTokenHtml}}
 							<div class="ui tiny input">
-								<input type="email" name="email" placeholder="{{.locale.Tr "admin.config.test_email_placeholder"}}" size="29" required>
+								<input type="email" name="email" placeholder="{{ctx.Locale.Tr "admin.config.test_email_placeholder"}}" size="29" required>
 							</div>
-							<button class="ui tiny primary button">{{.locale.Tr "admin.config.send_test_mail_submit"}}</button>
+							<button class="ui tiny primary button">{{ctx.Locale.Tr "admin.config.send_test_mail_submit"}}</button>
 						</form>
 					</dd>
 				{{end}}
@@ -246,118 +246,118 @@
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.config.cache_config"}}
+			{{ctx.Locale.Tr "admin.config.cache_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.cache_adapter"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.cache_adapter"}}</dt>
 				<dd>{{.CacheAdapter}}</dd>
 				{{if eq .CacheAdapter "memory"}}
-					<dt>{{.locale.Tr "admin.config.cache_interval"}}</dt>
-					<dd>{{.CacheInterval}} {{.locale.Tr "tool.raw_seconds"}}</dd>
+					<dt>{{ctx.Locale.Tr "admin.config.cache_interval"}}</dt>
+					<dd>{{.CacheInterval}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
 				{{end}}
 				{{if .CacheConn}}
-					<dt>{{.locale.Tr "admin.config.cache_conn"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.cache_conn"}}</dt>
 					<dd><code>{{.CacheConn}}</code></dd>
-					<dt>{{.locale.Tr "admin.config.cache_item_ttl"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.cache_item_ttl"}}</dt>
 					<dd><code>{{.CacheItemTTL}}</code></dd>
 				{{end}}
 			</dl>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.config.session_config"}}
+			{{ctx.Locale.Tr "admin.config.session_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.session_provider"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.session_provider"}}</dt>
 				<dd>{{.SessionConfig.Provider}}</dd>
-				<dt>{{.locale.Tr "admin.config.provider_config"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.provider_config"}}</dt>
 				<dd><code>{{if .SessionConfig.ProviderConfig}}{{.SessionConfig.ProviderConfig}}{{else}}-{{end}}</code></dd>
-				<dt>{{.locale.Tr "admin.config.cookie_name"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.cookie_name"}}</dt>
 				<dd>{{.SessionConfig.CookieName}}</dd>
-				<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>
+				<dt>{{ctx.Locale.Tr "admin.config.gc_interval_time"}}</dt>
+				<dd>{{.SessionConfig.Gclifetime}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
+				<dt>{{ctx.Locale.Tr "admin.config.session_life_time"}}</dt>
+				<dd>{{.SessionConfig.Maxlifetime}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
+				<dt>{{ctx.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">
-			{{.locale.Tr "admin.config.picture_config"}}
+			{{ctx.Locale.Tr "admin.config.picture_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.disable_gravatar"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.disable_gravatar"}}</dt>
 				<dd>
 					<div class="ui toggle checkbox">
-						<input type="checkbox" name="picture.disable_gravatar" version="{{.SystemSettings.GetVersion "picture.disable_gravatar"}}"{{if .SystemSettings.GetBool "picture.disable_gravatar"}} checked{{end}} title="{{.locale.Tr "admin.config.disable_gravatar"}}">
+						<input type="checkbox" name="picture.disable_gravatar" version="{{.SystemSettings.GetVersion "picture.disable_gravatar"}}"{{if .SystemSettings.GetBool "picture.disable_gravatar"}} checked{{end}} title="{{ctx.Locale.Tr "admin.config.disable_gravatar"}}">
 					</div>
 				</dd>
 				<div class="divider"></div>
-				<dt>{{.locale.Tr "admin.config.enable_federated_avatar"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}</dt>
 				<dd>
 					<div class="ui toggle checkbox">
-						<input type="checkbox" name="picture.enable_federated_avatar" version="{{.SystemSettings.GetVersion "picture.enable_federated_avatar"}}"{{if .SystemSettings.GetBool "picture.enable_federated_avatar"}} checked{{end}} title="{{.locale.Tr "admin.config.enable_federated_avatar"}}">
+						<input type="checkbox" name="picture.enable_federated_avatar" version="{{.SystemSettings.GetVersion "picture.enable_federated_avatar"}}"{{if .SystemSettings.GetBool "picture.enable_federated_avatar"}} checked{{end}} title="{{ctx.Locale.Tr "admin.config.enable_federated_avatar"}}">
 					</div>
 				</dd>
 			</dl>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.config.git_config"}}
+			{{ctx.Locale.Tr "admin.config.git_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.config.git_disable_diff_highlight"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.git_disable_diff_highlight"}}</dt>
 				<dd>{{if .Git.DisableDiffHighlight}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
-				<dt>{{.locale.Tr "admin.config.git_max_diff_lines"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.git_max_diff_lines"}}</dt>
 				<dd>{{.Git.MaxGitDiffLines}}</dd>
-				<dt>{{.locale.Tr "admin.config.git_max_diff_line_characters"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.git_max_diff_line_characters"}}</dt>
 				<dd>{{.Git.MaxGitDiffLineCharacters}}</dd>
-				<dt>{{.locale.Tr "admin.config.git_max_diff_files"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.git_max_diff_files"}}</dt>
 				<dd>{{.Git.MaxGitDiffFiles}}</dd>
-				<dt>{{.locale.Tr "admin.config.git_gc_args"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.config.git_gc_args"}}</dt>
 				<dd><code>{{.Git.GCArgs}}</code></dd>
 
 				<div class="divider"></div>
 
-				<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>
+				<dt>{{ctx.Locale.Tr "admin.config.git_migrate_timeout"}}</dt>
+				<dd>{{.Git.Timeout.Migrate}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
+				<dt>{{ctx.Locale.Tr "admin.config.git_mirror_timeout"}}</dt>
+				<dd>{{.Git.Timeout.Mirror}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
+				<dt>{{ctx.Locale.Tr "admin.config.git_clone_timeout"}}</dt>
+				<dd>{{.Git.Timeout.Clone}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
+				<dt>{{ctx.Locale.Tr "admin.config.git_pull_timeout"}}</dt>
+				<dd>{{.Git.Timeout.Pull}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
+				<dt>{{ctx.Locale.Tr "admin.config.git_gc_timeout"}}</dt>
+				<dd>{{.Git.Timeout.GC}} {{ctx.Locale.Tr "tool.raw_seconds"}}</dd>
 			</dl>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.config.log_config"}}
+			{{ctx.Locale.Tr "admin.config.log_config"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
 				{{if .Loggers.xorm.IsEnabled}}
-					<dt>{{$.locale.Tr "admin.config.xorm_log_sql"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.xorm_log_sql"}}</dt>
 					<dd>{{if $.LogSQL}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
 				{{end}}
 
 				{{if .Loggers.access.IsEnabled}}
-					<dt>{{$.locale.Tr "admin.config.access_log_template"}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.access_log_template"}}</dt>
 					<dd><code>{{$.AccessLogTemplate}}</code></dd>
 				{{end}}
 
 				{{range $loggerName, $loggerDetail := .Loggers}}
-					<dt>{{$.locale.Tr "admin.config.logger_name_fmt" $loggerName}}</dt>
+					<dt>{{ctx.Locale.Tr "admin.config.logger_name_fmt" $loggerName}}</dt>
 					{{if $loggerDetail.IsEnabled}}
 						<dd><pre class="gt-m-0">{{$loggerDetail.EventWriters | JsonUtils.EncodeToString | JsonUtils.PrettyIndent}}</pre></dd>
 					{{else}}
-						<dd>{{$.locale.Tr "admin.config.disabled_logger"}}</dd>
+						<dd>{{ctx.Locale.Tr "admin.config.disabled_logger"}}</dd>
 					{{end}}
 				{{end}}
 			</dl>
diff --git a/templates/admin/cron.tmpl b/templates/admin/cron.tmpl
index 354cd18ed5..af30cc06e1 100644
--- a/templates/admin/cron.tmpl
+++ b/templates/admin/cron.tmpl
@@ -1,7 +1,7 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}}
 <div class="admin-setting-content">
 	<h4 class="ui top attached header">
-		{{.locale.Tr "admin.monitor.cron"}}
+		{{ctx.Locale.Tr "admin.monitor.cron"}}
 	</h4>
 	<div class="ui attached table segment">
 		<form method="post" action="{{AppSubUrl}}/admin">
@@ -9,24 +9,24 @@
 				<thead>
 					<tr>
 						<th></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>
+						<th>{{ctx.Locale.Tr "admin.monitor.name"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.schedule"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.next"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.previous"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.execute_times"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.last_execution_result"}}</th>
 					</tr>
 				</thead>
 				<tbody>
 					{{range .Entries}}
 						<tr>
-							<td><button type="submit" class="ui primary 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><button type="submit" class="ui primary button" name="op" value="{{.Name}}" title="{{ctx.Locale.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td>
+							<td>{{ctx.Locale.Tr (printf "admin.dashboard.%s" .Name)}}</td>
 							<td>{{.Spec}}</td>
 							<td>{{DateTime "full" .Next}}</td>
 							<td>{{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}-{{end}}</td>
 							<td>{{.ExecTimes}}</td>
-							<td {{if ne .Status ""}}data-tooltip-content="{{.FormatLastMessage $.locale}}"{{end}} >{{if eq .Status ""}}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td>
+							<td {{if ne .Status ""}}data-tooltip-content="{{.FormatLastMessage ctx.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 69c0376d6e..6cb6c38e15 100644
--- a/templates/admin/dashboard.tmpl
+++ b/templates/admin/dashboard.tmpl
@@ -2,11 +2,11 @@
 	<div class="admin-setting-content">
 		{{if .NeedUpdate}}
 			<div class="ui negative message flash-error">
-				<p>{{(.locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}</p>
+				<p>{{(ctx.Locale.Tr "admin.dashboard.new_version_hint" .RemoteVersion AppVer) | Str2html}}</p>
 			</div>
 		{{end}}
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.dashboard.operations"}}
+			{{ctx.Locale.Tr "admin.dashboard.operations"}}
 		</h4>
 		<div class="ui attached table segment">
 			<form method="post" action="{{AppSubUrl}}/admin">
@@ -14,56 +14,56 @@
 				<table class="ui very basic table gt-mt-0 gt-px-4">
 					<tbody>
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.delete_inactive_accounts"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.delete_inactive_accounts"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.delete_repo_archives"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.delete_repo_archives"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.delete_missing_repos"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.delete_missing_repos"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.git_gc_repos"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.git_gc_repos"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 						{{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}}
 							<tr>
-								<td>{{.locale.Tr "admin.dashboard.resync_all_sshkeys"}}<br>
-								{{.locale.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td>
-								<td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+								<td>{{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys"}}<br>
+								{{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td>
+								<td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 							</tr>
 							<tr>
-								<td>{{.locale.Tr "admin.dashboard.resync_all_sshprincipals"}}<br>
-								{{.locale.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td>
-								<td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+								<td>{{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals"}}<br>
+								{{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td>
+								<td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 							</tr>
 						{{end}}
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.resync_all_hooks"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.resync_all_hooks"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.reinit_missing_repos"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.reinit_missing_repos"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.sync_external_users"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.sync_external_users"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.repo_health_check"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.repo_health_check"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.delete_generated_repository_avatars"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.delete_generated_repository_avatars"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 						<tr>
-							<td>{{.locale.Tr "admin.dashboard.sync_repo_branches"}}</td>
-							<td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_repo_branches">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
+							<td>{{ctx.Locale.Tr "admin.dashboard.sync_repo_branches"}}</td>
+							<td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_repo_branches">{{svg "octicon-play"}} {{ctx.Locale.Tr "admin.dashboard.operation_run"}}</button></td>
 						</tr>
 					</tbody>
 				</table>
@@ -71,69 +71,69 @@
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.dashboard.system_status"}}
+			{{ctx.Locale.Tr "admin.dashboard.system_status"}}
 		</h4>
 		<div class="ui attached table segment">
 			<dl class="admin-dl-horizontal">
-				<dt>{{.locale.Tr "admin.dashboard.server_uptime"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.server_uptime"}}</dt>
 				<dd><relative-time format="duration" datetime="{{.SysStatus.StartTime}}">{{.SysStatus.StartTime}}</relative-time></dd>
-				<dt>{{.locale.Tr "admin.dashboard.current_goroutine"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.current_goroutine"}}</dt>
 				<dd>{{.SysStatus.NumGoroutine}}</dd>
 				<div class="divider"></div>
-				<dt>{{.locale.Tr "admin.dashboard.current_memory_usage"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.current_memory_usage"}}</dt>
 				<dd>{{.SysStatus.MemAllocated}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.total_memory_allocated"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.total_memory_allocated"}}</dt>
 				<dd>{{.SysStatus.MemTotal}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.memory_obtained"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.memory_obtained"}}</dt>
 				<dd>{{.SysStatus.MemSys}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.pointer_lookup_times"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.pointer_lookup_times"}}</dt>
 				<dd>{{.SysStatus.Lookups}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.memory_allocate_times"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.memory_allocate_times"}}</dt>
 				<dd>{{.SysStatus.MemMallocs}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.memory_free_times"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.memory_free_times"}}</dt>
 				<dd>{{.SysStatus.MemFrees}}</dd>
 				<div class="divider"></div>
-				<dt>{{.locale.Tr "admin.dashboard.current_heap_usage"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.current_heap_usage"}}</dt>
 				<dd>{{.SysStatus.HeapAlloc}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.heap_memory_obtained"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_obtained"}}</dt>
 				<dd>{{.SysStatus.HeapSys}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.heap_memory_idle"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_idle"}}</dt>
 				<dd>{{.SysStatus.HeapIdle}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.heap_memory_in_use"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_in_use"}}</dt>
 				<dd>{{.SysStatus.HeapInuse}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.heap_memory_released"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.heap_memory_released"}}</dt>
 				<dd>{{.SysStatus.HeapReleased}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.heap_objects"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.heap_objects"}}</dt>
 				<dd>{{.SysStatus.HeapObjects}}</dd>
 				<div class="divider"></div>
-				<dt>{{.locale.Tr "admin.dashboard.bootstrap_stack_usage"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.bootstrap_stack_usage"}}</dt>
 				<dd>{{.SysStatus.StackInuse}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.stack_memory_obtained"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.stack_memory_obtained"}}</dt>
 				<dd>{{.SysStatus.StackSys}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.mspan_structures_usage"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.mspan_structures_usage"}}</dt>
 				<dd>{{.SysStatus.MSpanInuse}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.mspan_structures_obtained"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.mspan_structures_obtained"}}</dt>
 				<dd>{{.SysStatus.MSpanSys}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.mcache_structures_usage"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.mcache_structures_usage"}}</dt>
 				<dd>{{.SysStatus.MCacheInuse}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.mcache_structures_obtained"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.mcache_structures_obtained"}}</dt>
 				<dd>{{.SysStatus.MCacheSys}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}</dt>
 				<dd>{{.SysStatus.BuckHashSys}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.gc_metadata_obtained"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.gc_metadata_obtained"}}</dt>
 				<dd>{{.SysStatus.GCSys}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.other_system_allocation_obtained"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.other_system_allocation_obtained"}}</dt>
 				<dd>{{.SysStatus.OtherSys}}</dd>
 				<div class="divider"></div>
-				<dt>{{.locale.Tr "admin.dashboard.next_gc_recycle"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.next_gc_recycle"}}</dt>
 				<dd>{{.SysStatus.NextGC}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.last_gc_time"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.last_gc_time"}}</dt>
 				<dd>{{.SysStatus.LastGC}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.total_gc_pause"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.total_gc_pause"}}</dt>
 				<dd>{{.SysStatus.PauseTotalNs}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.last_gc_pause"}}</dt>
+				<dt>{{ctx.Locale.Tr "admin.dashboard.last_gc_pause"}}</dt>
 				<dd>{{.SysStatus.PauseNs}}</dd>
-				<dt>{{.locale.Tr "admin.dashboard.gc_times"}}</dt>
+				<dt>{{ctx.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 0acd112e2b..84afc0585f 100644
--- a/templates/admin/emails/list.tmpl
+++ b/templates/admin/emails/list.tmpl
@@ -1,27 +1,27 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.emails.email_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
+			{{ctx.Locale.Tr "admin.emails.email_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
 		</h4>
 		<div class="ui attached segment">
 			<div class="ui secondary filter menu gt-ac gt-mx-0">
 				<form class="ui form ignore-dirty gt-f1">
 					<div class="ui fluid action input">
 						{{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}}
-						<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+						<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 					</div>
 				</form>
 				<!-- Sort -->
 				<div class="ui dropdown type jump item gt-mr-0">
 					<span class="text">
-						{{.locale.Tr "repo.issues.filter_sort"}}
+						{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 					</span>
 					{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 					<div class="menu">
-						<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>
+						<a class="{{if or (eq .SortType "email") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=email&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.email"}}</a>
+						<a class="{{if eq .SortType "reverseemail"}}active {{end}}item" href="{{$.Link}}?sort=reverseemail&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.email_reverse"}}</a>
+						<a class="{{if eq .SortType "username"}}active {{end}}item" href="{{$.Link}}?sort=username&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.name"}}</a>
+						<a class="{{if eq .SortType "reverseusername"}}active {{end}}item" href="{{$.Link}}?sort=reverseusername&q={{$.Keyword}}">{{ctx.Locale.Tr "admin.emails.filter_sort.name_reverse"}}</a>
 					</div>
 				</div>
 			</div>
@@ -31,16 +31,16 @@
 				<thead>
 					<tr>
 						<th data-sortt-asc="username" data-sortt-desc="reverseusername">
-							{{.locale.Tr "admin.users.name"}}
+							{{ctx.Locale.Tr "admin.users.name"}}
 							{{SortArrow "username" "reverseusername" $.SortType false}}
 						</th>
-						<th>{{.locale.Tr "admin.users.full_name"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.full_name"}}</th>
 						<th data-sortt-asc="email" data-sortt-desc="reverseemail" data-sortt-default="true">
-							{{.locale.Tr "email"}}
+							{{ctx.Locale.Tr "email"}}
 							{{SortArrow "email" "reverseemail" $.SortType true}}
 						</th>
-						<th>{{.locale.Tr "admin.emails.primary"}}</th>
-						<th>{{.locale.Tr "admin.emails.activated"}}</th>
+						<th>{{ctx.Locale.Tr "admin.emails.primary"}}</th>
+						<th>{{ctx.Locale.Tr "admin.emails.activated"}}</th>
 					</tr>
 				</thead>
 				<tbody>
@@ -72,10 +72,10 @@
 
 		<div class="ui g-modal-confirm modal" id="change-email-modal">
 			<div class="header">
-				{{.locale.Tr "admin.emails.change_email_header"}}
+				{{ctx.Locale.Tr "admin.emails.change_email_header"}}
 			</div>
 			<div class="content">
-				<p class="center">{{.locale.Tr "admin.emails.change_email_text"}}</p>
+				<p class="center">{{ctx.Locale.Tr "admin.emails.change_email_text"}}</p>
 
 				<form class="ui form" id="email-action-form" action="{{AppSubUrl}}/admin/emails/activate" method="post">
 					{{$.CsrfTokenHtml}}
diff --git a/templates/admin/hook_new.tmpl b/templates/admin/hook_new.tmpl
index f565318b8b..37dcc49d53 100644
--- a/templates/admin/hook_new.tmpl
+++ b/templates/admin/hook_new.tmpl
@@ -1,12 +1,12 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin settings new webhook")}}
 	<div class="admin-setting-content">
-		{{$CustomHeaderTitle := .locale.Tr "admin.defaulthooks.update_webhook"}}
+		{{$CustomHeaderTitle := ctx.Locale.Tr "admin.defaulthooks.update_webhook"}}
 		{{if .PageIsAdminDefaultHooksNew}}
-			{{$CustomHeaderTitle = .locale.Tr "admin.defaulthooks.add_webhook"}}
+			{{$CustomHeaderTitle = ctx.Locale.Tr "admin.defaulthooks.add_webhook"}}
 		{{else if .PageIsAdminSystemHooksNew}}
-			{{$CustomHeaderTitle = .locale.Tr "admin.systemhooks.add_webhook"}}
+			{{$CustomHeaderTitle = ctx.Locale.Tr "admin.systemhooks.add_webhook"}}
 		{{else if .Webhook.IsSystemWebhook}}
-			{{$CustomHeaderTitle = .locale.Tr "admin.systemhooks.update_webhook"}}
+			{{$CustomHeaderTitle = ctx.Locale.Tr "admin.systemhooks.update_webhook"}}
 		{{end}}
 		{{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
 	</div>
diff --git a/templates/admin/navbar.tmpl b/templates/admin/navbar.tmpl
index 9ade211eac..8ece95239c 100644
--- a/templates/admin/navbar.tmpl
+++ b/templates/admin/navbar.tmpl
@@ -1,94 +1,94 @@
 <div class="flex-container-nav">
 	<div class="ui fluid vertical menu">
-		<div class="header item">{{.locale.Tr "admin.settings"}}</div>
+		<div class="header item">{{ctx.Locale.Tr "admin.settings"}}</div>
 		<a class="{{if .PageIsAdminDashboard}}active {{end}}item" href="{{AppSubUrl}}/admin">
-			{{.locale.Tr "admin.dashboard"}}
+			{{ctx.Locale.Tr "admin.dashboard"}}
 		</a>
 		<details class="item toggleable-item" {{if or .PageIsAdminUsers .PageIsAdminEmails .PageIsAdminOrganizations .PageIsAdminAuthentications}}open{{end}}>
-			<summary>{{.locale.Tr "admin.identity_access"}}</summary>
+			<summary>{{ctx.Locale.Tr "admin.identity_access"}}</summary>
 			<div class="menu">
 				<a class="{{if .PageIsAdminAuthentications}}active {{end}}item" href="{{AppSubUrl}}/admin/auths">
-					{{.locale.Tr "admin.authentication"}}
+					{{ctx.Locale.Tr "admin.authentication"}}
 				</a>
 				<a class="{{if .PageIsAdminOrganizations}}active {{end}}item" href="{{AppSubUrl}}/admin/orgs">
-					{{.locale.Tr "admin.organizations"}}
+					{{ctx.Locale.Tr "admin.organizations"}}
 				</a>
 				<a class="{{if .PageIsAdminUsers}}active {{end}}item" href="{{AppSubUrl}}/admin/users">
-					{{.locale.Tr "admin.users"}}
+					{{ctx.Locale.Tr "admin.users"}}
 				</a>
 				<a class="{{if .PageIsAdminEmails}}active {{end}}item" href="{{AppSubUrl}}/admin/emails">
-					{{.locale.Tr "admin.emails"}}
+					{{ctx.Locale.Tr "admin.emails"}}
 				</a>
 			</div>
 		</details>
 		<details class="item toggleable-item" {{if or .PageIsAdminRepositories (and .EnablePackages .PageIsAdminPackages)}}open{{end}}>
-			<summary>{{.locale.Tr "admin.assets"}}</summary>
+			<summary>{{ctx.Locale.Tr "admin.assets"}}</summary>
 			<div class="menu">
 				{{if .EnablePackages}}
 					<a class="{{if .PageIsAdminPackages}}active {{end}}item" href="{{AppSubUrl}}/admin/packages">
-						{{.locale.Tr "packages.title"}}
+						{{ctx.Locale.Tr "packages.title"}}
 					</a>
 				{{end}}
 				<a class="{{if .PageIsAdminRepositories}}active {{end}}item" href="{{AppSubUrl}}/admin/repos">
-					{{.locale.Tr "admin.repositories"}}
+					{{ctx.Locale.Tr "admin.repositories"}}
 				</a>
 			</div>
 		</details>
 		<!-- Webhooks and OAuth can be both disabled here, so add this if statement to display different ui -->
 		{{if and (not DisableWebhooks) .EnableOAuth2}}
 			<details class="item toggleable-item" {{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks .PageIsAdminApplications}}open{{end}}>
-				<summary>{{.locale.Tr "admin.integrations"}}</summary>
+				<summary>{{ctx.Locale.Tr "admin.integrations"}}</summary>
 				<div class="menu">
 					<a class="{{if .PageIsAdminApplications}}active {{end}}item" href="{{AppSubUrl}}/admin/applications">
-						{{.locale.Tr "settings.applications"}}
+						{{ctx.Locale.Tr "settings.applications"}}
 					</a>
 					<a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active {{end}}item" href="{{AppSubUrl}}/admin/hooks">
-						{{.locale.Tr "admin.hooks"}}
+						{{ctx.Locale.Tr "admin.hooks"}}
 					</a>
 				</div>
 			</details>
 		{{else}}
 			{{if not DisableWebhooks}}
 			<a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active {{end}}item" href="{{AppSubUrl}}/admin/hooks">
-				{{.locale.Tr "admin.hooks"}}
+				{{ctx.Locale.Tr "admin.hooks"}}
 			</a>
 			{{end}}
 			{{if .EnableOAuth2}}
 				<a class="{{if .PageIsAdminApplications}}active {{end}}item" href="{{AppSubUrl}}/admin/applications">
-					{{.locale.Tr "settings.applications"}}
+					{{ctx.Locale.Tr "settings.applications"}}
 				</a>
 			{{end}}
 		{{end}}
 		{{if .EnableActions}}
 		<details class="item toggleable-item" {{if .PageIsSharedSettingsRunners}}open{{end}}>
-			<summary>{{.locale.Tr "actions.actions"}}</summary>
+			<summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
 			<div class="menu">
 				<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{AppSubUrl}}/admin/actions/runners">
-					{{.locale.Tr "actions.runners"}}
+					{{ctx.Locale.Tr "actions.runners"}}
 				</a>
 			</div>
 		</details>
 		{{end}}
 		<a class="{{if .PageIsAdminConfig}}active {{end}}item" href="{{AppSubUrl}}/admin/config">
-			{{.locale.Tr "admin.config"}}
+			{{ctx.Locale.Tr "admin.config"}}
 		</a>
 		<a class="{{if .PageIsAdminNotices}}active {{end}}item" href="{{AppSubUrl}}/admin/notices">
-			{{.locale.Tr "admin.notices"}}
+			{{ctx.Locale.Tr "admin.notices"}}
 		</a>
 		<details class="item toggleable-item" {{if or .PageIsAdminMonitorStats .PageIsAdminMonitorCron .PageIsAdminMonitorQueue .PageIsAdminMonitorStacktrace}}open{{end}}>
-			<summary>{{.locale.Tr "admin.monitor"}}</summary>
+			<summary>{{ctx.Locale.Tr "admin.monitor"}}</summary>
 			<div class="menu">
 				<a class="{{if .PageIsAdminMonitorStats}}active {{end}}item" href="{{AppSubUrl}}/admin/monitor/stats">
-					{{.locale.Tr "admin.monitor.stats"}}
+					{{ctx.Locale.Tr "admin.monitor.stats"}}
 				</a>
 				<a class="{{if .PageIsAdminMonitorCron}}active {{end}}item" href="{{AppSubUrl}}/admin/monitor/cron">
-					{{.locale.Tr "admin.monitor.cron"}}
+					{{ctx.Locale.Tr "admin.monitor.cron"}}
 				</a>
 				<a class="{{if .PageIsAdminMonitorQueue}}active {{end}}item" href="{{AppSubUrl}}/admin/monitor/queue">
-					{{.locale.Tr "admin.monitor.queues"}}
+					{{ctx.Locale.Tr "admin.monitor.queues"}}
 				</a>
 				<a class="{{if .PageIsAdminMonitorStacktrace}}active {{end}}item" href="{{AppSubUrl}}/admin/monitor/stacktrace">
-					{{.locale.Tr "admin.monitor.stacktrace"}}
+					{{ctx.Locale.Tr "admin.monitor.stacktrace"}}
 				</a>
 			</div>
 		</details>
diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl
index c9d3a552dc..ed410425b5 100644
--- a/templates/admin/notice.tmpl
+++ b/templates/admin/notice.tmpl
@@ -1,17 +1,17 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin notice")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.notices.system_notice_list"}} ({{.locale.Tr "admin.total" .Total}})
+			{{ctx.Locale.Tr "admin.notices.system_notice_list"}} ({{ctx.Locale.Tr "admin.total" .Total}})
 		</h4>
 		<table class="ui attached segment select selectable striped table unstackable g-table-auto-ellipsis">
 			<thead>
 				<tr>
 					<th></th>
 					<th>ID</th>
-					<th>{{.locale.Tr "admin.notices.type"}}</th>
-					<th>{{.locale.Tr "admin.notices.desc"}}</th>
-					<th>{{.locale.Tr "admin.users.created"}}</th>
-					<th>{{.locale.Tr "admin.notices.op"}}</th>
+					<th>{{ctx.Locale.Tr "admin.notices.type"}}</th>
+					<th>{{ctx.Locale.Tr "admin.notices.desc"}}</th>
+					<th>{{ctx.Locale.Tr "admin.users.created"}}</th>
+					<th>{{ctx.Locale.Tr "admin.notices.op"}}</th>
 				</tr>
 			</thead>
 			<tbody>
@@ -19,7 +19,7 @@
 					<tr>
 						<td><div class="ui checkbox gt-df" data-id="{{.ID}}"><input type="checkbox"></div></td>
 						<td>{{.ID}}</td>
-						<td>{{$.locale.Tr .TrStr}}</td>
+						<td>{{ctx.Locale.Tr .TrStr}}</td>
 						<td class="view-detail auto-ellipsis" style="width: 80%;"><span class="notice-description">{{.Description}}</span></td>
 						<td nowrap>{{DateTime "short" .CreatedUnix}}</td>
 						<td class="view-detail"><a href="#">{{svg "octicon-note" 16}}</a></td>
@@ -33,24 +33,24 @@
 							<th colspan="5">
 								<form class="gt-float-right" method="post" action="{{AppSubUrl}}/admin/notices/empty">
 									{{.CsrfTokenHtml}}
-									<button type="submit" class="ui red small button">{{.locale.Tr "admin.notices.delete_all"}}</button>
+									<button type="submit" class="ui red small button">{{ctx.Locale.Tr "admin.notices.delete_all"}}</button>
 								</form>
 								<div class="ui floating upward dropdown small button">{{/* TODO: Make this dropdown accessible */}}
-									<span class="text">{{.locale.Tr "admin.notices.operations"}}</span>
+									<span class="text">{{ctx.Locale.Tr "admin.notices.operations"}}</span>
 									<div class="menu">
 										<div class="item select action" data-action="select-all">
-											{{.locale.Tr "admin.notices.select_all"}}
+											{{ctx.Locale.Tr "admin.notices.select_all"}}
 										</div>
 										<div class="item select action" data-action="deselect-all">
-											{{.locale.Tr "admin.notices.deselect_all"}}
+											{{ctx.Locale.Tr "admin.notices.deselect_all"}}
 										</div>
 										<div class="item select action" data-action="inverse">
-											{{.locale.Tr "admin.notices.inverse_selection"}}
+											{{ctx.Locale.Tr "admin.notices.inverse_selection"}}
 										</div>
 									</div>
 								</div>
 								<button class="ui small teal button" id="delete-selection" data-link="{{.Link}}/delete" data-redirect="{{.Link}}?page={{.Page.Paginater.Current}}">
-									{{.locale.Tr "admin.notices.delete_selected"}}
+									{{ctx.Locale.Tr "admin.notices.delete_selected"}}
 								</button>
 							</th>
 						</tr>
@@ -61,7 +61,7 @@
 	</div>
 
 <div class="ui modal admin" id="detail-modal">
-	<div class="header">{{$.locale.Tr "admin.notices.view_detail_header"}}</div>
+	<div class="header">{{ctx.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 ac86e7606a..1c041ca347 100644
--- a/templates/admin/org/list.tmpl
+++ b/templates/admin/org/list.tmpl
@@ -1,9 +1,9 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.orgs.org_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
+			{{ctx.Locale.Tr "admin.orgs.org_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
 			<div class="ui right">
-				<a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{.locale.Tr "admin.orgs.new_orga"}}</a>
+				<a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{ctx.Locale.Tr "admin.orgs.new_orga"}}</a>
 			</div>
 		</h4>
 		<div class="ui attached segment">
@@ -15,17 +15,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">
-							{{.locale.Tr "admin.orgs.name"}}
+							{{ctx.Locale.Tr "admin.orgs.name"}}
 							{{SortArrow "alphabetically" "reversealphabetically" $.SortType true}}
 						</th>
-						<th>{{.locale.Tr "admin.orgs.teams"}}</th>
-						<th>{{.locale.Tr "admin.orgs.members"}}</th>
-						<th>{{.locale.Tr "admin.users.repos"}}</th>
+						<th>{{ctx.Locale.Tr "admin.orgs.teams"}}</th>
+						<th>{{ctx.Locale.Tr "admin.orgs.members"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.repos"}}</th>
 						<th data-sortt-asc="recentupdate" data-sortt-desc="leastupdate">
-							{{.locale.Tr "admin.users.created"}}
+							{{ctx.Locale.Tr "admin.users.created"}}
 							{{SortArrow "recentupdate" "leastupdate" $.SortType false}}
 						</th>
-						<th>{{.locale.Tr "admin.users.edit"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.edit"}}</th>
 					</tr>
 				</thead>
 				<tbody>
@@ -38,7 +38,7 @@
 									<span class="text gold">{{svg "octicon-lock"}}</span>
 								{{end}}
 								{{if eq .Type 3}}{{/* Reserved organization */}}
-									<span class="ui mini label">{{$.locale.Tr "admin.users.reserved"}}</span>
+									<span class="ui mini label">{{ctx.Locale.Tr "admin.users.reserved"}}</span>
 								{{end}}
 							</td>
 							<td>{{.NumTeams}}</td>
diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl
index 5d54fb3e82..c67797d6b0 100644
--- a/templates/admin/packages/list.tmpl
+++ b/templates/admin/packages/list.tmpl
@@ -1,13 +1,13 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.packages.package_manage_panel"}} ({{.locale.Tr "admin.total" .TotalCount}},
-			{{.locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}},
-			{{.locale.Tr "admin.packages.unreferenced_size" (FileSize .TotalUnreferencedBlobSize)}})
+			{{ctx.Locale.Tr "admin.packages.package_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .TotalCount}},
+			{{ctx.Locale.Tr "admin.packages.total_size" (FileSize .TotalBlobSize)}},
+			{{ctx.Locale.Tr "admin.packages.unreferenced_size" (FileSize .TotalUnreferencedBlobSize)}})
 			<div class="ui right">
 				<form method="post" action="/admin/packages/cleanup">
 					{{.CsrfTokenHtml}}
-					<button class="ui primary tiny button">{{.locale.Tr "admin.packages.cleanup"}}</button>
+					<button class="ui primary tiny button">{{ctx.Locale.Tr "admin.packages.cleanup"}}</button>
 				</form>
 			</div>
 		</h4>
@@ -16,13 +16,13 @@
 				<div class="ui fluid action input">
 					{{template "shared/searchinput" dict "Value" .Query "AutoFocus" true}}
 					<select class="ui dropdown" name="type">
-						<option value="">{{.locale.Tr "packages.filter.type"}}</option>
-						<option value="all">{{.locale.Tr "packages.filter.type.all"}}</option>
+						<option value="">{{ctx.Locale.Tr "packages.filter.type"}}</option>
+						<option value="all">{{ctx.Locale.Tr "packages.filter.type.all"}}</option>
 						{{range $type := .AvailableTypes}}
 						<option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option>
 						{{end}}
 					</select>
-					<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 				</div>
 			</form>
 		</div>
@@ -31,24 +31,24 @@
 				<thead>
 					<tr>
 						<th>ID</th>
-						<th>{{.locale.Tr "admin.packages.owner"}}</th>
-						<th>{{.locale.Tr "admin.packages.type"}}</th>
+						<th>{{ctx.Locale.Tr "admin.packages.owner"}}</th>
+						<th>{{ctx.Locale.Tr "admin.packages.type"}}</th>
 						<th data-sortt-asc="name_asc" data-sortt-desc="name_desc">
-							{{.locale.Tr "admin.packages.name"}}
+							{{ctx.Locale.Tr "admin.packages.name"}}
 							{{SortArrow "name_asc" "name_desc" .SortType false}}
 						</th>
 						<th data-sortt-asc="version_desc" data-sortt-desc="version_asc">
-							{{.locale.Tr "admin.packages.version"}}
+							{{ctx.Locale.Tr "admin.packages.version"}}
 							{{SortArrow "version_desc" "version_asc" .SortType false}}
 						</th>
-						<th>{{.locale.Tr "admin.packages.creator"}}</th>
-						<th>{{.locale.Tr "admin.packages.repository"}}</th>
-						<th>{{.locale.Tr "admin.packages.size"}}</th>
+						<th>{{ctx.Locale.Tr "admin.packages.creator"}}</th>
+						<th>{{ctx.Locale.Tr "admin.packages.repository"}}</th>
+						<th>{{ctx.Locale.Tr "admin.packages.size"}}</th>
 						<th data-sortt-asc="created_asc" data-sortt-desc="created_desc">
-							{{.locale.Tr "admin.packages.published"}}
+							{{ctx.Locale.Tr "admin.packages.published"}}
 							{{SortArrow "created_asc" "created_desc" .SortType true}}
 						</th>
-						<th>{{.locale.Tr "admin.notices.op"}}</th>
+						<th>{{ctx.Locale.Tr "admin.notices.op"}}</th>
 					</tr>
 				</thead>
 				<tbody>
@@ -85,10 +85,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "packages.settings.delete"}}
+		{{ctx.Locale.Tr "packages.settings.delete"}}
 	</div>
 	<div class="content">
-		{{.locale.Tr "packages.settings.delete.notice" `<span class="name"></span>` `<span class="dataVersion"></span>` | Safe}}
+		{{ctx.Locale.Tr "packages.settings.delete.notice" `<span class="name"></span>` `<span class="dataVersion"></span>` | Safe}}
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/admin/queue.tmpl b/templates/admin/queue.tmpl
index efca8c1f2f..1be35cf765 100644
--- a/templates/admin/queue.tmpl
+++ b/templates/admin/queue.tmpl
@@ -1,18 +1,18 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}}
 <div class="admin-setting-content">
 	<h4 class="ui top attached header">
-		{{.locale.Tr "admin.monitor.queues"}}
+		{{ctx.Locale.Tr "admin.monitor.queues"}}
 	</h4>
 	<div class="ui attached table segment">
 		<table class="ui very basic striped table unstackable">
 			<thead>
 			<tr>
-				<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.activeworkers"}}</th>
-				<th>{{.locale.Tr "admin.monitor.queue.numberinqueue"}}</th>
+				<th>{{ctx.Locale.Tr "admin.monitor.queue.name"}}</th>
+				<th>{{ctx.Locale.Tr "admin.monitor.queue.type"}}</th>
+				<th>{{ctx.Locale.Tr "admin.monitor.queue.exemplar"}}</th>
+				<th>{{ctx.Locale.Tr "admin.monitor.queue.numberworkers"}}</th>
+				<th>{{ctx.Locale.Tr "admin.monitor.queue.activeworkers"}}</th>
+				<th>{{ctx.Locale.Tr "admin.monitor.queue.numberinqueue"}}</th>
 				<th></th>
 			</tr>
 			</thead>
@@ -25,7 +25,7 @@
 				<td>{{$q.GetWorkerNumber}}</td>
 				<td>{{$q.GetWorkerActiveNumber}}</td>
 				<td>{{$sum := $q.GetQueueItemNumber}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
-				<td><a href="{{$.Link}}/{{$qid}}" class="button">{{$.locale.Tr "admin.monitor.queue.review_add"}}</a></td>
+				<td><a href="{{$.Link}}/{{$qid}}" class="button">{{ctx.Locale.Tr "admin.monitor.queue.review_add"}}</a></td>
 			</tr>
 			{{end}}
 			</tbody>
diff --git a/templates/admin/queue_manage.tmpl b/templates/admin/queue_manage.tmpl
index a46d9462ec..80214d1021 100644
--- a/templates/admin/queue_manage.tmpl
+++ b/templates/admin/queue_manage.tmpl
@@ -1,19 +1,19 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.monitor.queue" .Queue.GetName}}
+			{{ctx.Locale.Tr "admin.monitor.queue" .Queue.GetName}}
 		</h4>
 		<div class="ui attached table segment">
 			<table class="ui very basic striped table">
 				<thead>
 					<tr>
-						<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.activeworkers"}}</th>
-						<th>{{.locale.Tr "admin.monitor.queue.maxnumberworkers"}}</th>
-						<th>{{.locale.Tr "admin.monitor.queue.numberinqueue"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.queue.name"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.queue.type"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.queue.exemplar"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.queue.numberworkers"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.queue.activeworkers"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.queue.maxnumberworkers"}}</th>
+						<th>{{ctx.Locale.Tr "admin.monitor.queue.numberinqueue"}}</th>
 					</tr>
 				</thead>
 				<tbody>
@@ -32,7 +32,7 @@
 								{{$sum}}
 								<form action="{{$.Link}}/remove-all-items" method="post" class="gt-dib gt-ml-4">
 									{{$.CsrfTokenHtml}}
-									<button class="ui tiny basic red button">{{.locale.Tr "admin.monitor.queue.settings.remove_all_items"}}</button>
+									<button class="ui tiny basic red button">{{ctx.Locale.Tr "admin.monitor.queue.settings.remove_all_items"}}</button>
 								</form>
 							{{end}}
 						</td>
@@ -42,18 +42,18 @@
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.monitor.queue.settings.title"}}
+			{{ctx.Locale.Tr "admin.monitor.queue.settings.title"}}
 		</h4>
 		<div class="ui attached segment">
-			<p>{{.locale.Tr "admin.monitor.queue.settings.desc"}}</p>
+			<p>{{ctx.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">{{.locale.Tr "admin.monitor.queue.settings.maxnumberworkers"}}</label>
-						<input name="max-number" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.maxnumberworkers.placeholder" .Queue.GetWorkerMaxNumber}}">
+						<label for="max-number">{{ctx.Locale.Tr "admin.monitor.queue.settings.maxnumberworkers"}}</label>
+						<input name="max-number" type="text" placeholder="{{ctx.Locale.Tr "admin.monitor.queue.settings.maxnumberworkers.placeholder" .Queue.GetWorkerMaxNumber}}">
 					</div>
-					<button class="ui submit button">{{.locale.Tr "admin.monitor.queue.settings.submit"}}</button>
+					<button class="ui submit button">{{ctx.Locale.Tr "admin.monitor.queue.settings.submit"}}</button>
 				</div>
 			</form>
 		</div>
diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl
index 3cd8f08f51..c23b6a1b63 100644
--- a/templates/admin/repo/list.tmpl
+++ b/templates/admin/repo/list.tmpl
@@ -1,9 +1,9 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.repos.repo_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
+			{{ctx.Locale.Tr "admin.repos.repo_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
 			<div class="ui right">
-				<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos/unadopted">{{.locale.Tr "admin.repos.unadopted"}}</a>
+				<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos/unadopted">{{ctx.Locale.Tr "admin.repos.unadopted"}}</a>
 			</div>
 		</h4>
 		<div class="ui attached segment">
@@ -14,32 +14,32 @@
 				<thead>
 					<tr>
 						<th data-sortt-asc="oldest" data-sortt-desc="newest">ID{{SortArrow "oldest" "newest" $.SortType false}}</th>
-						<th>{{.locale.Tr "admin.repos.owner"}}</th>
+						<th>{{ctx.Locale.Tr "admin.repos.owner"}}</th>
 						<th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
-							{{.locale.Tr "admin.repos.name"}}
+							{{ctx.Locale.Tr "admin.repos.name"}}
 							{{SortArrow "alphabetically" "reversealphabetically" $.SortType false}}
 						</th>
-						<th>{{.locale.Tr "admin.repos.watches"}}</th>
+						<th>{{ctx.Locale.Tr "admin.repos.watches"}}</th>
 						<th  data-sortt-asc="moststars" data-sortt-desc="feweststars">
-							{{.locale.Tr "admin.repos.stars"}}
+							{{ctx.Locale.Tr "admin.repos.stars"}}
 							{{SortArrow "moststars" "feweststars" $.SortType false}}
 						</th>
 						<th  data-sortt-asc="mostforks" data-sortt-desc="fewestforks">
-							{{.locale.Tr "admin.repos.forks"}}
+							{{ctx.Locale.Tr "admin.repos.forks"}}
 							{{SortArrow "mostforks" "fewestforks" $.SortType false}}
 						</th>
-						<th>{{.locale.Tr "admin.repos.issues"}}</th>
+						<th>{{ctx.Locale.Tr "admin.repos.issues"}}</th>
 						<th  data-sortt-asc="gitsize" data-sortt-desc="reversegitsize">
-							{{.locale.Tr "admin.repos.size"}}
+							{{ctx.Locale.Tr "admin.repos.size"}}
 							{{SortArrow "gitsize" "reversegitsize" $.SortType false}}
 						</th>
 						<th  data-sortt-asc="lfssize" data-sortt-desc="reverselfssize">
-							{{.locale.Tr "admin.repos.lfs_size"}}
+							{{ctx.Locale.Tr "admin.repos.lfs_size"}}
 							{{SortArrow "lfssize" "reverselfssize" $.SortType false}}
 						</th>
-						<th>{{.locale.Tr "admin.auths.updated"}}</th>
-						<th>{{.locale.Tr "admin.users.created"}}</th>
-						<th>{{.locale.Tr "admin.notices.op"}}</th>
+						<th>{{ctx.Locale.Tr "admin.auths.updated"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.created"}}</th>
+						<th>{{ctx.Locale.Tr "admin.notices.op"}}</th>
 					</tr>
 				</thead>
 				<tbody>
@@ -55,22 +55,22 @@
 							<td>
 								<a href="{{.Link}}">{{.Name}}</a>
 								{{if .IsArchived}}
-									<span class="ui basic mini label">{{$.locale.Tr "repo.desc.archived"}}</span>
+									<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
 								{{end}}
 								{{if .IsTemplate}}
 									{{if .IsPrivate}}
-										<span class="ui basic mini label">{{$.locale.Tr "repo.desc.private_template"}}</span>
+										<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span>
 									{{else}}
 										{{if .Owner.Visibility.IsPrivate}}
-											<span class="ui basic mini label">{{$.locale.Tr "repo.desc.internal_template"}}</span>
+											<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span>
 										{{end}}
 									{{end}}
 								{{else}}
 									{{if .IsPrivate}}
-										<span class="ui basic mini label">{{$.locale.Tr "repo.desc.private"}}</span>
+										<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
 									{{else}}
 										{{if .Owner.Visibility.IsPrivate}}
-											<span class="ui basic mini label">{{$.locale.Tr "repo.desc.internal"}}</span>
+											<span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
 										{{end}}
 									{{end}}
 								{{end}}
@@ -101,12 +101,12 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.settings.delete"}}
+		{{ctx.Locale.Tr "repo.settings.delete"}}
 	</div>
 	<div class="content">
-		<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>
+		<p>{{ctx.Locale.Tr "repo.settings.delete_desc"}}</p>
+		{{ctx.Locale.Tr "repo.settings.delete_notices_2" `<span class="name"></span>` | Safe}}<br>
+		{{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}<br>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/admin/repo/search.tmpl b/templates/admin/repo/search.tmpl
index 5f51e4ff88..2baecb8939 100644
--- a/templates/admin/repo/search.tmpl
+++ b/templates/admin/repo/search.tmpl
@@ -2,28 +2,28 @@
 	<form class="ui form ignore-dirty gt-f1">
 		<div class="ui fluid action input">
 			{{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}}
-			<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+			<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 		</div>
 	</form>
 	<!-- Sort -->
 	<div class="ui dropdown type jump item gt-mr-0">
 		<span class="text">
-			{{.locale.Tr "repo.issues.filter_sort"}}
+			{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 		</span>
 		{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 		<div class="menu">
-			<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>
+			<a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+			<a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
+			<a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
+			<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.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}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+			<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+			<a class="{{if eq .SortType "moststars"}}active {{end}}item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.moststars"}}</a>
+			<a class="{{if eq .SortType "feweststars"}}active {{end}}item" href="{{$.Link}}?sort=feweststars&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.feweststars"}}</a>
+			<a class="{{if eq .SortType "mostforks"}}active {{end}}item" href="{{$.Link}}?sort=mostforks&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostforks"}}</a>
+			<a class="{{if eq .SortType "fewestforks"}}active {{end}}item" href="{{$.Link}}?sort=fewestforks&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.fewestforks"}}</a>
+			<a class="{{if eq .SortType "size"}}active {{end}}item" href="{{$.Link}}?sort=size&q={{$.Keyword}}">{{ctx.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}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_by_size"}}</a>
 		</div>
 	</div>
 </div>
diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl
index 746c81d00f..fb4f16791d 100644
--- a/templates/admin/repo/unadopted.tmpl
+++ b/templates/admin/repo/unadopted.tmpl
@@ -1,17 +1,17 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.repos.unadopted"}}
+			{{ctx.Locale.Tr "admin.repos.unadopted"}}
 			<div class="ui right">
-				<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos">{{.locale.Tr "admin.repos.repo_manage_panel"}}</a>
+				<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/repos">{{ctx.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="{{.locale.Tr "repo.adopt_search"}}" autofocus>
-				<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+				<input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "repo.adopt_search"}}" autofocus>
+				<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 				</div>
 			</form>
 		</div>
@@ -23,13 +23,13 @@
 							<div class="item gt-df gt-ac">
 								<span class="gt-f1"> {{svg "octicon-file-directory-fill"}} {{$dir}}</span>
 								<div>
-									<button class="ui button primary show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}">{{svg "octicon-plus"}} {{$.locale.Tr "repo.adopt_preexisting_label"}}</button>
+									<button class="ui button primary show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}">{{svg "octicon-plus"}} {{ctx.Locale.Tr "repo.adopt_preexisting_label"}}</button>
 									<div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}">
 										<div class="header">
-											<span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span>
+											<span class="label">{{ctx.Locale.Tr "repo.adopt_preexisting"}}</span>
 										</div>
 										<div class="content">
-											<p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
+											<p>{{ctx.Locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
 										</div>
 										<form class="ui form" method="post" action="{{AppSubUrl}}/admin/repos/unadopted">
 											{{$.CsrfTokenHtml}}
@@ -40,13 +40,13 @@
 											{{template "base/modal_actions_confirm"}}
 										</form>
 									</div>
-									<button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}">{{svg "octicon-x"}} {{$.locale.Tr "repo.delete_preexisting_label"}}</button>
+									<button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}">{{svg "octicon-x"}} {{ctx.Locale.Tr "repo.delete_preexisting_label"}}</button>
 									<div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}">
 										<div class="header">
-											<span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span>
+											<span class="label">{{ctx.Locale.Tr "repo.delete_preexisting"}}</span>
 										</div>
 										<div class="content">
-											<p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p>
+											<p>{{ctx.Locale.Tr "repo.delete_preexisting_content" $dir}}</p>
 										</div>
 										<form class="ui form" method="post" action="{{AppSubUrl}}/admin/repos/unadopted">
 											{{$.CsrfTokenHtml}}
@@ -64,7 +64,7 @@
 					{{template "base/paginate" .}}
 				{{else}}
 					<div class="item">
-						{{.locale.Tr "admin.repos.unadopted.no_more"}}
+						{{ctx.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 b0e282bcc7..ffb8bf812f 100644
--- a/templates/admin/stacktrace-row.tmpl
+++ b/templates/admin/stacktrace-row.tmpl
@@ -13,7 +13,7 @@
 		</div>
 		<div class="content gt-f1">
 			<div class="header">{{.Process.Description}}</div>
-			<div class="description">{{if ne .Process.Type "none"}}{{TimeSince .Process.Start .root.locale}}{{end}}</div>
+			<div class="description">{{if ne .Process.Type "none"}}{{TimeSince .Process.Start ctx.Locale}}{{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 b9d8e6538f..894e41f8d7 100644
--- a/templates/admin/stacktrace.tmpl
+++ b/templates/admin/stacktrace.tmpl
@@ -4,14 +4,14 @@
 	<div class="gt-df gt-ac">
 		<div class="gt-f1">
 			<div class="ui compact small menu">
-				<a class="{{if eq .ShowGoroutineList "process"}}active {{end}}item" href="{{.Link}}?show=process">{{.locale.Tr "admin.monitor.process"}}</a>
-				<a class="{{if eq .ShowGoroutineList "stacktrace"}}active {{end}}item" href="{{.Link}}?show=stacktrace">{{.locale.Tr "admin.monitor.stacktrace"}}</a>
+				<a class="{{if eq .ShowGoroutineList "process"}}active {{end}}item" href="{{.Link}}?show=process">{{ctx.Locale.Tr "admin.monitor.process"}}</a>
+				<a class="{{if eq .ShowGoroutineList "stacktrace"}}active {{end}}item" href="{{.Link}}?show=stacktrace">{{ctx.Locale.Tr "admin.monitor.stacktrace"}}</a>
 			</div>
 		</div>
 		<form target="_blank" action="{{AppSubUrl}}/admin/monitor/diagnosis" class="ui form">
 			<div class="ui inline field">
-				<button class="ui primary small button">{{.locale.Tr "admin.monitor.download_diagnosis_report"}}</button>
-				<input name="seconds" size="3" maxlength="3" value="10"> {{.locale.Tr "tool.raw_seconds"}}
+				<button class="ui primary small button">{{ctx.Locale.Tr "admin.monitor.download_diagnosis_report"}}</button>
+				<input name="seconds" size="3" maxlength="3" value="10"> {{ctx.Locale.Tr "tool.raw_seconds"}}
 			</div>
 		</form>
 	</div>
@@ -20,7 +20,7 @@
 
 	<h4 class="ui top attached header">
 		{{printf "%d Goroutines" .GoroutineCount}}{{/* Goroutine is non-translatable*/}}
-		{{- if .ProcessCount -}}, {{.locale.Tr "admin.monitor.processes_count" .ProcessCount}}{{- end -}}
+		{{- if .ProcessCount -}}, {{ctx.Locale.Tr "admin.monitor.processes_count" .ProcessCount}}{{- end -}}
 	</h4>
 
 	{{if .ProcessStacks}}
@@ -36,11 +36,11 @@
 
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
-		{{.locale.Tr "admin.monitor.process.cancel"}}
+		{{ctx.Locale.Tr "admin.monitor.process.cancel"}}
 	</div>
 	<div class="content">
-		<p>{{$.locale.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p>
-		<p>{{$.locale.Tr "admin.monitor.process.cancel_desc"}}</p>
+		<p>{{ctx.Locale.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p>
+		<p>{{ctx.Locale.Tr "admin.monitor.process.cancel_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/admin/stats.tmpl b/templates/admin/stats.tmpl
index c755969cb1..04fa862a85 100644
--- a/templates/admin/stats.tmpl
+++ b/templates/admin/stats.tmpl
@@ -1,7 +1,7 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}}
 <div class="admin-setting-content">
 	<h4 class="ui top attached header">
-		{{.locale.Tr "admin.dashboard.statistic"}}
+		{{ctx.Locale.Tr "admin.dashboard.statistic"}}
 	</h4>
 	<div class="ui attached table segment">
 		<table class="ui very basic striped table unstackable">
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl
index 68945ef0f3..fcb8ce0827 100644
--- a/templates/admin/user/edit.tmpl
+++ b/templates/admin/user/edit.tmpl
@@ -1,25 +1,25 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin edit user")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.users.edit_account"}}
+			{{ctx.Locale.Tr "admin.users.edit_account"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="./edit" method="post">
 				{{template "base/disable_form_autofill"}}
 				{{.CsrfTokenHtml}}
 				<div class="field {{if .Err_UserName}}error{{end}}">
-					<label for="user_name">{{.locale.Tr "username"}}</label>
+					<label for="user_name">{{ctx.Locale.Tr "username"}}</label>
 					<input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal}}disabled{{end}} maxlength="40">
 				</div>
 				<!-- Types and name -->
 				<div class="inline required field {{if .Err_LoginType}}error{{end}}">
-					<label>{{.locale.Tr "admin.users.auth_source"}}</label>
+					<label>{{ctx.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">{{.locale.Tr "admin.users.local"}}</div>
+						<div class="text">{{ctx.Locale.Tr "admin.users.local"}}</div>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
-							<div class="item" data-value="0-0">{{.locale.Tr "admin.users.local"}}</div>
+							<div class="item" data-value="0-0">{{ctx.Locale.Tr "admin.users.local"}}</div>
 							{{range .Sources}}
 								<div class="item" data-value="{{.Type.Int}}-{{.ID}}">{{.Name}}</div>
 							{{end}}
@@ -28,25 +28,25 @@
 				</div>
 
 				<div class="inline field {{if .Err_Visibility}}error{{end}}">
-					<span class="inline required field"><label for="visibility">{{.locale.Tr "settings.visibility"}}</label></span>
+					<span class="inline required field"><label for="visibility">{{ctx.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}}{{.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}}
+							{{if .User.Visibility.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}}
+							{{if .User.Visibility.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}}
+							{{if .User.Visibility.IsPrivate}}{{ctx.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" data-tooltip-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div>
+									<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{ctx.Locale.Tr "settings.visibility.public"}}</div>
 								{{else if $mode.IsLimited}}
-									<div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div>
+									<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{ctx.Locale.Tr "settings.visibility.limited"}}</div>
 								{{else if $mode.IsPrivate}}
-									<div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div>
+									<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{ctx.Locale.Tr "settings.visibility.private"}}</div>
 								{{end}}
 							{{end}}
 						</div>
@@ -54,81 +54,81 @@
 				</div>
 
 				<div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}gt-hidden{{end}}">
-					<label for="login_name">{{.locale.Tr "admin.users.auth_login_name"}}</label>
+					<label for="login_name">{{ctx.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">{{.locale.Tr "settings.full_name"}}</label>
+					<label for="full_name">{{ctx.Locale.Tr "settings.full_name"}}</label>
 					<input id="full_name" name="full_name" value="{{.User.FullName}}" maxlength="100">
 				</div>
 				<div class="required field {{if .Err_Email}}error{{end}}">
-					<label for="email">{{.locale.Tr "email"}}</label>
+					<label for="email">{{ctx.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))}}gt-hidden{{end}}">
-					<label for="password">{{.locale.Tr "password"}}</label>
+					<label for="password">{{ctx.Locale.Tr "password"}}</label>
 					<input id="password" name="password" type="password" autocomplete="new-password">
-					<p class="help">{{.locale.Tr "admin.users.password_helper"}}</p>
+					<p class="help">{{ctx.Locale.Tr "admin.users.password_helper"}}</p>
 				</div>
 				<div class="field {{if .Err_Website}}error{{end}}">
-					<label for="website">{{.locale.Tr "settings.website"}}</label>
+					<label for="website">{{ctx.Locale.Tr "settings.website"}}</label>
 					<input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="http://mydomain.com or https://mydomain.com" maxlength="255">
 				</div>
 				<div class="field {{if .Err_Location}}error{{end}}">
-					<label for="location">{{.locale.Tr "settings.location"}}</label>
+					<label for="location">{{ctx.Locale.Tr "settings.location"}}</label>
 					<input id="location" name="location" value="{{.User.Location}}" maxlength="50">
 				</div>
 
 				<div class="divider"></div>
 
 				<div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">
-					<label for="max_repo_creation">{{.locale.Tr "admin.users.max_repo_creation"}}</label>
+					<label for="max_repo_creation">{{ctx.Locale.Tr "admin.users.max_repo_creation"}}</label>
 					<input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.User.MaxRepoCreation}}">
-					<p class="help">{{.locale.Tr "admin.users.max_repo_creation_desc"}}</p>
+					<p class="help">{{ctx.Locale.Tr "admin.users.max_repo_creation_desc"}}</p>
 				</div>
 
 				<div class="divider"></div>
 
 				<div class="inline field">
 					<div class="ui checkbox">
-						<label><strong>{{.locale.Tr "admin.users.is_activated"}}</strong></label>
+						<label><strong>{{ctx.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>{{.locale.Tr "admin.users.prohibit_login"}}</strong></label>
+						<label><strong>{{ctx.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>{{.locale.Tr "admin.users.is_admin"}}</strong></label>
+						<label><strong>{{ctx.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>{{.locale.Tr "admin.users.is_restricted"}}</strong></label>
+						<label><strong>{{ctx.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}}gt-hidden{{end}}">
-					<div class="ui checkbox" data-tooltip-content="{{.locale.Tr "admin.users.allow_git_hook_tooltip"}}">
-						<label><strong>{{.locale.Tr "admin.users.allow_git_hook"}}</strong></label>
+					<div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.users.allow_git_hook_tooltip"}}">
+						<label><strong>{{ctx.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)}}gt-hidden{{end}}">
 					<div class="ui checkbox">
-						<label><strong>{{.locale.Tr "admin.users.allow_import_local"}}</strong></label>
+						<label><strong>{{ctx.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>{{.locale.Tr "admin.users.allow_create_organization"}}</strong></label>
+						<label><strong>{{ctx.Locale.Tr "admin.users.allow_create_organization"}}</strong></label>
 						<input name="allow_create_organization" type="checkbox" {{if .User.CanCreateOrganization}}checked{{end}}>
 					</div>
 				</div>
@@ -138,7 +138,7 @@
 				<div class="divider"></div>
 				<div class="inline field">
 					<div class="ui checkbox">
-						<label><strong>{{.locale.Tr "admin.users.reset_2fa"}}</strong></label>
+						<label><strong>{{ctx.Locale.Tr "admin.users.reset_2fa"}}</strong></label>
 						<input name="reset_2fa" type="checkbox">
 					</div>
 				</div>
@@ -147,14 +147,14 @@
 				<div class="divider"></div>
 
 				<div class="field">
-					<button class="ui primary button">{{.locale.Tr "admin.users.update_profile"}}</button>
-					<button class="ui red button show-modal" data-modal="#delete-user-modal">{{.locale.Tr "admin.users.delete_account"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "admin.users.update_profile"}}</button>
+					<button class="ui red button show-modal" data-modal="#delete-user-modal">{{ctx.Locale.Tr "admin.users.delete_account"}}</button>
 				</div>
 			</form>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.avatar"}}
+			{{ctx.Locale.Tr "settings.avatar"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="./avatar" method="post" enctype="multipart/form-data">
@@ -163,11 +163,11 @@
 				<div class="inline field">
 					<div class="ui radio checkbox">
 						<input name="source" value="lookup" type="radio" {{if not .User.UseCustomAvatar}}checked{{end}}>
-						<label>{{.locale.Tr "settings.lookup_avatar_by_mail"}}</label>
+						<label>{{ctx.Locale.Tr "settings.lookup_avatar_by_mail"}}</label>
 					</div>
 				</div>
 				<div class="field gt-pl-4 {{if .Err_Gravatar}}error{{end}}">
-					<label for="gravatar">Avatar {{.locale.Tr "email"}}</label>
+					<label for="gravatar">Avatar {{ctx.Locale.Tr "email"}}</label>
 					<input id="gravatar" name="gravatar" value="{{.User.AvatarEmail}}">
 				</div>
 				{{end}}
@@ -175,18 +175,18 @@
 				<div class="inline field">
 					<div class="ui radio checkbox">
 						<input name="source" value="local" type="radio" {{if .User.UseCustomAvatar}}checked{{end}}>
-						<label>{{.locale.Tr "settings.enable_custom_avatar"}}</label>
+						<label>{{ctx.Locale.Tr "settings.enable_custom_avatar"}}</label>
 					</div>
 				</div>
 
 				<div class="inline field gt-pl-4">
-					<label for="avatar">{{.locale.Tr "settings.choose_new_avatar"}}</label>
+					<label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
 					<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
 				</div>
 
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button>
-					<button class="ui red button link-action" data-url="./avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
+					<button class="ui red button link-action" data-url="./avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
 				</div>
 			</form>
 		</div>
@@ -195,18 +195,18 @@
 <div class="ui g-modal-confirm delete modal" id="delete-user-modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "settings.delete_account_title"}}
+		{{ctx.Locale.Tr "settings.delete_account_title"}}
 	</div>
 	<form class="ui form" method="post" action="./delete">
 		<div class="content">
-			<p>{{.locale.Tr "settings.delete_account_desc"}}</p>
+			<p>{{ctx.Locale.Tr "settings.delete_account_desc"}}</p>
 			{{$.CsrfTokenHtml}}
 			<div class="field">
 				<div class="ui checkbox">
-					<label for="purge">{{.locale.Tr "admin.users.purge"}}</label>
+					<label for="purge">{{ctx.Locale.Tr "admin.users.purge"}}</label>
 					<input name="purge" type="checkbox">
 				</div>
-				<p class="help">{{.locale.Tr "admin.users.purge_help"}}</p>
+				<p class="help">{{ctx.Locale.Tr "admin.users.purge_help"}}</p>
 			</div>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl
index 01a5e67ce9..fba67fac15 100644
--- a/templates/admin/user/list.tmpl
+++ b/templates/admin/user/list.tmpl
@@ -1,9 +1,9 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.users.user_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
+			{{ctx.Locale.Tr "admin.users.user_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
 			<div class="ui right">
-				<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/users/new">{{.locale.Tr "admin.users.new_account"}}</a>
+				<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/users/new">{{ctx.Locale.Tr "admin.users.new_account"}}</a>
 			</div>
 		</h4>
 		<div class="ui attached segment">
@@ -13,41 +13,41 @@
 				<div class="ui right floated secondary filter menu">
 					<!-- Status Filter Menu Item -->
 					<div class="ui dropdown type jump item">
-						<span class="text">{{.locale.Tr "admin.users.list_status_filter.menu_text"}}</span>
+						<span class="text">{{ctx.Locale.Tr "admin.users.list_status_filter.menu_text"}}</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
-							<a class="item j-reset-status-filter">{{.locale.Tr "admin.users.list_status_filter.reset"}}</a>
+							<a class="item j-reset-status-filter">{{ctx.Locale.Tr "admin.users.list_status_filter.reset"}}</a>
 							<div class="divider"></div>
-							<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>
+							<label class="item"><input type="radio" name="status_filter[is_admin]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_admin"}}</label>
+							<label class="item"><input type="radio" name="status_filter[is_admin]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_admin"}}</label>
 							<div class="divider"></div>
-							<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>
+							<label class="item"><input type="radio" name="status_filter[is_active]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_active"}}</label>
+							<label class="item"><input type="radio" name="status_filter[is_active]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_active"}}</label>
 							<div class="divider"></div>
-							<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>
+							<label class="item"><input type="radio" name="status_filter[is_restricted]" value="0"> {{ctx.Locale.Tr "admin.users.list_status_filter.not_restricted"}}</label>
+							<label class="item"><input type="radio" name="status_filter[is_restricted]" value="1"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_restricted"}}</label>
 							<div class="divider"></div>
-							<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>
+							<label class="item"><input type="radio" name="status_filter[is_prohibit_login]" value="0"> {{ctx.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"> {{ctx.Locale.Tr "admin.users.list_status_filter.is_prohibit_login"}}</label>
 							<div class="divider"></div>
-							<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>
+							<label class="item"><input type="radio" name="status_filter[is_2fa_enabled]" value="1"> {{ctx.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"> {{ctx.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">
-							{{.locale.Tr "repo.issues.filter_sort"}}
+							{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 						</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
-							<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>
+							<button class="item" name="sort" value="oldest">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</button>
+							<button class="item" name="sort" value="newest">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</button>
+							<button class="item" name="sort" value="alphabetically">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</button>
+							<button class="item" name="sort" value="reversealphabetically">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</button>
+							<button class="item" name="sort" value="recentupdate">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</button>
+							<button class="item" name="sort" value="leastupdate">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</button>
 						</div>
 					</div>
 				</div>
@@ -55,7 +55,7 @@
 				<!-- Search Text -->
 				<div class="ui fluid action input">
 					{{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}}
-					<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 				</div>
 			</form>
 		</div>
@@ -65,16 +65,16 @@
 					<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">
-							{{.locale.Tr "admin.users.name"}}
+							{{ctx.Locale.Tr "admin.users.name"}}
 							{{SortArrow "alphabetically" "reversealphabetically" $.SortType true}}
 						</th>
-						<th>{{.locale.Tr "email"}}</th>
-						<th>{{.locale.Tr "admin.users.activated"}}</th>
-						<th>{{.locale.Tr "admin.users.restricted"}}</th>
-						<th>{{.locale.Tr "admin.users.2fa"}}</th>
-						<th>{{.locale.Tr "admin.users.created"}}</th>
+						<th>{{ctx.Locale.Tr "email"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.activated"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.restricted"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.2fa"}}</th>
+						<th>{{ctx.Locale.Tr "admin.users.created"}}</th>
 						<th data-sortt-asc="lastlogin" data-sortt-desc="reverselastlogin">
-							{{.locale.Tr "admin.users.last_login"}}
+							{{ctx.Locale.Tr "admin.users.last_login"}}
 							{{SortArrow "lastlogin" "reverselastlogin" $.SortType false}}
 						</th>
 					</tr>
@@ -86,13 +86,13 @@
 							<td>
 								<a href="{{$.Link}}/{{.ID}}">{{.Name}}</a>
 								{{if .IsAdmin}}
-									<span class="ui mini label">{{$.locale.Tr "admin.users.admin"}}</span>
+									<span class="ui mini label">{{ctx.Locale.Tr "admin.users.admin"}}</span>
 								{{else if eq 2 .Type}}{{/* Reserved user */}}
-									<span class="ui mini label">{{$.locale.Tr "admin.users.reserved"}}</span>
+									<span class="ui mini label">{{ctx.Locale.Tr "admin.users.reserved"}}</span>
 								{{else if eq 4 .Type}}{{/* Bot "user" */}}
-									<span class="ui mini label">{{$.locale.Tr "admin.users.bot"}}</span>
+									<span class="ui mini label">{{ctx.Locale.Tr "admin.users.bot"}}</span>
 								{{else if eq 5 .Type}}{{/* Remote user */}}
-									<span class="ui mini label">{{$.locale.Tr "admin.users.remote"}}</span>
+									<span class="ui mini label">{{ctx.Locale.Tr "admin.users.remote"}}</span>
 								{{end}}
 							</td>
 							<td class="gt-ellipsis gt-max-width-12rem">{{.Email}}</td>
@@ -103,7 +103,7 @@
 							{{if .LastLoginUnix}}
 								<td>{{DateTime "short" .LastLoginUnix}}</td>
 							{{else}}
-								<td><span>{{$.locale.Tr "admin.users.never_login"}}</span></td>
+								<td><span>{{ctx.Locale.Tr "admin.users.never_login"}}</span></td>
 							{{end}}
 						</tr>
 					{{end}}
diff --git a/templates/admin/user/new.tmpl b/templates/admin/user/new.tmpl
index d4bc742f76..81f70511d0 100644
--- a/templates/admin/user/new.tmpl
+++ b/templates/admin/user/new.tmpl
@@ -1,7 +1,7 @@
 {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin new user")}}
 	<div class="admin-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "admin.users.new_account"}}
+			{{ctx.Locale.Tr "admin.users.new_account"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="{{.Link}}" method="post">
@@ -9,13 +9,13 @@
 				{{.CsrfTokenHtml}}
 				<!-- Types and name -->
 				<div class="inline required field {{if .Err_LoginType}}error{{end}}">
-					<label>{{.locale.Tr "admin.users.auth_source"}}</label>
+					<label>{{ctx.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">{{.locale.Tr "admin.users.local"}}</div>
+						<div class="text">{{ctx.Locale.Tr "admin.users.local"}}</div>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
-							<div class="item" data-value="0-0">{{.locale.Tr "admin.users.local"}}</div>
+							<div class="item" data-value="0-0">{{ctx.Locale.Tr "admin.users.local"}}</div>
 							{{range .Sources}}
 								<div class="item" data-value="{{.Type.Int}}-{{.ID}}">{{.Name}}</div>
 							{{end}}
@@ -24,23 +24,23 @@
 				</div>
 
 				<div class="inline field {{if .Err_Visibility}}error{{end}}">
-					<span class="inline required field"><label for="visibility">{{.locale.Tr "settings.visibility"}}</label></span>
+					<span class="inline required field"><label for="visibility">{{ctx.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}}{{.locale.Tr "settings.visibility.public"}}{{end}}
-							{{if .DefaultUserVisibilityMode.IsLimited}}{{.locale.Tr "settings.visibility.limited"}}{{end}}
-							{{if .DefaultUserVisibilityMode.IsPrivate}}{{.locale.Tr "settings.visibility.private"}}{{end}}
+							{{if .DefaultUserVisibilityMode.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}}
+							{{if .DefaultUserVisibilityMode.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}}
+							{{if .DefaultUserVisibilityMode.IsPrivate}}{{ctx.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" data-tooltip-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div>
+									<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{ctx.Locale.Tr "settings.visibility.public"}}</div>
 								{{else if $mode.IsLimited}}
-									<div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div>
+									<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{ctx.Locale.Tr "settings.visibility.limited"}}</div>
 								{{else if $mode.IsPrivate}}
-									<div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div>
+									<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{ctx.Locale.Tr "settings.visibility.private"}}</div>
 								{{end}}
 							{{end}}
 						</div>
@@ -48,25 +48,25 @@
 				</div>
 
 				<div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .login_type "0-0"}}gt-hidden{{end}}">
-					<label for="login_name">{{.locale.Tr "admin.users.auth_login_name"}}</label>
+					<label for="login_name">{{ctx.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">{{.locale.Tr "username"}}</label>
+					<label for="user_name">{{ctx.Locale.Tr "username"}}</label>
 					<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required maxlength="40">
 				</div>
 				<div class="required field {{if .Err_Email}}error{{end}}">
-					<label for="email">{{.locale.Tr "email"}}</label>
+					<label for="email">{{ctx.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")}}gt-hidden{{end}}">
-					<label for="password">{{.locale.Tr "password"}}</label>
+					<label for="password">{{ctx.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"}}gt-hidden{{end}}">
 					<div class="ui checkbox">
-						<label><strong>{{.locale.Tr "auth.allow_password_change"}}</strong></label>
+						<label><strong>{{ctx.Locale.Tr "auth.allow_password_change"}}</strong></label>
 						<input name="must_change_password" type="checkbox" checked>
 					</div>
 				</div>
@@ -75,14 +75,14 @@
 				{{if .CanSendEmail}}
 					<div class="inline field">
 						<div class="ui checkbox">
-							<label><strong>{{.locale.Tr "admin.users.send_register_notify"}}</strong></label>
+							<label><strong>{{ctx.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 primary button">{{.locale.Tr "admin.users.new_account"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "admin.users.new_account"}}</button>
 				</div>
 			</form>
 		</div>
diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl
index ad666152a0..f0a7865602 100644
--- a/templates/base/footer_content.tmpl
+++ b/templates/base/footer_content.tmpl
@@ -1,8 +1,8 @@
-<footer class="page-footer" role="group" aria-label="{{.locale.Tr "aria.footer"}}">
-	<div class="left-links" role="contentinfo" aria-label="{{.locale.Tr "aria.footer.software"}}">
-		<a target="_blank" rel="noopener noreferrer" href="https://about.gitea.com">{{.locale.Tr "powered_by" "Gitea"}}</a>
+<footer class="page-footer" role="group" aria-label="{{ctx.Locale.Tr "aria.footer"}}">
+	<div class="left-links" role="contentinfo" aria-label="{{ctx.Locale.Tr "aria.footer.software"}}">
+		<a target="_blank" rel="noopener noreferrer" href="https://about.gitea.com">{{ctx.Locale.Tr "powered_by" "Gitea"}}</a>
 		{{if (or .ShowFooterVersion .PageIsAdmin)}}
-			{{.locale.Tr "version"}}:
+			{{ctx.Locale.Tr "version"}}:
 			{{if .IsAdmin}}
 				<a href="{{AppSubUrl}}/admin/config">{{AppVer}}</a>
 			{{else}}
@@ -10,20 +10,20 @@
 			{{end}}
 		{{end}}
 		{{if and .TemplateLoadTimes ShowFooterTemplateLoadTime}}
-			{{.locale.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong>
-			{{.locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
+			{{ctx.Locale.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong>
+			{{ctx.Locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
 		{{end}}
 	</div>
-	<div class="right-links" role="group" aria-label="{{.locale.Tr "aria.footer.links"}}">
+	<div class="right-links" role="group" aria-label="{{ctx.Locale.Tr "aria.footer.links"}}">
 		<div class="ui dropdown upward language">
-			<span class="flex-text-inline">{{svg "octicon-globe" 14}} {{.locale.LangName}}</span>
+			<span class="flex-text-inline">{{svg "octicon-globe" 14}} {{ctx.Locale.LangName}}</span>
 			<div class="menu language-menu">
 				{{range .AllLangs}}
-					<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq $.locale.Lang .Lang}}active selected{{end}}">{{.Name}}</a>
+					<a lang="{{.Lang}}" data-url="{{AppSubUrl}}/?lang={{.Lang}}" class="item {{if eq ctx.Locale.Lang .Lang}}active selected{{end}}">{{.Name}}</a>
 				{{end}}
 			</div>
 		</div>
-		<a href="{{AssetUrlPrefix}}/licenses.txt">{{.locale.Tr "licenses"}}</a>
+		<a href="{{AssetUrlPrefix}}/licenses.txt">{{ctx.Locale.Tr "licenses"}}</a>
 		{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
 		{{template "custom/extra_links_footer" .}}
 	</div>
diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl
index 5a2d0ddb0b..effe4dcea9 100644
--- a/templates/base/head_navbar.tmpl
+++ b/templates/base/head_navbar.tmpl
@@ -3,17 +3,17 @@
 	{{$notificationUnreadCount = call .NotificationUnreadCount}}
 {{end}}
 
-<nav id="navbar" aria-label="{{.locale.Tr "aria.navbar"}}">
+<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
 	<div class="navbar-left ui secondary menu">
 		<!-- the logo -->
-		<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}">
-			<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}" aria-hidden="true">
+		<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
+			<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
 		</a>
 
 		<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
 		<div class="ui secondary menu item navbar-mobile-right">
 			{{if .IsSigned}}
-			<a id="mobile-notifications-icon" class="item gt-w-auto gt-p-3" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
+			<a id="mobile-notifications-icon" class="item gt-w-auto gt-p-3" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
 				<div class="gt-relative">
 					{{svg "octicon-bell"}}
 					<span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span>
@@ -28,34 +28,34 @@
 			{{/* No links */}}
 		{{else if .IsSigned}}
 			{{if not .UnitIssuesGlobalDisabled}}
-				<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{.locale.Tr "issues"}}</a>
+				<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{ctx.Locale.Tr "issues"}}</a>
 			{{end}}
 			{{if not .UnitPullsGlobalDisabled}}
-				<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{.locale.Tr "pull_requests"}}</a>
+				<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{ctx.Locale.Tr "pull_requests"}}</a>
 			{{end}}
 			{{if not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled)}}
 				{{if .ShowMilestonesDashboardPage}}
-					<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{.locale.Tr "milestones"}}</a>
+					<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a>
 				{{end}}
 			{{end}}
-			<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
+			<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
 		{{else if .IsLandingPageOrganizations}}
-			<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.locale.Tr "explore"}}</a>
+			<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{ctx.Locale.Tr "explore"}}</a>
 		{{else}}
-			<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
+			<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
 		{{end}}
 
 		{{template "custom/extra_links" .}}
 
 		{{if not .IsSigned}}
-			<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">{{.locale.Tr "help"}}</a>
+			<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">{{ctx.Locale.Tr "help"}}</a>
 		{{end}}
 	</div>
 
 	<!-- the full dropdown menus -->
 	<div class="navbar-right ui secondary menu">
 		{{if and .IsSigned .MustChangePassword}}
-			<div class="ui dropdown jump item" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}">
+			<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
 				<span class="text gt-df gt-ac">
 					{{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
 					<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
@@ -63,24 +63,24 @@
 				</span>
 				<div class="menu user-menu">
 					<div class="ui header">
-						{{.locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
+						{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
 					</div>
 
 					<div class="divider"></div>
 					<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
 						{{svg "octicon-sign-out"}}
-						{{.locale.Tr "sign_out"}}
+						{{ctx.Locale.Tr "sign_out"}}
 					</a>
 				</div><!-- end content avatar menu -->
 			</div><!-- end dropdown avatar menu -->
 		{{else if .IsSigned}}
 			{{if EnableTimetracking}}
-			<a class="active-stopwatch-trigger item gt-mx-0{{if not .ActiveStopwatch}} gt-hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}" title="{{.locale.Tr "active_stopwatch"}}">
+			<a class="active-stopwatch-trigger item gt-mx-0{{if not .ActiveStopwatch}} gt-hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}">
 				<div class="gt-relative">
 					{{svg "octicon-stopwatch"}}
 					<span class="header-stopwatch-dot"></span>
 				</div>
-				<span class="mobile-only gt-ml-3">{{.locale.Tr "active_stopwatch"}}</span>
+				<span class="mobile-only gt-ml-3">{{ctx.Locale.Tr "active_stopwatch"}}</span>
 			</a>
 			<div class="active-stopwatch-popup item tippy-target gt-p-3">
 				<div class="gt-df gt-ac">
@@ -96,7 +96,7 @@
 						<button
 							type="submit"
 							class="ui button mini compact basic icon"
-							data-tooltip-content="{{.locale.Tr "repo.issues.stop_tracking"}}"
+							data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
 						>{{svg "octicon-square-fill"}}</button>
 					</form>
 					<form class="stopwatch-cancel" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel">
@@ -104,44 +104,44 @@
 						<button
 							type="submit"
 							class="ui button mini compact basic icon"
-							data-tooltip-content="{{.locale.Tr "repo.issues.cancel_tracking"}}"
+							data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
 						>{{svg "octicon-trash"}}</button>
 					</form>
 				</div>
 			</div>
 			{{end}}
 
-			<a class="item not-mobile gt-mx-0" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
+			<a class="item not-mobile gt-mx-0" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
 				<div class="gt-relative">
 					{{svg "octicon-bell"}}
 					<span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span>
 				</div>
 			</a>
 
-			<div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{.locale.Tr "create_new"}}">
+			<div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
 				<span class="text">
 					{{svg "octicon-plus"}}
 					<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
-					<span class="mobile-only">{{.locale.Tr "create_new"}}</span>
+					<span class="mobile-only">{{ctx.Locale.Tr "create_new"}}</span>
 				</span>
 				<div class="menu">
 					<a class="item" href="{{AppSubUrl}}/repo/create">
-						{{svg "octicon-plus"}} {{.locale.Tr "new_repo"}}
+						{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
 					</a>
 					{{if not .DisableMigrations}}
 						<a class="item" href="{{AppSubUrl}}/repo/migrate">
-							{{svg "octicon-repo-push"}} {{.locale.Tr "new_migrate"}}
+							{{svg "octicon-repo-push"}} {{ctx.Locale.Tr "new_migrate"}}
 						</a>
 					{{end}}
 					{{if .SignedUser.CanCreateOrganization}}
 					<a class="item" href="{{AppSubUrl}}/org/create">
-						{{svg "octicon-organization"}} {{.locale.Tr "new_org"}}
+						{{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}}
 					</a>
 					{{end}}
 				</div><!-- end content create new menu -->
 			</div><!-- end dropdown menu create new -->
 
-			<div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}">
+			<div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
 				<span class="text gt-df gt-ac">
 					{{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
 					<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
@@ -149,56 +149,56 @@
 				</span>
 				<div class="menu user-menu">
 					<div class="ui header">
-						{{.locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
+						{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
 					</div>
 
 					<div class="divider"></div>
 					<a class="item" href="{{.SignedUser.HomeLink}}">
 						{{svg "octicon-person"}}
-						{{.locale.Tr "your_profile"}}
+						{{ctx.Locale.Tr "your_profile"}}
 					</a>
 					{{if not .DisableStars}}
 						<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
 							{{svg "octicon-star"}}
-							{{.locale.Tr "your_starred"}}
+							{{ctx.Locale.Tr "your_starred"}}
 						</a>
 					{{end}}
 					<a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
 						{{svg "octicon-bell"}}
-						{{.locale.Tr "notification.subscriptions"}}
+						{{ctx.Locale.Tr "notification.subscriptions"}}
 					</a>
 					<a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
 						{{svg "octicon-tools"}}
-						{{.locale.Tr "your_settings"}}
+						{{ctx.Locale.Tr "your_settings"}}
 					</a>
 					<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">
 						{{svg "octicon-question"}}
-						{{.locale.Tr "help"}}
+						{{ctx.Locale.Tr "help"}}
 					</a>
 					{{if .IsAdmin}}
 						<div class="divider"></div>
 
 						<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/admin">
 							{{svg "octicon-server"}}
-							{{.locale.Tr "admin_panel"}}
+							{{ctx.Locale.Tr "admin_panel"}}
 						</a>
 					{{end}}
 
 					<div class="divider"></div>
 					<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
 						{{svg "octicon-sign-out"}}
-						{{.locale.Tr "sign_out"}}
+						{{ctx.Locale.Tr "sign_out"}}
 					</a>
 				</div><!-- end content avatar menu -->
 			</div><!-- end dropdown avatar menu -->
 		{{else}}
 			{{if .ShowRegistrationButton}}
 				<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
-					{{svg "octicon-person"}} {{.locale.Tr "register"}}
+					{{svg "octicon-person"}} {{ctx.Locale.Tr "register"}}
 				</a>
 			{{end}}
 			<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
-				{{svg "octicon-sign-in"}} {{.locale.Tr "sign_in"}}
+				{{svg "octicon-sign-in"}} {{ctx.Locale.Tr "sign_in"}}
 			</a>
 		{{end}}
 	</div><!-- end full right menu -->
diff --git a/templates/base/head_script.tmpl b/templates/base/head_script.tmpl
index 03916fa637..4a723f63b9 100644
--- a/templates/base/head_script.tmpl
+++ b/templates/base/head_script.tmpl
@@ -34,13 +34,13 @@ If you introduce mistakes in it, Gitea JavaScript code wouldn't run correctly.
 		mermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}},
 		{{/* this global i18n object should only contain general texts. for specialized texts, it should be provided inside the related modules by: (1) API response (2) HTML data-attribute (3) PageData */}}
 		i18n: {
-			copy_success: {{.locale.Tr "copy_success"}},
-			copy_error: {{.locale.Tr "copy_error"}},
-			error_occurred: {{.locale.Tr "error.occurred"}},
-			network_error: {{.locale.Tr "error.network_error"}},
-			remove_label_str: {{.locale.Tr "remove_label_str"}},
-			modal_confirm: {{.locale.Tr "modal.confirm"}},
-			modal_cancel: {{.locale.Tr "modal.cancel"}},
+			copy_success: {{ctx.Locale.Tr "copy_success"}},
+			copy_error: {{ctx.Locale.Tr "copy_error"}},
+			error_occurred: {{ctx.Locale.Tr "error.occurred"}},
+			network_error: {{ctx.Locale.Tr "error.network_error"}},
+			remove_label_str: {{ctx.Locale.Tr "remove_label_str"}},
+			modal_confirm: {{ctx.Locale.Tr "modal.confirm"}},
+			modal_cancel: {{ctx.Locale.Tr "modal.cancel"}},
 		},
 	};
 	{{/* in case some pages don't render the pageData, we make sure it is an object to prevent null access */}}
diff --git a/templates/base/paginate.tmpl b/templates/base/paginate.tmpl
index 9dd1549ea1..503817c339 100644
--- a/templates/base/paginate.tmpl
+++ b/templates/base/paginate.tmpl
@@ -5,11 +5,11 @@
 			<div class="ui borderless pagination menu">
 				<a class="{{if .IsFirst}}disabled{{end}} item navigation" {{if not .IsFirst}}href="{{$.Link}}{{if $paginationLink}}?{{$paginationLink}}{{end}}"{{end}}>
 					{{svg "gitea-double-chevron-left" 16 "gt-mr-2"}}
-					<span class="navigation_label">{{$.locale.Tr "admin.first_page"}}</span>
+					<span class="navigation_label">{{ctx.Locale.Tr "admin.first_page"}}</span>
 				</a>
 				<a class="{{if not .HasPrevious}}disabled{{end}} item navigation" {{if .HasPrevious}}href="{{$.Link}}?page={{.Previous}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}>
 					{{svg "octicon-chevron-left" 16 "gt-mr-2"}}
-					<span class="navigation_label">{{$.locale.Tr "repo.issues.previous"}}</span>
+					<span class="navigation_label">{{ctx.Locale.Tr "repo.issues.previous"}}</span>
 				</a>
 				{{range .Pages}}
 					{{if eq .Num -1}}
@@ -19,11 +19,11 @@
 					{{end}}
 				{{end}}
 				<a class="{{if not .HasNext}}disabled{{end}} item navigation" {{if .HasNext}}href="{{$.Link}}?page={{.Next}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}>
-					<span class="navigation_label">{{$.locale.Tr "repo.issues.next"}}</span>
+					<span class="navigation_label">{{ctx.Locale.Tr "repo.issues.next"}}</span>
 					{{svg "octicon-chevron-right" 16 "gt-ml-2"}}
 				</a>
 				<a class="{{if .IsLast}}disabled{{end}} item navigation" {{if not .IsLast}}href="{{$.Link}}?page={{.TotalPages}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}>
-					<span class="navigation_label">{{$.locale.Tr "admin.last_page"}}</span>
+					<span class="navigation_label">{{ctx.Locale.Tr "admin.last_page"}}</span>
 					{{svg "gitea-double-chevron-right" 16 "gt-ml-2"}}
 				</a>
 			</div>
diff --git a/templates/code/searchcombo.tmpl b/templates/code/searchcombo.tmpl
index e495b3b454..48dc13b47b 100644
--- a/templates/code/searchcombo.tmpl
+++ b/templates/code/searchcombo.tmpl
@@ -3,15 +3,15 @@
 <div class="ui user list">
 	{{if .CodeIndexerUnavailable}}
 		<div class="ui error message">
-			<p>{{$.locale.Tr "explore.code_search_unavailable"}}</p>
+			<p>{{ctx.Locale.Tr "explore.code_search_unavailable"}}</p>
 		</div>
 	{{else if .SearchResults}}
 		<h3>
-			{{.locale.Tr "explore.code_search_results" (.Keyword|Escape) | Str2html}}
+			{{ctx.Locale.Tr "explore.code_search_results" (.Keyword|Escape) | Str2html}}
 		</h3>
 		{{template "code/searchresults" .}}
 	{{else if .Keyword}}
-		<div>{{$.locale.Tr "explore.code_no_results"}}</div>
+		<div>{{ctx.Locale.Tr "explore.code_no_results"}}</div>
 	{{end}}
 </div>
 {{template "base/paginate" .}}
diff --git a/templates/code/searchform.tmpl b/templates/code/searchform.tmpl
index 8b1f99cc88..8cb840bb31 100644
--- a/templates/code/searchform.tmpl
+++ b/templates/code/searchform.tmpl
@@ -1,14 +1,14 @@
 <form class="ui form ignore-dirty">
 	<div class="ui fluid action input">
 		{{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true "Disabled" .CodeIndexerUnavailable}}
-		<div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{.locale.Tr "explore.search.type.tooltip"}}">
+		<div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{ctx.Locale.Tr "explore.search.type.tooltip"}}">
 			<input name="t" type="hidden" value="{{.queryType}}"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
-			<div class="text">{{.locale.Tr (printf "explore.search.%s" (or .queryType "fuzzy"))}}</div>
+			<div class="text">{{ctx.Locale.Tr (printf "explore.search.%s" (or .queryType "fuzzy"))}}</div>
 			<div class="menu">
-				<div class="item" data-value="" data-tooltip-content="{{.locale.Tr "explore.search.fuzzy.tooltip"}}">{{.locale.Tr "explore.search.fuzzy"}}</div>
-				<div class="item" data-value="match" data-tooltip-content="{{.locale.Tr "explore.search.match.tooltip"}}">{{.locale.Tr "explore.search.match"}}</div>
+				<div class="item" data-value="" data-tooltip-content="{{ctx.Locale.Tr "explore.search.fuzzy.tooltip"}}">{{ctx.Locale.Tr "explore.search.fuzzy"}}</div>
+				<div class="item" data-value="match" data-tooltip-content="{{ctx.Locale.Tr "explore.search.match.tooltip"}}">{{ctx.Locale.Tr "explore.search.match"}}</div>
 			</div>
 		</div>
-		<button class="ui primary button"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{.locale.Tr "explore.search"}}</button>
+		<button class="ui primary button"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{ctx.Locale.Tr "explore.search"}}</button>
 	</div>
 </form>
diff --git a/templates/code/searchresults.tmpl b/templates/code/searchresults.tmpl
index faac696705..28c33a26de 100644
--- a/templates/code/searchresults.tmpl
+++ b/templates/code/searchresults.tmpl
@@ -15,11 +15,11 @@
 				<span class="file gt-f1">
 					<a rel="nofollow" href="{{$repo.Link}}">{{$repo.FullName}}</a>
 						{{if $repo.IsArchived}}
-							<span class="ui basic label">{{$.locale.Tr "repo.desc.archived"}}</span>
+							<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
 						{{end}}
 					- {{.Filename}}
 				</span>
-				<a role="button" class="ui basic tiny button" rel="nofollow" href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{.Filename | PathEscapeSegments}}">{{$.locale.Tr "repo.diff.view_file"}}</a>
+				<a role="button" class="ui basic tiny button" rel="nofollow" href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{.Filename | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
 			</h4>
 			<div class="ui attached table segment">
 				<div class="file-body file-code code-view">
diff --git a/templates/devtest/flex-list.tmpl b/templates/devtest/flex-list.tmpl
index bbcbc4e816..c8584c110b 100644
--- a/templates/devtest/flex-list.tmpl
+++ b/templates/devtest/flex-list.tmpl
@@ -69,7 +69,7 @@
 							<a class="text primary" href="{{$.Link}}">
 								gitea-org / gitea
 							</a>
-							<span data-tooltip-content="{{$.locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
+							<span data-tooltip-content="{{ctx.Locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
 						</div>
 						<div class="flex-item-trailing">
 							<a class="muted" href="{{$.Link}}">
diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl
index e15ed0b8df..fa74ed7ce6 100644
--- a/templates/devtest/gitea-ui.tmpl
+++ b/templates/devtest/gitea-ui.tmpl
@@ -112,24 +112,24 @@
 
 	<div>
 		<h1>LocaleNumber</h1>
-		<div>{{.locale.PrettyNumber 1}}</div>
-		<div>{{.locale.PrettyNumber 12}}</div>
-		<div>{{.locale.PrettyNumber 123}}</div>
-		<div>{{.locale.PrettyNumber 1234}}</div>
-		<div>{{.locale.PrettyNumber 12345}}</div>
-		<div>{{.locale.PrettyNumber 123456}}</div>
-		<div>{{.locale.PrettyNumber 1234567}}</div>
+		<div>{{ctx.Locale.PrettyNumber 1}}</div>
+		<div>{{ctx.Locale.PrettyNumber 12}}</div>
+		<div>{{ctx.Locale.PrettyNumber 123}}</div>
+		<div>{{ctx.Locale.PrettyNumber 1234}}</div>
+		<div>{{ctx.Locale.PrettyNumber 12345}}</div>
+		<div>{{ctx.Locale.PrettyNumber 123456}}</div>
+		<div>{{ctx.Locale.PrettyNumber 1234567}}</div>
 	</div>
 
 	<div>
 		<h1>TimeSince</h1>
-		<div>Now: {{TimeSince .TimeNow $.locale}}</div>
-		<div>5s past: {{TimeSince .TimePast5s $.locale}}</div>
-		<div>5s future: {{TimeSince .TimeFuture5s $.locale}}</div>
-		<div>2m past: {{TimeSince .TimePast2m $.locale}}</div>
-		<div>2m future: {{TimeSince .TimeFuture2m $.locale}}</div>
-		<div>1y past: {{TimeSince .TimePast1y $.locale}}</div>
-		<div>1y future: {{TimeSince .TimeFuture1y $.locale}}</div>
+		<div>Now: {{TimeSince .TimeNow ctx.Locale}}</div>
+		<div>5s past: {{TimeSince .TimePast5s ctx.Locale}}</div>
+		<div>5s future: {{TimeSince .TimeFuture5s ctx.Locale}}</div>
+		<div>2m past: {{TimeSince .TimePast2m ctx.Locale}}</div>
+		<div>2m future: {{TimeSince .TimeFuture2m ctx.Locale}}</div>
+		<div>1y past: {{TimeSince .TimePast1y ctx.Locale}}</div>
+		<div>1y future: {{TimeSince .TimeFuture1y ctx.Locale}}</div>
 	</div>
 
 	<div>
diff --git a/templates/devtest/tmplerr-sub.tmpl b/templates/devtest/tmplerr-sub.tmpl
index c4c8516307..f7974eb12e 100644
--- a/templates/devtest/tmplerr-sub.tmpl
+++ b/templates/devtest/tmplerr-sub.tmpl
@@ -1,3 +1,3 @@
 sub template triggers an executing error
 
-		{{.locale.NoSuch "asdf"}}
+		{{ctx.Locale.NoSuch "asdf"}}
diff --git a/templates/explore/navbar.tmpl b/templates/explore/navbar.tmpl
index 9dbb0320b2..7f2aea497a 100644
--- a/templates/explore/navbar.tmpl
+++ b/templates/explore/navbar.tmpl
@@ -1,19 +1,19 @@
 <div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
 	<div class="new-menu-inner">
 		<a class="{{if .PageIsExploreRepositories}}active {{end}}item" href="{{AppSubUrl}}/explore/repos">
-			{{svg "octicon-repo"}} {{.locale.Tr "explore.repos"}}
+			{{svg "octicon-repo"}} {{ctx.Locale.Tr "explore.repos"}}
 		</a>
 		{{if not .UsersIsDisabled}}
 			<a class="{{if .PageIsExploreUsers}}active {{end}}item" href="{{AppSubUrl}}/explore/users">
-				{{svg "octicon-person"}} {{.locale.Tr "explore.users"}}
+				{{svg "octicon-person"}} {{ctx.Locale.Tr "explore.users"}}
 			</a>
 		{{end}}
 		<a class="{{if .PageIsExploreOrganizations}}active {{end}}item" href="{{AppSubUrl}}/explore/organizations">
-			{{svg "octicon-organization"}} {{.locale.Tr "explore.organizations"}}
+			{{svg "octicon-organization"}} {{ctx.Locale.Tr "explore.organizations"}}
 		</a>
 		{{if and (not $.UnitTypeCode.UnitGlobalDisabled) .IsRepoIndexerEnabled}}
 		<a class="{{if .PageIsExploreCode}}active {{end}}item" href="{{AppSubUrl}}/explore/code">
-			{{svg "octicon-code"}} {{.locale.Tr "explore.code"}}
+			{{svg "octicon-code"}} {{ctx.Locale.Tr "explore.code"}}
 		</a>
 		{{end}}
 	</div>
diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl
index 260f165b73..3583908743 100644
--- a/templates/explore/repo_list.tmpl
+++ b/templates/explore/repo_list.tmpl
@@ -12,30 +12,30 @@
 						</a>
 						<span class="label-list">
 							{{if .IsArchived}}
-								<span class="ui basic label">{{$.locale.Tr "repo.desc.archived"}}</span>
+								<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
 							{{end}}
 							{{if .IsTemplate}}
 								{{if .IsPrivate}}
-									<span class="ui basic label">{{$.locale.Tr "repo.desc.private_template"}}</span>
+									<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span>
 								{{else}}
 									{{if .Owner.Visibility.IsPrivate}}
-										<span class="ui basic label">{{$.locale.Tr "repo.desc.internal_template"}}</span>
+										<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span>
 									{{end}}
 								{{end}}
 							{{else}}
 								{{if .IsPrivate}}
-									<span class="ui basic label">{{$.locale.Tr "repo.desc.private"}}</span>
+									<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
 								{{else}}
 									{{if .Owner.Visibility.IsPrivate}}
-										<span class="ui basic label">{{$.locale.Tr "repo.desc.internal"}}</span>
+										<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
 									{{end}}
 								{{end}}
 							{{end}}
 						</span>
 						{{if .IsFork}}
-							<span data-tooltip-content="{{$.locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
+							<span data-tooltip-content="{{ctx.Locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
 						{{else if .IsMirror}}
-							<span data-tooltip-content="{{$.locale.Tr "mirror"}}">{{svg "octicon-mirror"}}</span>
+							<span data-tooltip-content="{{ctx.Locale.Tr "mirror"}}">{{svg "octicon-mirror"}}</span>
 						{{end}}
 					</div>
 					<div class="flex-item-trailing">
@@ -61,12 +61,12 @@
 					{{end}}
 					</div>
 				{{end}}
-				<div class="flex-item-body">{{$.locale.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix $.locale}}</div>
+				<div class="flex-item-body">{{ctx.Locale.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix ctx.Locale}}</div>
 			</div>
 		</div>
 	{{else}}
 	<div>
-		{{$.locale.Tr "explore.repo_no_results"}}
+		{{ctx.Locale.Tr "explore.repo_no_results"}}
 	</div>
 	{{end}}
 </div>
diff --git a/templates/explore/repo_search.tmpl b/templates/explore/repo_search.tmpl
index 3829594820..1d7030c566 100644
--- a/templates/explore/repo_search.tmpl
+++ b/templates/explore/repo_search.tmpl
@@ -9,34 +9,34 @@
 			{{else}}
 				<input type="hidden" name="tab" value="repositories">
 			{{end}}
-			<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+			<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 		</div>
 	</form>
 	<!-- Sort -->
 	<div class="ui dropdown type jump item gt-mr-0">
 		<span class="text">
-			{{.locale.Tr "repo.issues.filter_sort"}}
+			{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 		</span>
 		{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 		<div class="menu">
-			<a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=newest&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a>
-			<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=oldest&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a>
-			<a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=alphabetically&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
-			<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=reversealphabetically&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
-			<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=recentupdate&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
-			<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=leastupdate&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+			<a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=newest&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
+			<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=oldest&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+			<a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=alphabetically&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
+			<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=reversealphabetically&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
+			<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=recentupdate&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+			<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=leastupdate&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
 			{{if not .DisableStars}}
-				<a class="{{if eq .SortType "moststars"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=moststars&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.filter_sort.moststars"}}</a>
-				<a class="{{if eq .SortType "feweststars"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=feweststars&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.filter_sort.feweststars"}}</a>
+				<a class="{{if eq .SortType "moststars"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=moststars&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.moststars"}}</a>
+				<a class="{{if eq .SortType "feweststars"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=feweststars&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.feweststars"}}</a>
 			{{end}}
-			<a class="{{if eq .SortType "mostforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=mostforks&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.filter_sort.mostforks"}}</a>
-			<a class="{{if eq .SortType "fewestforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=fewestforks&q={{$.Keyword}}&language={{$.Language}}">{{.locale.Tr "repo.issues.filter_sort.fewestforks"}}</a>
+			<a class="{{if eq .SortType "mostforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=mostforks&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostforks"}}</a>
+			<a class="{{if eq .SortType "fewestforks"}}active {{end}}item" href="{{$.Link}}?tab={{$.TabName}}&sort=fewestforks&q={{$.Keyword}}&language={{$.Language}}">{{ctx.Locale.Tr "repo.issues.filter_sort.fewestforks"}}</a>
 		</div>
 	</div>
 </div>
 {{if and .PageIsExploreRepositories .OnlyShowRelevant}}
 	<div class="ui message explore-relevancy-note">
-		<span data-tooltip-content="{{.locale.Tr "explore.relevant_repositories_tooltip"}}">{{.locale.Tr "explore.relevant_repositories" ((print $.Link "?only_show_relevant=0")|Escape) | Safe}}</span>
+		<span data-tooltip-content="{{ctx.Locale.Tr "explore.relevant_repositories_tooltip"}}">{{ctx.Locale.Tr "explore.relevant_repositories" ((print $.Link "?only_show_relevant=0")|Escape) | Safe}}</span>
 	</div>
 {{end}}
 <div class="divider"></div>
diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl
index 72da802279..63b842cbbf 100644
--- a/templates/explore/search.tmpl
+++ b/templates/explore/search.tmpl
@@ -2,22 +2,22 @@
 	<form class="ui form ignore-dirty gt-f1">
 		<div class="ui fluid action input">
 			{{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}}
-			<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+			<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 		</div>
 	</form>
 	<!-- Sort -->
 	<div class="ui dropdown type jump item gt-mr-0">
 		<span class="text">
-			{{.locale.Tr "repo.issues.filter_sort"}}
+			{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 		</span>
 		{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 		<div class="menu">
-			<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 "oldest"}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</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 "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
+			<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+			<a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
+			<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.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}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+			<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
 		</div>
 	</div>
 </div>
diff --git a/templates/home.tmpl b/templates/home.tmpl
index 1f10f3c8d2..78364431e9 100644
--- a/templates/home.tmpl
+++ b/templates/home.tmpl
@@ -1,49 +1,49 @@
 {{template "base/head" .}}
-<div role="main" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}" class="page-content home">
+<div role="main" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}" class="page-content home">
 	<div class="gt-mb-5 gt-px-5">
 		<div class="center">
-			<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}">
+			<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
 			<div class="hero">
 				<h1 class="ui icon header title">
 					{{AppName}}
 				</h1>
-				<h2>{{.locale.Tr "startpage.app_desc"}}</h2>
+				<h2>{{ctx.Locale.Tr "startpage.app_desc"}}</h2>
 			</div>
 		</div>
 	</div>
 	<div class="ui stackable middle very relaxed page grid">
 		<div class="eight wide center column">
 			<h1 class="hero ui icon header">
-				{{svg "octicon-flame"}} {{.locale.Tr "startpage.install"}}
+				{{svg "octicon-flame"}} {{ctx.Locale.Tr "startpage.install"}}
 			</h1>
 			<p class="large">
-				{{.locale.Tr "startpage.install_desc" | Str2html}}
+				{{ctx.Locale.Tr "startpage.install_desc" | Str2html}}
 			</p>
 		</div>
 		<div class="eight wide center column">
 			<h1 class="hero ui icon header">
-				{{svg "octicon-device-desktop"}} {{.locale.Tr "startpage.platform"}}
+				{{svg "octicon-device-desktop"}} {{ctx.Locale.Tr "startpage.platform"}}
 			</h1>
 			<p class="large">
-				{{.locale.Tr "startpage.platform_desc" | Str2html}}
+				{{ctx.Locale.Tr "startpage.platform_desc" | Str2html}}
 			</p>
 		</div>
 	</div>
 	<div class="ui stackable middle very relaxed page grid">
 		<div class="eight wide center column">
 			<h1 class="hero ui icon header">
-				{{svg "octicon-rocket"}} {{.locale.Tr "startpage.lightweight"}}
+				{{svg "octicon-rocket"}} {{ctx.Locale.Tr "startpage.lightweight"}}
 			</h1>
 			<p class="large">
-				{{.locale.Tr "startpage.lightweight_desc" | Str2html}}
+				{{ctx.Locale.Tr "startpage.lightweight_desc" | Str2html}}
 			</p>
 		</div>
 		<div class="eight wide center column">
 			<h1 class="hero ui icon header">
-				{{svg "octicon-code"}} {{.locale.Tr "startpage.license"}}
+				{{svg "octicon-code"}} {{ctx.Locale.Tr "startpage.license"}}
 			</h1>
 			<p class="large">
-				{{.locale.Tr "startpage.license_desc" | Str2html}}
+				{{ctx.Locale.Tr "startpage.license_desc" | Str2html}}
 			</p>
 		</div>
 	</div>
diff --git a/templates/install.tmpl b/templates/install.tmpl
index c8e094b5a3..e9b267fa1c 100644
--- a/templates/install.tmpl
+++ b/templates/install.tmpl
@@ -3,19 +3,19 @@
 	<div class="ui grid install-config-container">
 		<div class="sixteen wide center aligned centered column">
 			<h3 class="ui top attached header">
-				{{.locale.Tr "install.title"}}
+				{{ctx.Locale.Tr "install.title"}}
 			</h3>
 			<div class="ui attached segment">
 				{{template "base/alert" .}}
 
-				<p>{{.locale.Tr "install.docker_helper" "https://docs.gitea.com/installation/install-with-docker" | Safe}}</p>
+				<p>{{ctx.Locale.Tr "install.docker_helper" "https://docs.gitea.com/installation/install-with-docker" | Safe}}</p>
 
 				<form class="ui form" action="{{AppSubUrl}}/" method="post">
 					<!-- Database Settings -->
-					<h4 class="ui dividing header">{{.locale.Tr "install.db_title"}}</h4>
-					<p>{{.locale.Tr "install.require_db_desc"}}</p>
+					<h4 class="ui dividing header">{{ctx.Locale.Tr "install.db_title"}}</h4>
+					<p>{{ctx.Locale.Tr "install.require_db_desc"}}</p>
 					<div class="inline required field {{if .Err_DbType}}error{{end}}">
-						<label>{{.locale.Tr "install.db_type"}}</label>
+						<label>{{ctx.Locale.Tr "install.db_type"}}</label>
 						<div class="ui selection database type dropdown">
 							<input type="hidden" id="db_type" name="db_type" value="{{.CurDbType}}">
 							<div class="text">{{.CurDbType}}</div>
@@ -30,26 +30,26 @@
 
 					<div class="gt-mt-4 gt-hidden" data-db-setting-for="common-host">
 						<div class="inline required field {{if .Err_DbSetting}}error{{end}}">
-							<label for="db_host">{{.locale.Tr "install.host"}}</label>
+							<label for="db_host">{{ctx.Locale.Tr "install.host"}}</label>
 							<input id="db_host" name="db_host" value="{{.db_host}}">
 						</div>
 						<div class="inline required field {{if .Err_DbSetting}}error{{end}}">
-							<label for="db_user">{{.locale.Tr "install.user"}}</label>
+							<label for="db_user">{{ctx.Locale.Tr "install.user"}}</label>
 							<input id="db_user" name="db_user" value="{{.db_user}}">
 						</div>
 						<div class="inline required field {{if .Err_DbSetting}}error{{end}}">
-							<label for="db_passwd">{{.locale.Tr "install.password"}}</label>
+							<label for="db_passwd">{{ctx.Locale.Tr "install.password"}}</label>
 							<input id="db_passwd" name="db_passwd" type="password" value="{{.db_passwd}}">
 						</div>
 						<div class="inline required field {{if .Err_DbSetting}}error{{end}}">
-							<label for="db_name">{{.locale.Tr "install.db_name"}}</label>
+							<label for="db_name">{{ctx.Locale.Tr "install.db_name"}}</label>
 							<input id="db_name" name="db_name" value="{{.db_name}}">
 						</div>
 					</div>
 
 					<div class="gt-mt-4 gt-hidden" data-db-setting-for="postgres">
 						<div class="inline required field">
-							<label>{{.locale.Tr "install.ssl_mode"}}</label>
+							<label>{{ctx.Locale.Tr "install.ssl_mode"}}</label>
 							<div class="ui selection database type dropdown">
 								<input type="hidden" name="ssl_mode" value="{{if .ssl_mode}}{{.ssl_mode}}{{else}}disable{{end}}">
 								<div class="default text">disable</div>
@@ -62,38 +62,38 @@
 							</div>
 						</div>
 						<div class="inline field {{if .Err_DbSetting}}error{{end}}">
-							<label for="db_schema">{{.locale.Tr "install.db_schema"}}</label>
+							<label for="db_schema">{{ctx.Locale.Tr "install.db_schema"}}</label>
 							<input id="db_schema" name="db_schema" value="{{.db_schema}}">
-							<span class="help">{{.locale.Tr "install.db_schema_helper"}}</span>
+							<span class="help">{{ctx.Locale.Tr "install.db_schema_helper"}}</span>
 						</div>
 					</div>
 
 					<div class="gt-mt-4 gt-hidden" data-db-setting-for="sqlite3">
 						<div class="inline required field {{if or .Err_DbPath .Err_DbSetting}}error{{end}}">
-							<label for="db_path">{{.locale.Tr "install.path"}}</label>
+							<label for="db_path">{{ctx.Locale.Tr "install.path"}}</label>
 							<input id="db_path" name="db_path" value="{{.db_path}}">
-							<span class="help">{{.locale.Tr "install.sqlite_helper" | Safe}}</span>
+							<span class="help">{{ctx.Locale.Tr "install.sqlite_helper" | Safe}}</span>
 						</div>
 					</div>
 
 					{{if .Err_DbInstalledBefore}}
 					<div>
-						<p class="reinstall-message">{{.locale.Tr "install.reinstall_confirm_message"}}</p>
+						<p class="reinstall-message">{{ctx.Locale.Tr "install.reinstall_confirm_message"}}</p>
 						<div class="reinstall-confirm">
 							<div class="ui checkbox">
-								<label>{{.locale.Tr "install.reinstall_confirm_check_1"}}</label>
+								<label>{{ctx.Locale.Tr "install.reinstall_confirm_check_1"}}</label>
 								<input name="reinstall_confirm_first" type="checkbox">
 							</div>
 						</div>
 						<div class="reinstall-confirm">
 							<div class="ui checkbox">
-								<label>{{.locale.Tr "install.reinstall_confirm_check_2"}}</label>
+								<label>{{ctx.Locale.Tr "install.reinstall_confirm_check_2"}}</label>
 								<input name="reinstall_confirm_second" type="checkbox">
 							</div>
 						</div>
 						<div class="reinstall-confirm">
 							<div class="ui checkbox">
-								<label>{{.locale.Tr "install.reinstall_confirm_check_3"}}</label>
+								<label>{{ctx.Locale.Tr "install.reinstall_confirm_check_3"}}</label>
 								<input name="reinstall_confirm_third" type="checkbox">
 							</div>
 						</div>
@@ -101,98 +101,98 @@
 					{{end}}
 
 					<!-- General Settings -->
-					<h4 class="ui dividing header">{{.locale.Tr "install.general_title"}}</h4>
+					<h4 class="ui dividing header">{{ctx.Locale.Tr "install.general_title"}}</h4>
 					<div class="inline required field {{if .Err_AppName}}error{{end}}">
-						<label for="app_name">{{.locale.Tr "install.app_name"}}</label>
+						<label for="app_name">{{ctx.Locale.Tr "install.app_name"}}</label>
 						<input id="app_name" name="app_name" value="{{.app_name}}" required>
-						<span class="help">{{.locale.Tr "install.app_name_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.app_name_helper"}}</span>
 					</div>
 					<div class="inline required field {{if .Err_RepoRootPath}}error{{end}}">
-						<label for="repo_root_path">{{.locale.Tr "install.repo_path"}}</label>
+						<label for="repo_root_path">{{ctx.Locale.Tr "install.repo_path"}}</label>
 						<input id="repo_root_path" name="repo_root_path" value="{{.repo_root_path}}" required>
-						<span class="help">{{.locale.Tr "install.repo_path_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.repo_path_helper"}}</span>
 					</div>
 					<div class="inline field {{if .Err_LFSRootPath}}error{{end}}">
-						<label for="lfs_root_path">{{.locale.Tr "install.lfs_path"}}</label>
+						<label for="lfs_root_path">{{ctx.Locale.Tr "install.lfs_path"}}</label>
 						<input id="lfs_root_path" name="lfs_root_path" value="{{.lfs_root_path}}">
-						<span class="help">{{.locale.Tr "install.lfs_path_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.lfs_path_helper"}}</span>
 					</div>
 					<div class="inline required field {{if .Err_RunUser}}error{{end}}">
-						<label for="run_user">{{.locale.Tr "install.run_user"}}</label>
+						<label for="run_user">{{ctx.Locale.Tr "install.run_user"}}</label>
 						<input id="run_user" name="run_user" value="{{.run_user}}" readonly>
-						<span class="help">{{.locale.Tr "install.run_user_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.run_user_helper"}}</span>
 					</div>
 					<div class="inline required field">
-						<label for="domain">{{.locale.Tr "install.domain"}}</label>
+						<label for="domain">{{ctx.Locale.Tr "install.domain"}}</label>
 						<input id="domain" name="domain" value="{{.domain}}" placeholder="try.gitea.io" required>
-						<span class="help">{{.locale.Tr "install.domain_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.domain_helper"}}</span>
 					</div>
 					<div class="inline field">
-						<label for="ssh_port">{{.locale.Tr "install.ssh_port"}}</label>
+						<label for="ssh_port">{{ctx.Locale.Tr "install.ssh_port"}}</label>
 						<input id="ssh_port" name="ssh_port" value="{{.ssh_port}}">
-						<span class="help">{{.locale.Tr "install.ssh_port_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.ssh_port_helper"}}</span>
 					</div>
 					<div class="inline required field">
-						<label for="http_port">{{.locale.Tr "install.http_port"}}</label>
+						<label for="http_port">{{ctx.Locale.Tr "install.http_port"}}</label>
 						<input id="http_port" name="http_port" value="{{.http_port}}" required>
-						<span class="help">{{.locale.Tr "install.http_port_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.http_port_helper"}}</span>
 					</div>
 					<div class="inline required field">
-						<label for="app_url">{{.locale.Tr "install.app_url"}}</label>
+						<label for="app_url">{{ctx.Locale.Tr "install.app_url"}}</label>
 						<input id="app_url" name="app_url" value="{{.app_url}}" placeholder="https://try.gitea.io" required>
-						<span class="help">{{.locale.Tr "install.app_url_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.app_url_helper"}}</span>
 					</div>
 					<div class="inline required field">
-						<label for="log_root_path">{{.locale.Tr "install.log_root_path"}}</label>
+						<label for="log_root_path">{{ctx.Locale.Tr "install.log_root_path"}}</label>
 						<input id="log_root_path" name="log_root_path" value="{{.log_root_path}}" placeholder="log" required>
-						<span class="help">{{.locale.Tr "install.log_root_path_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.log_root_path_helper"}}</span>
 					</div>
 					<div class="inline field">
 						<div class="ui checkbox">
-							<label>{{.locale.Tr "install.enable_update_checker"}}</label>
+							<label>{{ctx.Locale.Tr "install.enable_update_checker"}}</label>
 							<input name="enable_update_checker" type="checkbox">
 						</div>
-						<span class="help">{{.locale.Tr "install.enable_update_checker_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "install.enable_update_checker_helper"}}</span>
 					</div>
 
 					<!-- Optional Settings -->
-					<h4 class="ui dividing header">{{.locale.Tr "install.optional_title"}}</h4>
+					<h4 class="ui dividing header">{{ctx.Locale.Tr "install.optional_title"}}</h4>
 
 					<!-- Email -->
 					<details class="optional field">
 						<summary class="right-content gt-py-3{{if .Err_SMTP}} text red{{end}}">
-							{{.locale.Tr "install.email_title"}}
+							{{ctx.Locale.Tr "install.email_title"}}
 						</summary>
 						<div class="inline field">
-							<label for="smtp_addr">{{.locale.Tr "install.smtp_addr"}}</label>
+							<label for="smtp_addr">{{ctx.Locale.Tr "install.smtp_addr"}}</label>
 							<input id="smtp_addr" name="smtp_addr" value="{{.smtp_addr}}">
 						</div>
 						<div class="inline field">
-							<label for="smtp_port">{{.locale.Tr "install.smtp_port"}}</label>
+							<label for="smtp_port">{{ctx.Locale.Tr "install.smtp_port"}}</label>
 							<input id="smtp_port" name="smtp_port" value="{{.smtp_port}}">
 						</div>
 						<div class="inline field {{if .Err_SMTPFrom}}error{{end}}">
-							<label for="smtp_from">{{.locale.Tr "install.smtp_from"}}</label>
+							<label for="smtp_from">{{ctx.Locale.Tr "install.smtp_from"}}</label>
 							<input id="smtp_from" name="smtp_from" value="{{.smtp_from}}">
-							<span class="help">{{.locale.Tr "install.smtp_from_helper"}}</span>
+							<span class="help">{{ctx.Locale.Tr "install.smtp_from_helper"}}</span>
 						</div>
 						<div class="inline field {{if .Err_SMTPUser}}error{{end}}">
-							<label for="smtp_user">{{.locale.Tr "install.mailer_user"}}</label>
+							<label for="smtp_user">{{ctx.Locale.Tr "install.mailer_user"}}</label>
 							<input id="smtp_user" name="smtp_user" value="{{.smtp_user}}">
 						</div>
 						<div class="inline field">
-							<label for="smtp_passwd">{{.locale.Tr "install.mailer_password"}}</label>
+							<label for="smtp_passwd">{{ctx.Locale.Tr "install.mailer_password"}}</label>
 							<input id="smtp_passwd" name="smtp_passwd" type="password" value="{{.smtp_passwd}}">
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox">
-								<label>{{.locale.Tr "install.register_confirm"}}</label>
+								<label>{{ctx.Locale.Tr "install.register_confirm"}}</label>
 								<input name="register_confirm" type="checkbox" {{if .register_confirm}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox">
-								<label>{{.locale.Tr "install.mail_notify"}}</label>
+								<label>{{ctx.Locale.Tr "install.mail_notify"}}</label>
 								<input name="mail_notify" type="checkbox" {{if .mail_notify}}checked{{end}}>
 							</div>
 						</div>
@@ -201,87 +201,87 @@
 					<!-- Server and other services -->
 					<details class="optional field">
 						<summary class="right-content gt-py-3{{if .Err_Services}} text red{{end}}">
-							{{.locale.Tr "install.server_service_title"}}
+							{{ctx.Locale.Tr "install.server_service_title"}}
 						</summary>
 						<div class="inline field">
 							<div class="ui checkbox" id="offline-mode">
-								<label data-tooltip-content="{{.locale.Tr "install.offline_mode_popup"}}">{{.locale.Tr "install.offline_mode"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.offline_mode_popup"}}">{{ctx.Locale.Tr "install.offline_mode"}}</label>
 								<input name="offline_mode" type="checkbox" {{if .offline_mode}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox" id="disable-gravatar">
-								<label data-tooltip-content="{{.locale.Tr "install.disable_gravatar_popup"}}">{{.locale.Tr "install.disable_gravatar"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.disable_gravatar_popup"}}">{{ctx.Locale.Tr "install.disable_gravatar"}}</label>
 								<input name="disable_gravatar" type="checkbox" {{if .disable_gravatar}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox" id="federated-avatar-lookup">
-								<label data-tooltip-content="{{.locale.Tr "install.federated_avatar_lookup_popup"}}">{{.locale.Tr "install.federated_avatar_lookup"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.federated_avatar_lookup_popup"}}">{{ctx.Locale.Tr "install.federated_avatar_lookup"}}</label>
 								<input name="enable_federated_avatar" type="checkbox" {{if .enable_federated_avatar}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox" id="enable-openid-signin">
-								<label data-tooltip-content="{{.locale.Tr "install.openid_signin_popup"}}">{{.locale.Tr "install.openid_signin"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.openid_signin_popup"}}">{{ctx.Locale.Tr "install.openid_signin"}}</label>
 								<input name="enable_open_id_sign_in" type="checkbox" {{if .enable_open_id_sign_in}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox" id="disable-registration">
-								<label data-tooltip-content="{{.locale.Tr "install.disable_registration_popup"}}">{{.locale.Tr "install.disable_registration"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.disable_registration_popup"}}">{{ctx.Locale.Tr "install.disable_registration"}}</label>
 								<input name="disable_registration" type="checkbox" {{if .disable_registration}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox" id="allow-only-external-registration">
-								<label data-tooltip-content="{{.locale.Tr "install.allow_only_external_registration_popup"}}">{{.locale.Tr "install.allow_only_external_registration_popup"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.allow_only_external_registration_popup"}}">{{ctx.Locale.Tr "install.allow_only_external_registration_popup"}}</label>
 								<input name="allow_only_external_registration" type="checkbox" {{if .allow_only_external_registration}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox" id="enable-openid-signup">
-								<label data-tooltip-content="{{.locale.Tr "install.openid_signup_popup"}}">{{.locale.Tr "install.openid_signup"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.openid_signup_popup"}}">{{ctx.Locale.Tr "install.openid_signup"}}</label>
 								<input name="enable_open_id_sign_up" type="checkbox" {{if .enable_open_id_sign_up}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox" id="enable-captcha">
-								<label data-tooltip-content="{{.locale.Tr "install.enable_captcha_popup"}}">{{.locale.Tr "install.enable_captcha"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.enable_captcha_popup"}}">{{ctx.Locale.Tr "install.enable_captcha"}}</label>
 								<input name="enable_captcha" type="checkbox" {{if .enable_captcha}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox">
-								<label data-tooltip-content="{{.locale.Tr "install.require_sign_in_view_popup"}}">{{.locale.Tr "install.require_sign_in_view"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.require_sign_in_view_popup"}}">{{ctx.Locale.Tr "install.require_sign_in_view"}}</label>
 								<input name="require_sign_in_view" type="checkbox" {{if .require_sign_in_view}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox">
-								<label data-tooltip-content="{{.locale.Tr "install.default_keep_email_private_popup"}}">{{.locale.Tr "install.default_keep_email_private"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.default_keep_email_private_popup"}}">{{ctx.Locale.Tr "install.default_keep_email_private"}}</label>
 								<input name="default_keep_email_private" type="checkbox" {{if .default_keep_email_private}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox">
-								<label data-tooltip-content="{{.locale.Tr "install.default_allow_create_organization_popup"}}">{{.locale.Tr "install.default_allow_create_organization"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.default_allow_create_organization_popup"}}">{{ctx.Locale.Tr "install.default_allow_create_organization"}}</label>
 								<input name="default_allow_create_organization" type="checkbox" {{if .default_allow_create_organization}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox">
-								<label data-tooltip-content="{{.locale.Tr "install.default_enable_timetracking_popup"}}">{{.locale.Tr "install.default_enable_timetracking"}}</label>
+								<label data-tooltip-content="{{ctx.Locale.Tr "install.default_enable_timetracking_popup"}}">{{ctx.Locale.Tr "install.default_enable_timetracking"}}</label>
 								<input name="default_enable_timetracking" type="checkbox" {{if .default_enable_timetracking}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">
-							<label for="no_reply_address">{{.locale.Tr "install.no_reply_address"}}</label>
+							<label for="no_reply_address">{{ctx.Locale.Tr "install.no_reply_address"}}</label>
 							<input id="_no_reply_address" name="no_reply_address" value="{{.no_reply_address}}">
-							<span class="help">{{.locale.Tr "install.no_reply_address_helper"}}</span>
+							<span class="help">{{ctx.Locale.Tr "install.no_reply_address_helper"}}</span>
 						</div>
 						<div class="inline field">
-							<label for="password_algorithm">{{.locale.Tr "install.password_algorithm"}}</label>
+							<label for="password_algorithm">{{ctx.Locale.Tr "install.password_algorithm"}}</label>
 							<div class="ui selection dropdown">
 								<input id="password_algorithm" type="hidden" name="password_algorithm" value="{{.password_algorithm}}">
 								<div class="text">{{.password_algorithm}}</div>
@@ -292,40 +292,40 @@
 									{{end}}
 								</div>
 							</div>
-							<span class="help">{{.locale.Tr "install.password_algorithm_helper"}}</span>
+							<span class="help">{{ctx.Locale.Tr "install.password_algorithm_helper"}}</span>
 						</div>
 					</details>
 
 					<!-- Admin -->
 					<details class="optional field">
 						<summary class="right-content gt-py-3{{if .Err_Admin}} text red{{end}}">
-							{{.locale.Tr "install.admin_title"}}
+							{{ctx.Locale.Tr "install.admin_title"}}
 						</summary>
-						<p class="center">{{.locale.Tr "install.admin_setting_desc"}}</p>
+						<p class="center">{{ctx.Locale.Tr "install.admin_setting_desc"}}</p>
 						<div class="inline field {{if .Err_AdminName}}error{{end}}">
-							<label for="admin_name">{{.locale.Tr "install.admin_name"}}</label>
+							<label for="admin_name">{{ctx.Locale.Tr "install.admin_name"}}</label>
 							<input id="admin_name" name="admin_name" value="{{.admin_name}}">
 						</div>
 						<div class="inline field {{if .Err_AdminEmail}}error{{end}}">
-							<label for="admin_email">{{.locale.Tr "install.admin_email"}}</label>
+							<label for="admin_email">{{ctx.Locale.Tr "install.admin_email"}}</label>
 							<input id="admin_email" name="admin_email" type="email" value="{{.admin_email}}">
 						</div>
 						<div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
-							<label for="admin_passwd">{{.locale.Tr "install.admin_password"}}</label>
+							<label for="admin_passwd">{{ctx.Locale.Tr "install.admin_password"}}</label>
 							<input id="admin_passwd" name="admin_passwd" type="password" autocomplete="new-password" value="{{.admin_passwd}}">
 						</div>
 						<div class="inline field {{if .Err_AdminPasswd}}error{{end}}">
-							<label for="admin_confirm_passwd">{{.locale.Tr "install.confirm_password"}}</label>
+							<label for="admin_confirm_passwd">{{ctx.Locale.Tr "install.confirm_password"}}</label>
 							<input id="admin_confirm_passwd" name="admin_confirm_passwd" autocomplete="new-password" type="password" value="{{.admin_confirm_passwd}}">
 						</div>
 					</details>
 
 					{{if .EnvConfigKeys}}
 					<!-- Environment Config -->
-					<h4 class="ui dividing header">{{.locale.Tr "install.env_config_keys"}}</h4>
+					<h4 class="ui dividing header">{{ctx.Locale.Tr "install.env_config_keys"}}</h4>
 					<div class="inline field">
 						<div class="right-content">
-							{{.locale.Tr "install.env_config_keys_prompt"}}
+							{{ctx.Locale.Tr "install.env_config_keys_prompt"}}
 						</div>
 						<div class="right-content gt-mt-3">
 							{{range .EnvConfigKeys}}<span class="ui label">{{.}}</span>{{end}}
@@ -339,7 +339,7 @@
 							These configuration options will be written into: {{.CustomConfFile}}
 						</div>
 						<div class="right-content gt-mt-3">
-							<button class="ui primary button">{{.locale.Tr "install.install_btn_confirm"}}</button>
+							<button class="ui primary button">{{ctx.Locale.Tr "install.install_btn_confirm"}}</button>
 						</div>
 					</div>
 				</form>
diff --git a/templates/org/create.tmpl b/templates/org/create.tmpl
index cd2ffbb68e..004cd9be80 100644
--- a/templates/org/create.tmpl
+++ b/templates/org/create.tmpl
@@ -5,40 +5,40 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "new_org"}}
+					{{ctx.Locale.Tr "new_org"}}
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_OrgName}}error{{end}}">
-						<label for="org_name">{{.locale.Tr "org.org_name_holder"}}</label>
+						<label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}}</label>
 						<input id="org_name" name="org_name" value="{{.org_name}}" autofocus required maxlength="40">
-						<span class="help">{{.locale.Tr "org.org_name_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "org.org_name_helper"}}</span>
 					</div>
 
 					<div class="inline field {{if .Err_OrgVisibility}}error{{end}}">
-						<span class="inline required field"><label for="visibility">{{.locale.Tr "org.settings.visibility"}}</label></span>
+						<span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label></span>
 						<div class="inline-grouped-list">
 							<div class="ui radio checkbox">
 								<input class="enable-system-radio" name="visibility" type="radio" value="0" {{if .DefaultOrgVisibilityMode.IsPublic}}checked{{end}}>
-								<label>{{.locale.Tr "org.settings.visibility.public"}}</label>
+								<label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label>
 							</div>
 							<div class="ui radio checkbox">
 								<input class="enable-system-radio" name="visibility" type="radio" value="1" {{if .DefaultOrgVisibilityMode.IsLimited}}checked{{end}}>
-								<label>{{.locale.Tr "org.settings.visibility.limited"}}</label>
+								<label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label>
 							</div>
 							<div class="ui radio checkbox">
 								<input class="enable-system-radio" name="visibility" type="radio" value="2" {{if .DefaultOrgVisibilityMode.IsPrivate}}checked{{end}}>
-								<label>{{.locale.Tr "org.settings.visibility.private"}}</label>
+								<label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label>
 							</div>
 						</div>
 					</div>
 
 					<div class="inline field" id="permission_box">
-						<label>{{.locale.Tr "org.settings.permission"}}</label>
+						<label>{{ctx.Locale.Tr "org.settings.permission"}}</label>
 						<div class="inline-grouped-list">
 							<div class="ui checkbox">
 								<input type="checkbox" name="repo_admin_change_team_access" checked>
-								<label>{{.locale.Tr "org.settings.repoadminchangeteam"}}</label>
+								<label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label>
 							</div>
 						</div>
 					</div>
@@ -46,7 +46,7 @@
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button">
-							{{.locale.Tr "org.create_org"}}
+							{{ctx.Locale.Tr "org.create_org"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl
index 9348e14544..72adf6d9b5 100644
--- a/templates/org/header.tmpl
+++ b/templates/org/header.tmpl
@@ -6,8 +6,8 @@
 					{{ctx.AvatarUtils.Avatar . 100}}
 					<span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span>
 					<span class="org-visibility">
-						{{if .Visibility.IsLimited}}<div class="ui medium basic horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
-						{{if .Visibility.IsPrivate}}<div class="ui medium basic horizontal label">{{$.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
+						{{if .Visibility.IsLimited}}<div class="ui medium basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
+						{{if .Visibility.IsPrivate}}<div class="ui medium basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
 					</span>
 				</div>
 			</div>
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl
index 18d5282a31..ff4f3a8b1a 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -6,11 +6,11 @@
 			<div class="ui header gt-df gt-fw">
 				{{.Org.DisplayName}}
 				<span class="org-visibility">
-					{{if .Org.Visibility.IsLimited}}<span class="ui large basic horizontal label">{{.locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
-					{{if .Org.Visibility.IsPrivate}}<span class="ui large basic horizontal label">{{.locale.Tr "org.settings.visibility.private_shortname"}}</span>{{end}}
+					{{if .Org.Visibility.IsLimited}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
+					{{if .Org.Visibility.IsPrivate}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</span>{{end}}
 				</span>
 				{{if .EnableFeed}}
-					<a class="rss-icon gt-mx-3" href="{{.Org.HomeLink}}.rss" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 24}}</a>
+					<a class="rss-icon gt-mx-3" href="{{.Org.HomeLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 24}}</a>
 				{{end}}
 			</div>
 			{{if $.RenderedDescription}}<div class="render-content markup">{{$.RenderedDescription|Str2html}}</div>{{end}}
@@ -25,9 +25,9 @@
 		<div class="right menu">
 			<button class="link-action ui basic button gt-mr-0" data-url="{{.Org.HomeLink}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}">
 				{{if $.IsFollowing}}
-					{{.locale.Tr "user.unfollow"}}
+					{{ctx.Locale.Tr "user.unfollow"}}
 				{{else}}
-					{{.locale.Tr "user.follow"}}
+					{{ctx.Locale.Tr "user.follow"}}
 				{{end}}
 			</button>
 		</div>
@@ -47,16 +47,16 @@
 			<div class="ui five wide column">
 				{{if .CanCreateOrgRepo}}
 					<div class="center aligned">
-						<a class="ui primary button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{.locale.Tr "new_repo"}}</a>
+						<a class="ui primary button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{ctx.Locale.Tr "new_repo"}}</a>
 						{{if not .DisableNewPullMirrors}}
-							<a class="ui primary button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{.locale.Tr "new_migrate"}}</a>
+							<a class="ui primary button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{ctx.Locale.Tr "new_migrate"}}</a>
 						{{end}}
 					</div>
 					<div class="divider"></div>
 				{{end}}
 				{{if .NumMembers}}
 					<h4 class="ui top attached header gt-df">
-						<strong class="gt-f1">{{.locale.Tr "org.members"}}</strong>
+						<strong class="gt-f1">{{ctx.Locale.Tr "org.members"}}</strong>
 						<a class="text grey gt-df gt-ac" href="{{.OrgLink}}/members"><span>{{.NumMembers}}</span> {{svg "octicon-chevron-right"}}</a>
 					</h4>
 					<div class="ui attached segment members">
@@ -70,7 +70,7 @@
 				{{end}}
 				{{if .IsOrganizationMember}}
 					<div class="ui top attached header gt-df">
-						<strong class="gt-f1">{{.locale.Tr "org.teams"}}</strong>
+						<strong class="gt-f1">{{ctx.Locale.Tr "org.teams"}}</strong>
 						<a class="text grey gt-df gt-ac" href="{{.OrgLink}}/teams"><span>{{.Org.NumTeams}}</span> {{svg "octicon-chevron-right"}}</a>
 					</div>
 					<div class="ui attached table segment teams">
@@ -78,15 +78,15 @@
 							<div class="item">
 								<a href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong class="team-name">{{.Name}}</strong></a>
 								<p class="text grey">
-									<a class="muted" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.NumMembers}}</strong> {{$.locale.Tr "org.lower_members"}}</a> ·
-									<a class="muted" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/repositories"><strong>{{.NumRepos}}</strong> {{$.locale.Tr "org.lower_repositories"}}</a>
+									<a class="muted" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.NumMembers}}</strong> {{ctx.Locale.Tr "org.lower_members"}}</a> ·
+									<a class="muted" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/repositories"><strong>{{.NumRepos}}</strong> {{ctx.Locale.Tr "org.lower_repositories"}}</a>
 								</p>
 							</div>
 						{{end}}
 					</div>
 					{{if .IsOrganizationOwner}}
 						<div class="ui bottom attached segment">
-							<a class="ui primary small button" href="{{.OrgLink}}/teams/new">{{.locale.Tr "org.create_new_team"}}</a>
+							<a class="ui primary small button" href="{{.OrgLink}}/teams/new">{{ctx.Locale.Tr "org.create_new_team"}}</a>
 						</div>
 					{{end}}
 				{{end}}
diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl
index 65ef7b66e7..e4ddb69805 100644
--- a/templates/org/member/members.tmpl
+++ b/templates/org/member/members.tmpl
@@ -15,17 +15,17 @@
 						<div class="flex-item-title">
 							{{template "shared/user/name" .}}
 							{{if not $isPublic}}
-								<span class="ui basic tiny label">{{$.locale.Tr "org.members.private"}}</span>
+								<span class="ui basic tiny label">{{ctx.Locale.Tr "org.members.private"}}</span>
 							{{end}}
 						</div>
 						{{if not $.PublicOnly}}
 							<div class="flex-item-body">
-								{{$.locale.Tr "org.members.member_role"}}
-								<strong class="flex-text-inline">{{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock"}} {{$.locale.Tr "org.members.owner"}}{{else}}{{$.locale.Tr "org.members.member"}}{{end}}</strong>
+								{{ctx.Locale.Tr "org.members.member_role"}}
+								<strong class="flex-text-inline">{{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock"}} {{ctx.Locale.Tr "org.members.owner"}}{{else}}{{ctx.Locale.Tr "org.members.member"}}{{end}}</strong>
 							</div>
 							{{if $.IsOrganizationOwner}}
 							<div class="flex-item-body">
-								{{$.locale.Tr "admin.users.2fa"}}
+								{{ctx.Locale.Tr "admin.users.2fa"}}
 								<strong>
 									{{if index $.MembersTwoFaStatus .ID}}
 										<span class="text green">{{svg "octicon-check"}}</span>
@@ -40,9 +40,9 @@
 					<div class="flex-item-trailing">
 						{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}
 							{{if $isPublic}}
-								<a class="ui tiny button link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{svg "octicon-eye-closed" 12 "icon"}}{{$.locale.Tr "org.members.public_helper"}}</a>
+								<a class="ui tiny button link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{svg "octicon-eye-closed" 12 "icon"}}{{ctx.Locale.Tr "org.members.public_helper"}}</a>
 							{{else}}
-								<a class="ui tiny button link-action" href data-url="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{svg "octicon-eye" 12 "icon"}}{{$.locale.Tr "org.members.private_helper"}}</a>
+								<a class="ui tiny button link-action" href data-url="{{$.OrgLink}}/members/action/public?uid={{.ID}}">{{svg "octicon-eye" 12 "icon"}}{{ctx.Locale.Tr "org.members.private_helper"}}</a>
 							{{end}}
 						{{end}}
 						{{if eq $.SignedUser.ID .ID}}
@@ -50,14 +50,14 @@
 								<button class="ui red tiny button delete-button" data-modal-id="leave-organization"
 									data-url="{{$.OrgLink}}/members/action/leave" data-datauid="{{.ID}}"
 									data-name="{{.DisplayName}}"
-									data-data-organization-name="{{$.Org.DisplayName}}">{{$.locale.Tr "org.members.leave"}}</button>
+									data-data-organization-name="{{$.Org.DisplayName}}">{{ctx.Locale.Tr "org.members.leave"}}</button>
 							</form>
 						{{else if $.IsOrganizationOwner}}
 							<form>
 								<button class="ui red tiny button delete-button" data-modal-id="remove-organization-member"
 									data-url="{{$.OrgLink}}/members/action/remove" data-datauid="{{.ID}}"
 									data-name="{{.DisplayName}}"
-									data-data-organization-name="{{$.Org.DisplayName}}">{{$.locale.Tr "org.members.remove"}}</button>
+									data-data-organization-name="{{$.Org.DisplayName}}">{{ctx.Locale.Tr "org.members.remove"}}</button>
 							</form>
 						{{end}}
 					</div>
@@ -70,19 +70,19 @@
 </div>
 <div class="ui g-modal-confirm delete modal" id="leave-organization">
 	<div class="header">
-		{{$.locale.Tr "org.members.leave"}}
+		{{ctx.Locale.Tr "org.members.leave"}}
 	</div>
 	<div class="content">
-		<p>{{$.locale.Tr "org.members.leave.detail" `<span class="dataOrganizationName"></span>` | Safe}}</p>
+		<p>{{ctx.Locale.Tr "org.members.leave.detail" `<span class="dataOrganizationName"></span>` | Safe}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
 <div class="ui g-modal-confirm delete modal" id="remove-organization-member">
 	<div class="header">
-		{{$.locale.Tr "org.members.remove"}}
+		{{ctx.Locale.Tr "org.members.remove"}}
 	</div>
 	<div class="content">
-		<p>{{$.locale.Tr "org.members.remove.detail" `<span class="name"></span>` `<span class="dataOrganizationName"></span>` | Safe}}</p>
+		<p>{{ctx.Locale.Tr "org.members.remove.detail" `<span class="name"></span>` `<span class="dataOrganizationName"></span>` | Safe}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/org/menu.tmpl b/templates/org/menu.tmpl
index 26c9f980a5..c3ec142e9c 100644
--- a/templates/org/menu.tmpl
+++ b/templates/org/menu.tmpl
@@ -1,35 +1,35 @@
 <div class="ui container">
 	<div class="ui secondary stackable pointing menu">
 		<a class="{{if .PageIsViewRepositories}}active {{end}}item" href="{{$.Org.HomeLink}}">
-			{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
+			{{svg "octicon-repo"}} {{ctx.Locale.Tr "user.repositories"}}
 			{{if .RepoCount}}
 				<div class="ui small label">{{.RepoCount}}</div>
 			{{end}}
 		</a>
 		{{if .CanReadProjects}}
 		<a class="{{if .PageIsViewProjects}}active {{end}}item" href="{{$.Org.HomeLink}}/-/projects">
-			{{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
+			{{svg "octicon-project-symlink"}} {{ctx.Locale.Tr "user.projects"}}
 		</a>
 		{{end}}
 		{{if and .IsPackageEnabled .CanReadPackages}}
 		<a class="item" href="{{$.Org.HomeLink}}/-/packages">
-			{{svg "octicon-package"}} {{.locale.Tr "packages.title"}}
+			{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
 		</a>
 		{{end}}
 		{{if and .IsRepoIndexerEnabled .CanReadCode}}
 		<a class="item" href="{{$.Org.HomeLink}}/-/code">
-			{{svg "octicon-code"}}&nbsp;{{$.locale.Tr "org.code"}}
+			{{svg "octicon-code"}}&nbsp;{{ctx.Locale.Tr "org.code"}}
 		</a>
 		{{end}}
 		{{if .NumMembers}}
 			<a class="{{if $.PageIsOrgMembers}}active {{end}}item" href="{{$.OrgLink}}/members">
-				{{svg "octicon-person"}}&nbsp;{{$.locale.Tr "org.members"}}
+				{{svg "octicon-person"}}&nbsp;{{ctx.Locale.Tr "org.members"}}
 				<div class="ui small label">{{.NumMembers}}</div>
 			</a>
 		{{end}}
 		{{if .IsOrganizationMember}}
 			<a class="{{if $.PageIsOrgTeams}}active {{end}}item" href="{{$.OrgLink}}/teams">
-				{{svg "octicon-people"}}&nbsp;{{$.locale.Tr "org.teams"}}
+				{{svg "octicon-people"}}&nbsp;{{ctx.Locale.Tr "org.teams"}}
 				{{if .NumTeams}}
 					<div class="ui small label">{{.NumTeams}}</div>
 				{{end}}
@@ -39,7 +39,7 @@
 		{{if .IsOrganizationOwner}}
 			<div class="right menu">
 				<a class="{{if .PageIsOrgSettings}}active {{end}}item" href="{{.OrgLink}}/settings">
-				{{svg "octicon-tools"}} {{.locale.Tr "repo.settings"}}
+				{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
 				</a>
 			</div>
 		{{end}}
diff --git a/templates/org/settings/applications.tmpl b/templates/org/settings/applications.tmpl
index 5934f99de7..df5f4e9dbc 100644
--- a/templates/org/settings/applications.tmpl
+++ b/templates/org/settings/applications.tmpl
@@ -1,7 +1,7 @@
 {{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings options")}}
 			<div class="org-setting-content">
 				<h4 class="ui top attached header">
-					{{.locale.Tr "settings.applications"}}
+					{{ctx.Locale.Tr "settings.applications"}}
 				</h4>
 
 				{{template "user/settings/applications_oauth2_list" .}}
diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl
index 9c8644da27..2cf8238f57 100644
--- a/templates/org/settings/delete.tmpl
+++ b/templates/org/settings/delete.tmpl
@@ -2,20 +2,20 @@
 
 			<div class="org-setting-content">
 				<h4 class="ui top attached error header">
-					{{.locale.Tr "org.settings.delete_account"}}
+					{{ctx.Locale.Tr "org.settings.delete_account"}}
 				</h4>
 				<div class="ui attached error segment">
 					<div class="ui red message">
-						<p class="text left">{{svg "octicon-alert"}} {{.locale.Tr "org.settings.delete_prompt" | Str2html}}</p>
+						<p class="text left">{{svg "octicon-alert"}} {{ctx.Locale.Tr "org.settings.delete_prompt" | Str2html}}</p>
 					</div>
 					<form class="ui form ignore-dirty" id="delete-form" action="{{.Link}}" method="post">
 						{{.CsrfTokenHtml}}
 						<div class="inline required field {{if .Err_OrgName}}error{{end}}">
-							<label for="org_name">{{.locale.Tr "org.org_name_holder"}}</label>
+							<label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}}</label>
 							<input id="org_name" name="org_name" value="" autocomplete="off" autofocus required>
 						</div>
 						<button class="ui red button delete-button" data-type="form" data-form="#delete-form">
-							{{.locale.Tr "org.settings.confirm_delete_account"}}
+							{{ctx.Locale.Tr "org.settings.confirm_delete_account"}}
 						</button>
 					</form>
 				</div>
@@ -24,10 +24,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "org.settings.delete_org_title"}}
+		{{ctx.Locale.Tr "org.settings.delete_org_title"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "org.settings.delete_org_desc"}}</p>
+		<p>{{ctx.Locale.Tr "org.settings.delete_org_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/org/settings/hook_new.tmpl b/templates/org/settings/hook_new.tmpl
index ea477c9975..f89ee5f2b8 100644
--- a/templates/org/settings/hook_new.tmpl
+++ b/templates/org/settings/hook_new.tmpl
@@ -1,7 +1,7 @@
 {{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings new webhook")}}
 	<div class="org-setting-content">
-		{{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}}
-		{{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}{{end}}
+		{{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}}
+		{{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}{{end}}
 		{{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
 	</div>
 {{template "org/settings/layout_footer" .}}
diff --git a/templates/org/settings/labels.tmpl b/templates/org/settings/labels.tmpl
index b38481fea3..b12ea8d9f4 100644
--- a/templates/org/settings/labels.tmpl
+++ b/templates/org/settings/labels.tmpl
@@ -2,9 +2,9 @@
 				<div class="org-setting-content">
 					<div class="gt-df gt-ac">
 						<div class="gt-f1">
-							{{$.locale.Tr "org.settings.labels_desc" | Str2html}}
+							{{ctx.Locale.Tr "org.settings.labels_desc" | Str2html}}
 						</div>
-						<button class="ui small primary new-label button">{{.locale.Tr "repo.issues.new_label"}}</button>
+						<button class="ui small primary new-label button">{{ctx.Locale.Tr "repo.issues.new_label"}}</button>
 					</div>
 					<div class="divider"></div>
 					{{template "repo/issue/labels/label_new" .}}
diff --git a/templates/org/settings/navbar.tmpl b/templates/org/settings/navbar.tmpl
index e22d1b0f80..201ac3b9f2 100644
--- a/templates/org/settings/navbar.tmpl
+++ b/templates/org/settings/navbar.tmpl
@@ -1,45 +1,45 @@
 <div class="four wide column">
 	<div class="ui fluid vertical menu">
-		<div class="header item">{{.locale.Tr "org.settings"}}</div>
+		<div class="header item">{{ctx.Locale.Tr "org.settings"}}</div>
 		<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.OrgLink}}/settings">
-			{{.locale.Tr "org.settings.options"}}
+			{{ctx.Locale.Tr "org.settings.options"}}
 		</a>
 		{{if not DisableWebhooks}}
 		<a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{.OrgLink}}/settings/hooks">
-			{{.locale.Tr "repo.settings.hooks"}}
+			{{ctx.Locale.Tr "repo.settings.hooks"}}
 		</a>
 		{{end}}
 		<a class="{{if .PageIsOrgSettingsLabels}}active {{end}}item" href="{{.OrgLink}}/settings/labels">
-			{{.locale.Tr "repo.labels"}}
+			{{ctx.Locale.Tr "repo.labels"}}
 		</a>
 		{{if .EnableOAuth2}}
 		<a class="{{if .PageIsSettingsApplications}}active {{end}}item" href="{{.OrgLink}}/settings/applications">
-			{{.locale.Tr "settings.applications"}}
+			{{ctx.Locale.Tr "settings.applications"}}
 		</a>
 		{{end}}
 		{{if .EnablePackages}}
 		<a class="{{if .PageIsSettingsPackages}}active {{end}}item" href="{{.OrgLink}}/settings/packages">
-			{{.locale.Tr "packages.title"}}
+			{{ctx.Locale.Tr "packages.title"}}
 		</a>
 		{{end}}
 		{{if .EnableActions}}
 		<details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}open{{end}}>
-			<summary>{{.locale.Tr "actions.actions"}}</summary>
+			<summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
 			<div class="menu">
 				<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{.OrgLink}}/settings/actions/runners">
-					{{.locale.Tr "actions.runners"}}
+					{{ctx.Locale.Tr "actions.runners"}}
 				</a>
 				<a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{.OrgLink}}/settings/actions/secrets">
-					{{.locale.Tr "secrets.secrets"}}
+					{{ctx.Locale.Tr "secrets.secrets"}}
 				</a>
 				<a class="{{if .PageIsSharedSettingsVariables}}active {{end}}item" href="{{.OrgLink}}/settings/actions/variables">
-					{{.locale.Tr "actions.variables"}}
+					{{ctx.Locale.Tr "actions.variables"}}
 				</a>
 			</div>
 		</details>
 		{{end}}
 		<a class="{{if .PageIsSettingsDelete}}active {{end}}item" href="{{.OrgLink}}/settings/delete">
-			{{.locale.Tr "org.settings.delete"}}
+			{{ctx.Locale.Tr "org.settings.delete"}}
 		</a>
 	</div>
 </div>
diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl
index 0b138094c3..31c0d85d89 100644
--- a/templates/org/settings/options.tmpl
+++ b/templates/org/settings/options.tmpl
@@ -1,69 +1,69 @@
 {{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings options")}}
 			<div class="org-setting-content">
 				<h4 class="ui top attached header">
-					{{.locale.Tr "org.settings.options"}}
+					{{ctx.Locale.Tr "org.settings.options"}}
 				</h4>
 				<div class="ui attached segment">
 					<form class="ui form" action="{{.Link}}" method="post">
 						{{.CsrfTokenHtml}}
 						<div class="required field {{if .Err_Name}}error{{end}}">
-							<label for="org_name">{{.locale.Tr "org.org_name_holder"}}
+							<label for="org_name">{{ctx.Locale.Tr "org.org_name_holder"}}
 								<span class="text red gt-hidden" id="org-name-change-prompt">
-									<br>{{.locale.Tr "org.settings.change_orgname_prompt"}}<br>{{.locale.Tr "org.settings.change_orgname_redirect_prompt"}}
+									<br>{{ctx.Locale.Tr "org.settings.change_orgname_prompt"}}<br>{{ctx.Locale.Tr "org.settings.change_orgname_redirect_prompt"}}
 								</span>
 							</label>
 							<input id="org_name" name="name" value="{{.Org.Name}}" data-org-name="{{.Org.Name}}" autofocus required maxlength="40">
 						</div>
 						<div class="field {{if .Err_FullName}}error{{end}}">
-							<label for="full_name">{{.locale.Tr "org.org_full_name_holder"}}</label>
+							<label for="full_name">{{ctx.Locale.Tr "org.org_full_name_holder"}}</label>
 							<input id="full_name" name="full_name" value="{{.Org.FullName}}" maxlength="100">
 						</div>
 						<div class="field {{if .Err_Email}}error{{end}}">
-							<label for="email">{{.locale.Tr "org.settings.email"}}</label>
+							<label for="email">{{ctx.Locale.Tr "org.settings.email"}}</label>
 							<input id="email" name="email" type="email" value="{{.Org.Email}}" maxlength="255">
 						</div>
 						<div class="field {{if .Err_Description}}error{{end}}">
-							<label for="description">{{$.locale.Tr "org.org_desc"}}</label>
+							<label for="description">{{ctx.Locale.Tr "org.org_desc"}}</label>
 							<textarea id="description" name="description" rows="2" maxlength="255">{{.Org.Description}}</textarea>
 						</div>
 						<div class="field {{if .Err_Website}}error{{end}}">
-							<label for="website">{{.locale.Tr "org.settings.website"}}</label>
+							<label for="website">{{ctx.Locale.Tr "org.settings.website"}}</label>
 							<input id="website" name="website" type="url" value="{{.Org.Website}}" maxlength="255">
 						</div>
 						<div class="field">
-							<label for="location">{{.locale.Tr "org.settings.location"}}</label>
+							<label for="location">{{ctx.Locale.Tr "org.settings.location"}}</label>
 							<input id="location" name="location"  value="{{.Org.Location}}" maxlength="50">
 						</div>
 
 						<div class="divider"></div>
 						<div class="field" id="visibility_box">
-							<label for="visibility">{{.locale.Tr "org.settings.visibility"}}</label>
+							<label for="visibility">{{ctx.Locale.Tr "org.settings.visibility"}}</label>
 							<div class="field">
 								<div class="ui radio checkbox">
 									<input class="enable-system-radio" name="visibility" type="radio" value="0" {{if eq .CurrentVisibility 0}}checked{{end}}>
-									<label>{{.locale.Tr "org.settings.visibility.public"}}</label>
+									<label>{{ctx.Locale.Tr "org.settings.visibility.public"}}</label>
 								</div>
 							</div>
 							<div class="field">
 								<div class="ui radio checkbox">
 									<input class="enable-system-radio" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}>
-									<label>{{.locale.Tr "org.settings.visibility.limited"}}</label>
+									<label>{{ctx.Locale.Tr "org.settings.visibility.limited"}}</label>
 								</div>
 							</div>
 							<div class="field">
 								<div class="ui radio checkbox">
 									<input class="enable-system-radio" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}>
-									<label>{{.locale.Tr "org.settings.visibility.private"}}</label>
+									<label>{{ctx.Locale.Tr "org.settings.visibility.private"}}</label>
 								</div>
 							</div>
 						</div>
 
 						<div class="field" id="permission_box">
-							<label>{{.locale.Tr "org.settings.permission"}}</label>
+							<label>{{ctx.Locale.Tr "org.settings.permission"}}</label>
 							<div class="field">
 								<div class="ui checkbox">
 									<input type="checkbox" name="repo_admin_change_team_access" {{if .RepoAdminChangeTeamAccess}}checked{{end}}>
-									<label>{{.locale.Tr "org.settings.repoadminchangeteam"}}</label>
+									<label>{{ctx.Locale.Tr "org.settings.repoadminchangeteam"}}</label>
 								</div>
 							</div>
 						</div>
@@ -72,14 +72,14 @@
 						<div class="divider"></div>
 
 						<div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">
-							<label for="max_repo_creation">{{.locale.Tr "admin.users.max_repo_creation"}}</label>
+							<label for="max_repo_creation">{{ctx.Locale.Tr "admin.users.max_repo_creation"}}</label>
 							<input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.Org.MaxRepoCreation}}">
-							<p class="help">{{.locale.Tr "admin.users.max_repo_creation_desc"}}</p>
+							<p class="help">{{ctx.Locale.Tr "admin.users.max_repo_creation_desc"}}</p>
 						</div>
 						{{end}}
 
 						<div class="field">
-							<button class="ui primary button">{{$.locale.Tr "org.settings.update_settings"}}</button>
+							<button class="ui primary button">{{ctx.Locale.Tr "org.settings.update_settings"}}</button>
 						</div>
 					</form>
 
@@ -88,13 +88,13 @@
 					<form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
 						{{.CsrfTokenHtml}}
 						<div class="inline field">
-							<label for="avatar">{{.locale.Tr "settings.choose_new_avatar"}}</label>
+							<label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
 							<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
 						</div>
 
 						<div class="field">
-							<button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button>
-							<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button>
+							<button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
+							<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
 						</div>
 					</form>
 				</div>
diff --git a/templates/org/team/invite.tmpl b/templates/org/team/invite.tmpl
index 1b04c0cc2a..e003d14757 100644
--- a/templates/org/team/invite.tmpl
+++ b/templates/org/team/invite.tmpl
@@ -7,14 +7,14 @@
 				{{ctx.AvatarUtils.Avatar .Organization 140}}
 			</div>
 			<div class="content">
-				<div class="header">{{.locale.Tr "org.teams.invite.title" .Team.Name .Organization.Name | Str2html}}</div>
-				<div class="meta">{{.locale.Tr "org.teams.invite.by" .Inviter.Name}}</div>
-				<div class="description">{{.locale.Tr "org.teams.invite.description"}}</div>
+				<div class="header">{{ctx.Locale.Tr "org.teams.invite.title" .Team.Name .Organization.Name | Str2html}}</div>
+				<div class="meta">{{ctx.Locale.Tr "org.teams.invite.by" .Inviter.Name}}</div>
+				<div class="description">{{ctx.Locale.Tr "org.teams.invite.description"}}</div>
 			</div>
 			<div class="extra content">
 				<form class="ui form" action="" method="post">
 					{{.CsrfTokenHtml}}
-					<button class="fluid ui primary button">{{.locale.Tr "org.teams.join"}}</button>
+					<button class="fluid ui primary button">{{ctx.Locale.Tr "org.teams.join"}}</button>
 				</form>
 			</div>
 		</div>
diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl
index 7c2fab4b80..da63d82967 100644
--- a/templates/org/team/members.tmpl
+++ b/templates/org/team/members.tmpl
@@ -12,12 +12,12 @@
 						<form class="ui form ignore-dirty gt-df gt-fw gt-gap-3" action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/add" method="post">
 							{{.CsrfTokenHtml}}
 							<input type="hidden" name="uid" value="{{.SignedUser.ID}}">
-							<div id="search-user-box" class="ui search gt-mr-3"{{if .IsEmailInviteEnabled}} data-allow-email="true" data-allow-email-description="{{.locale.Tr "org.teams.invite_team_member" $.Team.Name}}"{{end}}>
+							<div id="search-user-box" class="ui search gt-mr-3"{{if .IsEmailInviteEnabled}} data-allow-email="true" data-allow-email-description="{{ctx.Locale.Tr "org.teams.invite_team_member" $.Team.Name}}"{{end}}>
 								<div class="ui input">
-									<input class="prompt" name="uname" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" required>
+									<input class="prompt" name="uname" placeholder="{{ctx.Locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" required>
 								</div>
 							</div>
-							<button class="ui primary button">{{.locale.Tr "org.teams.add_team_member"}}</button>
+							<button class="ui primary button">{{ctx.Locale.Tr "org.teams.add_team_member"}}</button>
 						</form>
 					</div>
 				{{end}}
@@ -39,20 +39,20 @@
 											<button class="ui red button delete-button" data-modal-id="remove-team-member"
 												data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/remove" data-datauid="{{.ID}}"
 												data-name="{{.DisplayName}}"
-												data-data-team-name="{{$.Team.Name}}">{{$.locale.Tr "org.members.remove"}}</button>
+												data-data-team-name="{{$.Team.Name}}">{{ctx.Locale.Tr "org.members.remove"}}</button>
 										</form>
 									{{end}}
 								</div>
 							</div>
 						{{else}}
 							<div class="flex-item">
-								<span class="text grey italic">{{$.locale.Tr "org.teams.members.none"}}</span>
+								<span class="text grey italic">{{ctx.Locale.Tr "org.teams.members.none"}}</span>
 							</div>
 						{{end}}
 					</div>
 				</div>
 				{{if and .Invites $.IsOrganizationOwner}}
-				<h4 class="ui top attached header">{{$.locale.Tr "org.teams.invite_team_member.list"}}</h4>
+				<h4 class="ui top attached header">{{ctx.Locale.Tr "org.teams.invite_team_member.list"}}</h4>
 				<div class="ui attached segment">
 					<div class="flex-list">
 						{{range .Invites}}
@@ -64,7 +64,7 @@
 									<form action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/remove_invite" method="post">
 										{{$.CsrfTokenHtml}}
 										<input type="hidden" name="iid" value="{{.ID}}">
-										<button class="ui red button">{{$.locale.Tr "org.members.remove"}}</button>
+										<button class="ui red button">{{ctx.Locale.Tr "org.members.remove"}}</button>
 									</form>
 								</div>
 							</div>
@@ -78,10 +78,10 @@
 </div>
 <div class="ui g-modal-confirm delete modal" id="remove-team-member">
 	<div class="header">
-		{{$.locale.Tr "org.members.remove"}}
+		{{ctx.Locale.Tr "org.members.remove"}}
 	</div>
 	<div class="content">
-		<p>{{$.locale.Tr "org.members.remove.detail" `<span class="name"></span>` `<span class="dataTeamName"></span>` | Safe}}</p>
+		<p>{{ctx.Locale.Tr "org.members.remove.detail" `<span class="name"></span>` `<span class="dataTeamName"></span>` | Safe}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/org/team/navbar.tmpl b/templates/org/team/navbar.tmpl
index 44fe5f1c21..8f2571e1f6 100644
--- a/templates/org/team/navbar.tmpl
+++ b/templates/org/team/navbar.tmpl
@@ -1,4 +1,4 @@
 <div class="ui top attached tabular menu org-team-navbar">
-	<a class="item{{if .PageIsOrgTeamMembers}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}">{{svg "octicon-person"}} <strong>{{.Team.NumMembers}}</strong>&nbsp; {{$.locale.Tr "org.lower_members"}}</a>
-	<a class="item{{if .PageIsOrgTeamRepos}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/repositories">{{svg "octicon-repo"}} <strong>{{.Team.NumRepos}}</strong>&nbsp; {{$.locale.Tr "org.lower_repositories"}}</a>
+	<a class="item{{if .PageIsOrgTeamMembers}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}">{{svg "octicon-person"}} <strong>{{.Team.NumMembers}}</strong>&nbsp; {{ctx.Locale.Tr "org.lower_members"}}</a>
+	<a class="item{{if .PageIsOrgTeamRepos}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/repositories">{{svg "octicon-repo"}} <strong>{{.Team.NumRepos}}</strong>&nbsp; {{ctx.Locale.Tr "org.lower_repositories"}}</a>
 </div>
diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl
index 1d35564007..0178a20fbb 100644
--- a/templates/org/team/new.tmpl
+++ b/templates/org/team/new.tmpl
@@ -7,82 +7,82 @@
 				<form class="ui form" action="{{if .PageIsOrgTeamsNew}}{{.OrgLink}}/teams/new{{else}}{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/edit{{end}}" data-delete-url="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/delete" method="post">
 					{{.CsrfTokenHtml}}
 					<h3 class="ui top attached header">
-						{{if .PageIsOrgTeamsNew}}{{.locale.Tr "org.create_new_team"}}{{else}}{{.locale.Tr "org.teams.settings"}}{{end}}
+						{{if .PageIsOrgTeamsNew}}{{ctx.Locale.Tr "org.create_new_team"}}{{else}}{{ctx.Locale.Tr "org.teams.settings"}}{{end}}
 					</h3>
 					<div class="ui attached segment">
 						{{template "base/alert" .}}
 						<div class="required field {{if .Err_TeamName}}error{{end}}">
-							<label for="team_name">{{.locale.Tr "org.team_name"}}</label>
+							<label for="team_name">{{ctx.Locale.Tr "org.team_name"}}</label>
 							{{if eq .Team.LowerName "owners"}}
 								<input type="hidden" name="team_name" value="{{.Team.Name}}">
 							{{end}}
 							<input id="team_name" name="team_name" value="{{.Team.Name}}" required {{if eq .Team.LowerName "owners"}}disabled{{end}} autofocus>
-							<span class="help">{{.locale.Tr "org.team_name_helper"}}</span>
+							<span class="help">{{ctx.Locale.Tr "org.team_name_helper"}}</span>
 						</div>
 						<div class="field {{if .Err_Description}}error{{end}}">
-							<label for="description">{{.locale.Tr "org.team_desc"}}</label>
+							<label for="description">{{ctx.Locale.Tr "org.team_desc"}}</label>
 							<input id="description" name="description" value="{{.Team.Description}}">
-							<span class="help">{{.locale.Tr "org.team_desc_helper"}}</span>
+							<span class="help">{{ctx.Locale.Tr "org.team_desc_helper"}}</span>
 						</div>
 						{{if not (eq .Team.LowerName "owners")}}
 							<div class="grouped field">
-								<label>{{.locale.Tr "org.team_access_desc"}}</label>
+								<label>{{ctx.Locale.Tr "org.team_access_desc"}}</label>
 								<br>
 								<div class="field">
 									<div class="ui radio checkbox">
 										<input type="radio" name="repo_access" value="specific" {{if not .Team.IncludesAllRepositories}}checked{{end}}>
-										<label>{{.locale.Tr "org.teams.specific_repositories"}}</label>
-										<span class="help">{{.locale.Tr "org.teams.specific_repositories_helper" | Str2html}}</span>
+										<label>{{ctx.Locale.Tr "org.teams.specific_repositories"}}</label>
+										<span class="help">{{ctx.Locale.Tr "org.teams.specific_repositories_helper" | Str2html}}</span>
 									</div>
 								</div>
 								<div class="field">
 									<div class="ui radio checkbox">
 										<input type="radio" name="repo_access" value="all" {{if .Team.IncludesAllRepositories}}checked{{end}}>
-										<label>{{.locale.Tr "org.teams.all_repositories"}}</label>
-										<span class="help">{{.locale.Tr "org.teams.all_repositories_helper" | Str2html}}</span>
+										<label>{{ctx.Locale.Tr "org.teams.all_repositories"}}</label>
+										<span class="help">{{ctx.Locale.Tr "org.teams.all_repositories_helper" | Str2html}}</span>
 									</div>
 								</div>
 
 								<div class="field">
 									<div class="ui checkbox">
-										<label for="can_create_org_repo">{{.locale.Tr "org.teams.can_create_org_repo"}}</label>
+										<label for="can_create_org_repo">{{ctx.Locale.Tr "org.teams.can_create_org_repo"}}</label>
 										<input id="can_create_org_repo" name="can_create_org_repo" type="checkbox" {{if .Team.CanCreateOrgRepo}}checked{{end}}>
-										<span class="help">{{.locale.Tr "org.teams.can_create_org_repo_helper"}}</span>
+										<span class="help">{{ctx.Locale.Tr "org.teams.can_create_org_repo_helper"}}</span>
 									</div>
 								</div>
 							</div>
 							<div class="grouped field">
-								<label>{{.locale.Tr "org.team_permission_desc"}}</label>
+								<label>{{ctx.Locale.Tr "org.team_permission_desc"}}</label>
 								<br>
 								<div class="field">
 									<div class="ui radio checkbox">
 										<input type="radio" name="permission" value="read" {{if or .PageIsOrgTeamsNew (eq .Team.AccessMode 1) (eq .Team.AccessMode 2)}}checked{{end}}>
-										<label>{{.locale.Tr "org.teams.general_access"}}</label>
-										<span class="help">{{.locale.Tr "org.teams.general_access_helper"}}</span>
+										<label>{{ctx.Locale.Tr "org.teams.general_access"}}</label>
+										<span class="help">{{ctx.Locale.Tr "org.teams.general_access_helper"}}</span>
 									</div>
 								</div>
 								<div class="field">
 									<div class="ui radio checkbox">
 										<input type="radio" name="permission" value="admin" {{if eq .Team.AccessMode 3}}checked{{end}}>
-										<label>{{.locale.Tr "org.teams.admin_access"}}</label>
-										<span class="help">{{.locale.Tr "org.teams.admin_access_helper"}}</span>
+										<label>{{ctx.Locale.Tr "org.teams.admin_access"}}</label>
+										<span class="help">{{ctx.Locale.Tr "org.teams.admin_access_helper"}}</span>
 									</div>
 								</div>
 							</div>
 							<div class="divider"></div>
 
 							<div class="team-units required grouped field {{if eq .Team.AccessMode 3}}gt-hidden{{end}}">
-								<label>{{.locale.Tr "org.team_unit_desc"}}</label>
+								<label>{{ctx.Locale.Tr "org.team_unit_desc"}}</label>
 								<table class="ui celled table">
 									<thead>
 										<tr>
-											<th>{{.locale.Tr "units.unit"}}</th>
-											<th class="center aligned">{{.locale.Tr "org.teams.none_access"}}
-											<span class="gt-vm" data-tooltip-content="{{.locale.Tr "org.teams.none_access_helper"}}">{{svg "octicon-question" 16 "gt-ml-2"}}</span></th>
-											<th class="center aligned">{{.locale.Tr "org.teams.read_access"}}
-											<span class="gt-vm" data-tooltip-content="{{.locale.Tr "org.teams.read_access_helper"}}">{{svg "octicon-question" 16 "gt-ml-2"}}</span></th>
-											<th class="center aligned">{{.locale.Tr "org.teams.write_access"}}
-											<span class="gt-vm" data-tooltip-content="{{.locale.Tr "org.teams.write_access_helper"}}">{{svg "octicon-question" 16 "gt-ml-2"}}</span></th>
+											<th>{{ctx.Locale.Tr "units.unit"}}</th>
+											<th class="center aligned">{{ctx.Locale.Tr "org.teams.none_access"}}
+											<span class="gt-vm" data-tooltip-content="{{ctx.Locale.Tr "org.teams.none_access_helper"}}">{{svg "octicon-question" 16 "gt-ml-2"}}</span></th>
+											<th class="center aligned">{{ctx.Locale.Tr "org.teams.read_access"}}
+											<span class="gt-vm" data-tooltip-content="{{ctx.Locale.Tr "org.teams.read_access_helper"}}">{{svg "octicon-question" 16 "gt-ml-2"}}</span></th>
+											<th class="center aligned">{{ctx.Locale.Tr "org.teams.write_access"}}
+											<span class="gt-vm" data-tooltip-content="{{ctx.Locale.Tr "org.teams.write_access_helper"}}">{{svg "octicon-question" 16 "gt-ml-2"}}</span></th>
 										</tr>
 									</thead>
 									<tbody>
@@ -90,26 +90,26 @@
 											{{if ge $unit.MaxPerm 2}}
 												<tr>
 													<td>
-														<div {{if $unit.Type.UnitGlobalDisabled}}class="field" data-tooltip-content="{{$.locale.Tr "repo.unit_disabled"}}"{{- else -}}class="field"{{end}}>
+														<div {{if $unit.Type.UnitGlobalDisabled}}class="field" data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{- else -}}class="field"{{end}}>
 															<div>
-																<label>{{$.locale.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.locale.Tr "org.team_unit_disabled"}}{{end}}</label>
-																<span class="help">{{$.locale.Tr $unit.DescKey}}</span>
+																<label>{{ctx.Locale.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{ctx.Locale.Tr "org.team_unit_disabled"}}{{end}}</label>
+																<span class="help">{{ctx.Locale.Tr $unit.DescKey}}</span>
 															</div>
 														</div>
 													</td>
 													<td class="center aligned">
 														<div class="ui radio checkbox">
-															<input type="radio" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 0)}} checked{{end}} title="{{$.locale.Tr "org.teams.none_access"}}">
+															<input type="radio" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 0)}} checked{{end}} title="{{ctx.Locale.Tr "org.teams.none_access"}}">
 														</div>
 													</td>
 													<td class="center aligned">
 														<div class="ui radio checkbox">
-															<input type="radio" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{$.locale.Tr "org.teams.read_access"}}">
+															<input type="radio" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{ctx.Locale.Tr "org.teams.read_access"}}">
 														</div>
 													</td>
 													<td class="center aligned">
 														<div class="ui radio checkbox">
-															<input type="radio" name="unit_{{$unit.Type.Value}}" value="2"{{if (ge ($.Team.UnitAccessMode $.Context $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{$.locale.Tr "org.teams.write_access"}}">
+															<input type="radio" name="unit_{{$unit.Type.Value}}" value="2"{{if (ge ($.Team.UnitAccessMode $.Context $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{ctx.Locale.Tr "org.teams.write_access"}}">
 														</div>
 													</td>
 												</tr>
@@ -119,11 +119,11 @@
 								</table>
 								{{range $t, $unit := $.Units}}
 									{{if lt $unit.MaxPerm 2}}
-										<div {{if $unit.Type.UnitGlobalDisabled}}class="field" data-tooltip-content="{{$.locale.Tr "repo.unit_disabled"}}"{{else}}class="field"{{end}}>
+										<div {{if $unit.Type.UnitGlobalDisabled}}class="field" data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{else}}class="field"{{end}}>
 											<div class="ui checkbox">
 												<input type="checkbox" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
-												<label>{{$.locale.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.locale.Tr "org.team_unit_disabled"}}{{end}}</label>
-												<span class="help">{{$.locale.Tr $unit.DescKey}}</span>
+												<label>{{ctx.Locale.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{ctx.Locale.Tr "org.team_unit_disabled"}}{{end}}</label>
+												<span class="help">{{ctx.Locale.Tr $unit.DescKey}}</span>
 											</div>
 										</div>
 									{{end}}
@@ -133,11 +133,11 @@
 
 						<div class="field">
 							{{if .PageIsOrgTeamsNew}}
-								<button class="ui primary button">{{.locale.Tr "org.create_team"}}</button>
+								<button class="ui primary button">{{ctx.Locale.Tr "org.create_team"}}</button>
 							{{else}}
-								<button class="ui primary button">{{.locale.Tr "org.teams.update_settings"}}</button>
+								<button class="ui primary button">{{ctx.Locale.Tr "org.teams.update_settings"}}</button>
 								{{if not (eq .Team.LowerName "owners")}}
-									<button class="ui red button delete-button" data-url="{{.OrgLink}}/teams/{{.Team.Name | PathEscape}}/delete">{{.locale.Tr "org.teams.delete_team"}}</button>
+									<button class="ui red button delete-button" data-url="{{.OrgLink}}/teams/{{.Team.Name | PathEscape}}/delete">{{ctx.Locale.Tr "org.teams.delete_team"}}</button>
 								{{end}}
 							{{end}}
 						</div>
@@ -151,10 +151,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "org.teams.delete_team_title"}}
+		{{ctx.Locale.Tr "org.teams.delete_team_title"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "org.teams.delete_team_desc"}}</p>
+		<p>{{ctx.Locale.Tr "org.teams.delete_team_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl
index 032a0f496a..5a32eea64f 100644
--- a/templates/org/team/repositories.tmpl
+++ b/templates/org/team/repositories.tmpl
@@ -14,14 +14,14 @@
 							{{.CsrfTokenHtml}}
 							<div id="search-repo-box" data-uid="{{.Org.ID}}" class="ui search">
 								<div class="ui input">
-									<input class="prompt" name="repo_name" placeholder="{{.locale.Tr "org.teams.search_repo_placeholder"}}" autocomplete="off" required>
+									<input class="prompt" name="repo_name" placeholder="{{ctx.Locale.Tr "org.teams.search_repo_placeholder"}}" autocomplete="off" required>
 								</div>
 							</div>
-							<button class="ui primary button gt-ml-3">{{.locale.Tr "add"}}</button>
+							<button class="ui primary button gt-ml-3">{{ctx.Locale.Tr "add"}}</button>
 						</form>
 						<div class="gt-dib">
-							<button class="ui primary button link-action" data-modal-confirm="{{.locale.Tr "org.teams.add_all_repos_desc"}}" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/addall">{{.locale.Tr "add_all"}}</button>
-							<button class="ui red button link-action" data-modal-confirm="{{.locale.Tr "org.teams.remove_all_repos_desc"}}" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/removeall">{{.locale.Tr "remove_all"}}</button>
+							<button class="ui primary button link-action" data-modal-confirm="{{ctx.Locale.Tr "org.teams.add_all_repos_desc"}}" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/addall">{{ctx.Locale.Tr "add_all"}}</button>
+							<button class="ui red button link-action" data-modal-confirm="{{ctx.Locale.Tr "org.teams.remove_all_repos_desc"}}" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/removeall">{{ctx.Locale.Tr "remove_all"}}</button>
 						</div>
 					</div>
 				{{end}}
@@ -41,14 +41,14 @@
 									{{if $canAddRemove}}
 										<form method="post" action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/remove">
 											{{$.CsrfTokenHtml}}
-											<button type="submit" class="ui red small button" name="repoid" value="{{.ID}}">{{$.locale.Tr "remove"}}</button>
+											<button type="submit" class="ui red small button" name="repoid" value="{{.ID}}">{{ctx.Locale.Tr "remove"}}</button>
 										</form>
 									{{end}}
 								</div>
 							</div>
 						{{else}}
 							<div class="flex-item">
-								<span class="text grey italic">{{$.locale.Tr "org.teams.repos.none"}}</span>
+								<span class="text grey italic">{{ctx.Locale.Tr "org.teams.repos.none"}}</span>
 							</div>
 						{{end}}
 					</div>
diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl
index 260a8ba803..5e89fac012 100644
--- a/templates/org/team/sidebar.tmpl
+++ b/templates/org/team/sidebar.tmpl
@@ -6,13 +6,13 @@
 				<form>
 					<button class="ui red tiny button delete-button" data-modal-id="leave-team-sidebar"
 						data-url="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/action/leave" data-datauid="{{$.SignedUser.ID}}"
-						data-name="{{.Team.Name}}">{{$.locale.Tr "org.teams.leave"}}</button>
+						data-name="{{.Team.Name}}">{{ctx.Locale.Tr "org.teams.leave"}}</button>
 				</form>
 			{{else if .IsOrganizationOwner}}
 				<form method="post" action="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/action/join">
 					{{$.CsrfTokenHtml}}
 					<input type="hidden" name="page" value="team">
-					<button type="submit" class="ui primary tiny button" name="uid" value="{{$.SignedUser.ID}}">{{$.locale.Tr "org.teams.join"}}</button>
+					<button type="submit" class="ui primary tiny button" name="uid" value="{{$.SignedUser.ID}}">{{ctx.Locale.Tr "org.teams.join"}}</button>
 				</form>
 			{{end}}
 		</div>
@@ -22,51 +22,51 @@
 			{{if .Team.Description}}
 				{{.Team.Description}}
 			{{else}}
-				<span class="text grey italic">{{.locale.Tr "org.teams.no_desc"}}</span>
+				<span class="text grey italic">{{ctx.Locale.Tr "org.teams.no_desc"}}</span>
 			{{end}}
 		</div>
 		{{if eq .Team.LowerName "owners"}}
 			<div class="item">
-				{{.locale.Tr "org.teams.owners_permission_desc" | Str2html}}
+				{{ctx.Locale.Tr "org.teams.owners_permission_desc" | Str2html}}
 			</div>
 		{{else}}
 			<div class="item">
-				<h3>{{.locale.Tr "org.team_access_desc"}}</h3>
+				<h3>{{ctx.Locale.Tr "org.team_access_desc"}}</h3>
 				<ul>
 					{{if .Team.IncludesAllRepositories}}
-						<li>{{.locale.Tr "org.teams.all_repositories" | Str2html}}</li>
+						<li>{{ctx.Locale.Tr "org.teams.all_repositories" | Str2html}}</li>
 					{{else}}
-						<li>{{.locale.Tr "org.teams.specific_repositories" | Str2html}}</li>
+						<li>{{ctx.Locale.Tr "org.teams.specific_repositories" | Str2html}}</li>
 					{{end}}
 					{{if .Team.CanCreateOrgRepo}}
-						<li>{{.locale.Tr "org.teams.can_create_org_repo"}}</li>
+						<li>{{ctx.Locale.Tr "org.teams.can_create_org_repo"}}</li>
 					{{end}}
 				</ul>
 				{{if (eq .Team.AccessMode 2)}}
-					<h3>{{.locale.Tr "org.settings.permission"}}</h3>
-					{{.locale.Tr "org.teams.write_permission_desc" | Str2html}}
+					<h3>{{ctx.Locale.Tr "org.settings.permission"}}</h3>
+					{{ctx.Locale.Tr "org.teams.write_permission_desc" | Str2html}}
 				{{else if (eq .Team.AccessMode 3)}}
-					<h3>{{.locale.Tr "org.settings.permission"}}</h3>
-					{{.locale.Tr "org.teams.admin_permission_desc" | Str2html}}
+					<h3>{{ctx.Locale.Tr "org.settings.permission"}}</h3>
+					{{ctx.Locale.Tr "org.teams.admin_permission_desc" | Str2html}}
 				{{else}}
 					<table class="ui table">
 						<thead>
 							<tr>
-								<th>{{.locale.Tr "units.unit"}}</th>
-								<th>{{.locale.Tr "org.team_permission_desc"}}</th>
+								<th>{{ctx.Locale.Tr "units.unit"}}</th>
+								<th>{{ctx.Locale.Tr "org.team_permission_desc"}}</th>
 							</tr>
 						</thead>
 						<tbody>
 							{{range $t, $unit := $.Units}}
 								{{if (not $unit.Type.UnitGlobalDisabled)}}
 									<tr>
-										<td><strong>{{$.locale.Tr $unit.NameKey}}</strong></td>
+										<td><strong>{{ctx.Locale.Tr $unit.NameKey}}</strong></td>
 										<td>{{if eq ($.Team.UnitAccessMode $.Context $unit.Type) 0 -}}
-										{{$.locale.Tr "org.teams.none_access"}}
+										{{ctx.Locale.Tr "org.teams.none_access"}}
 										{{- else if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1) -}}
-										{{$.locale.Tr "org.teams.read_access"}}
+										{{ctx.Locale.Tr "org.teams.read_access"}}
 										{{- else if eq ($.Team.UnitAccessMode $.Context $unit.Type) 2 -}}
-										{{$.locale.Tr "org.teams.write_access"}}
+										{{ctx.Locale.Tr "org.teams.write_access"}}
 										{{- end}}</td>
 									</tr>
 								{{end}}
@@ -79,16 +79,16 @@
 	</div>
 	{{if .IsOrganizationOwner}}
 		<div class="ui bottom attached segment">
-			<a class="ui teal small button" href="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/edit">{{svg "octicon-gear"}} {{$.locale.Tr "org.teams.settings"}}</a>
+			<a class="ui teal small button" href="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/edit">{{svg "octicon-gear"}} {{ctx.Locale.Tr "org.teams.settings"}}</a>
 		</div>
 	{{end}}
 </div>
 <div class="ui g-modal-confirm delete modal" id="leave-team-sidebar">
 	<div class="header">
-		{{$.locale.Tr "org.teams.leave"}}
+		{{ctx.Locale.Tr "org.teams.leave"}}
 	</div>
 	<div class="content">
-		<p>{{$.locale.Tr "org.teams.leave.detail" `<span class="name"></span>` | Safe}}</p>
+		<p>{{ctx.Locale.Tr "org.teams.leave.detail" `<span class="name"></span>` | Safe}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl
index 0d7cc06ff9..84a15e7650 100644
--- a/templates/org/team/teams.tmpl
+++ b/templates/org/team/teams.tmpl
@@ -5,7 +5,7 @@
 		{{template "base/alert" .}}
 		{{if .IsOrganizationOwner}}
 			<div class="text right">
-				<a class="ui primary button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus"}} {{.locale.Tr "org.create_new_team"}}</a>
+				<a class="ui primary button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus"}} {{ctx.Locale.Tr "org.create_new_team"}}</a>
 			</div>
 			<div class="divider"></div>
 		{{end}}
@@ -20,12 +20,12 @@
 								<form>
 									<button class="ui red tiny button delete-button" data-modal-id="leave-team"
 										data-url="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/leave" data-datauid="{{$.SignedUser.ID}}"
-										data-name="{{.Name}}">{{$.locale.Tr "org.teams.leave"}}</button>
+										data-name="{{.Name}}">{{ctx.Locale.Tr "org.teams.leave"}}</button>
 								</form>
 							{{else if $.IsOrganizationOwner}}
 								<form method="post" action="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}/action/join">
 									{{$.CsrfTokenHtml}}
-									<button type="submit" class="ui primary small button" name="uid" value="{{$.SignedUser.ID}}">{{$.locale.Tr "org.teams.join"}}</button>
+									<button type="submit" class="ui primary small button" name="uid" value="{{$.SignedUser.ID}}">{{ctx.Locale.Tr "org.teams.join"}}</button>
 								</form>
 							{{end}}
 						</div>
@@ -36,7 +36,7 @@
 						{{end}}
 					</div>
 					<div class="ui bottom attached header">
-						<p class="team-meta">{{.NumMembers}} {{$.locale.Tr "org.lower_members"}} · {{.NumRepos}} {{$.locale.Tr "org.lower_repositories"}}</p>
+						<p class="team-meta">{{.NumMembers}} {{ctx.Locale.Tr "org.lower_members"}} · {{.NumRepos}} {{ctx.Locale.Tr "org.lower_repositories"}}</p>
 					</div>
 				</div>
 			{{end}}
@@ -45,10 +45,10 @@
 </div>
 <div class="ui g-modal-confirm delete modal" id="leave-team">
 	<div class="header">
-		{{$.locale.Tr "org.teams.leave"}}
+		{{ctx.Locale.Tr "org.teams.leave"}}
 	</div>
 	<div class="content">
-		<p>{{$.locale.Tr "org.teams.leave.detail" `<span class="name"></span>` | Safe}}</p>
+		<p>{{ctx.Locale.Tr "org.teams.leave.detail" `<span class="name"></span>` | Safe}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/package/content/alpine.tmpl b/templates/package/content/alpine.tmpl
index fa34f82140..a1003cd6ff 100644
--- a/templates/package/content/alpine.tmpl
+++ b/templates/package/content/alpine.tmpl
@@ -1,42 +1,42 @@
 {{if eq .PackageDescriptor.Package.Type "alpine"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.alpine.registry" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.alpine.registry" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code><gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/alpine"></gitea-origin-url>/$branch/$repository</code></pre></div>
-				<p>{{.locale.Tr "packages.alpine.registry.info" | Safe}}</p>
+				<p>{{ctx.Locale.Tr "packages.alpine.registry.info" | Safe}}</p>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.alpine.registry.key" | Safe}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.alpine.registry.key" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>curl -JO <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/alpine/key"></gitea-origin-url></code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.alpine.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.alpine.install"}}</label>
 				<div class="markup">
 					<pre class="code-block"><code>sudo apk add {{$.PackageDescriptor.Package.Name}}={{$.PackageDescriptor.Version.Version}}</code></pre>
 				</div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Alpine" "https://docs.gitea.com/usage/packages/alpine/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Alpine" "https://docs.gitea.com/usage/packages/alpine/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
-	<h4 class="ui top attached header">{{.locale.Tr "packages.alpine.repository"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.alpine.repository"}}</h4>
 	<div class="ui attached segment">
 		<table class="ui single line very basic table">
 			<tbody>
 				<tr>
-					<td class="collapsing"><h5>{{.locale.Tr "packages.alpine.repository.branches"}}</h5></td>
+					<td class="collapsing"><h5>{{ctx.Locale.Tr "packages.alpine.repository.branches"}}</h5></td>
 					<td>{{StringUtils.Join .Branches ", "}}</td>
 				</tr>
 				<tr>
-					<td class="collapsing"><h5>{{.locale.Tr "packages.alpine.repository.repositories"}}</h5></td>
+					<td class="collapsing"><h5>{{ctx.Locale.Tr "packages.alpine.repository.repositories"}}</h5></td>
 					<td>{{StringUtils.Join .Repositories ", "}}</td>
 				</tr>
 				<tr>
-					<td class="collapsing"><h5>{{.locale.Tr "packages.alpine.repository.architectures"}}</h5></td>
+					<td class="collapsing"><h5>{{ctx.Locale.Tr "packages.alpine.repository.architectures"}}</h5></td>
 					<td>{{StringUtils.Join .Architectures ", "}}</td>
 				</tr>
 			</tbody>
@@ -44,7 +44,7 @@
 	</div>
 
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{.PackageDescriptor.Metadata.Description}}
 		</div>
diff --git a/templates/package/content/cargo.tmpl b/templates/package/content/cargo.tmpl
index 67e003c9d1..da9fc4ab39 100644
--- a/templates/package/content/cargo.tmpl
+++ b/templates/package/content/cargo.tmpl
@@ -1,9 +1,9 @@
 {{if eq .PackageDescriptor.Package.Type "cargo"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.cargo.registry" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.cargo.registry" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>[registry]
 default = "gitea"
 
@@ -15,29 +15,29 @@ index = "<gitea-origin-url data-url="sparse+{{AppSubUrl}}/api/packages/{{.Packag
 git-fetch-with-cli = true</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.cargo.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.cargo.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>cargo add {{.PackageDescriptor.Package.Name}}@{{.PackageDescriptor.Version.Version}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Cargo" "https://docs.gitea.com/usage/packages/cargo/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Cargo" "https://docs.gitea.com/usage/packages/cargo/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		{{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}}
 		{{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}</div>{{end}}
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Dependencies}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<table class="ui single line very basic table">
 				<thead>
 					<tr>
-						<th class="ten wide">{{.locale.Tr "packages.dependency.id"}}</th>
-						<th class="six wide">{{.locale.Tr "packages.dependency.version"}}</th>
+						<th class="ten wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th>
+						<th class="six wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th>
 					</tr>
 				</thead>
 				<tbody>
@@ -53,7 +53,7 @@ git-fetch-with-cli = true</code></pre></div>
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Keywords}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4>
 		<div class="ui attached segment">
 			{{range .PackageDescriptor.Metadata.Keywords}}
 				{{.}}
diff --git a/templates/package/content/chef.tmpl b/templates/package/content/chef.tmpl
index 2596f8d493..0588c6e4b3 100644
--- a/templates/package/content/chef.tmpl
+++ b/templates/package/content/chef.tmpl
@@ -1,23 +1,23 @@
 {{if eq .PackageDescriptor.Package.Type "chef"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.chef.registry" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.chef.registry" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>knife[:supermarket_site] = '<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/chef"></gitea-origin-url>'</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.chef.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.chef.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>knife supermarket install {{.PackageDescriptor.Package.Name}} {{.PackageDescriptor.Version.Version}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Chef" "https://docs.gitea.com/usage/packages/chef/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Chef" "https://docs.gitea.com/usage/packages/chef/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.LongDescription}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{if .PackageDescriptor.Metadata.Description}}<p>{{.PackageDescriptor.Metadata.Description}}</p>{{end}}
 			{{if .PackageDescriptor.Metadata.LongDescription}}{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.LongDescription}}{{end}}
@@ -25,13 +25,13 @@
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Dependencies}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<table class="ui single line very basic table">
 				<thead>
 					<tr>
-						<th class="eleven wide">{{.locale.Tr "packages.dependency.id"}}</th>
-						<th class="five wide">{{.locale.Tr "packages.dependency.version"}}</th>
+						<th class="eleven wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th>
+						<th class="five wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th>
 					</tr>
 				</thead>
 				<tbody>
diff --git a/templates/package/content/composer.tmpl b/templates/package/content/composer.tmpl
index 80997c583f..862f1c6925 100644
--- a/templates/package/content/composer.tmpl
+++ b/templates/package/content/composer.tmpl
@@ -1,9 +1,9 @@
 {{if eq .PackageDescriptor.Package.Type "composer"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.composer.registry" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.composer.registry" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>{
 	"repositories": [{
 			"type": "composer",
@@ -13,34 +13,34 @@
 }</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.composer.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.composer.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>composer require {{.PackageDescriptor.Package.Name}}:{{.PackageDescriptor.Version.Version}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Composer" "https://docs.gitea.com/usage/packages/composer/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Composer" "https://docs.gitea.com/usage/packages/composer/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{.PackageDescriptor.Metadata.Description}}
 		</div>
 	{{end}}
 
 	{{if or .PackageDescriptor.Metadata.Require .PackageDescriptor.Metadata.RequireDev}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<div class="ui list">
-				{{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Require "title" (.locale.Tr "packages.composer.dependencies")}}
-				{{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.RequireDev "title" (.locale.Tr "packages.composer.dependencies.development")}}
+				{{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Require "title" (ctx.Locale.Tr "packages.composer.dependencies")}}
+				{{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.RequireDev "title" (ctx.Locale.Tr "packages.composer.dependencies.development")}}
 			</div>
 		</div>
 	{{end}}
 
 	{{if or .PackageDescriptor.Metadata.Keywords}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4>
 		<div class="ui attached segment">
 			{{range .PackageDescriptor.Metadata.Keywords}}
 				{{.}}
diff --git a/templates/package/content/composer_dependencies.tmpl b/templates/package/content/composer_dependencies.tmpl
index b55c1b5b88..dba45750b7 100644
--- a/templates/package/content/composer_dependencies.tmpl
+++ b/templates/package/content/composer_dependencies.tmpl
@@ -3,8 +3,8 @@
 <table class="ui single line very basic table">
 	<thead>
 		<tr>
-			<th class="eleven wide">{{.root.locale.Tr "packages.dependency.id"}}</th>
-			<th class="five wide">{{.root.locale.Tr "packages.dependency.version"}}</th>
+			<th class="eleven wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th>
+			<th class="five wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th>
 		</tr>
 	</thead>
 	<tbody>
diff --git a/templates/package/content/conan.tmpl b/templates/package/content/conan.tmpl
index c8904216af..55b84d12b1 100644
--- a/templates/package/content/conan.tmpl
+++ b/templates/package/content/conan.tmpl
@@ -1,30 +1,30 @@
 {{if eq .PackageDescriptor.Package.Type "conan"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.conan.registry"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conan.registry"}}</label>
 				<div class="markup"><pre class="code-block"><code>conan remote add gitea <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conan"></gitea-origin-url></code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.conan.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conan.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>conan install --remote=gitea {{.PackageDescriptor.Package.Name}}/{{.PackageDescriptor.Version.Version}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Conan" "https://docs.gitea.com/usage/packages/conan/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Conan" "https://docs.gitea.com/usage/packages/conan/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{end}}
 		</div>
 	{{end}}
 
 	{{if or .PackageDescriptor.Metadata.Keywords}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4>
 		<div class="ui attached segment">
 			{{range .PackageDescriptor.Metadata.Keywords}}
 				{{.}}
diff --git a/templates/package/content/conda.tmpl b/templates/package/content/conda.tmpl
index 23d640944b..0fd0c3db3f 100644
--- a/templates/package/content/conda.tmpl
+++ b/templates/package/content/conda.tmpl
@@ -1,9 +1,9 @@
 {{if eq .PackageDescriptor.Package.Type "conda"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.conda.registry" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.conda.registry" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>channel_alias: <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></gitea-origin-url>
 channels:
 &#32;&#32;- <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></gitea-origin-url>
@@ -11,18 +11,18 @@ default_channels:
 &#32;&#32;- <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></gitea-origin-url></code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.conda.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conda.install"}}</label>
 				{{$channel := .PackageDescriptor.PackageProperties.GetByName "conda.channel"}}
 				<div class="markup"><pre class="code-block"><code>conda install{{if $channel}} -c {{$channel}}{{end}} {{.PackageDescriptor.PackageProperties.GetByName "conda.name"}}={{.PackageDescriptor.Version.Version}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Conda" "https://docs.gitea.com/usage/packages/conda/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Conda" "https://docs.gitea.com/usage/packages/conda/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Summary}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{else}}{{.PackageDescriptor.Metadata.Summary}}{{end}}
 		</div>
diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl
index cba5d9e7c1..f5ee902c94 100644
--- a/templates/package/content/container.tmpl
+++ b/templates/package/content/container.tmpl
@@ -1,9 +1,9 @@
 {{if eq .PackageDescriptor.Package.Type "container"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.container.pull"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.container.pull"}}</label>
 				{{if eq .PackageDescriptor.Metadata.Type "helm"}}
 				<div class="markup"><pre class="code-block"><code>helm pull oci://{{.RegistryHost}}/{{.PackageDescriptor.Owner.LowerName}}/{{.PackageDescriptor.Package.LowerName}} --version {{.PackageDescriptor.Version.LowerVersion}}</code></pre></div>
 				{{else}}
@@ -15,23 +15,23 @@
 				{{end}}
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.container.digest"}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.container.digest"}}</label>
 				<div class="markup"><pre class="code-block"><code>{{range .PackageDescriptor.Files}}{{if eq .File.LowerName "manifest.json"}}{{.Properties.GetByName "container.digest"}}{{end}}{{end}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Container" "https://docs.gitea.com/usage/packages/container/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Container" "https://docs.gitea.com/usage/packages/container/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 	{{if .PackageDescriptor.Metadata.Manifests}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.container.multi_arch"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.multi_arch"}}</h4>
 		<div class="ui attached segment">
 			<table class="ui very basic compact table">
 				<thead>
 					<tr>
-						<th>{{.locale.Tr "packages.container.digest"}}</th>
-						<th>{{.locale.Tr "packages.container.multi_arch"}}</th>
-						<th>{{.locale.Tr "admin.packages.size"}}</th>
+						<th>{{ctx.Locale.Tr "packages.container.digest"}}</th>
+						<th>{{ctx.Locale.Tr "packages.container.multi_arch"}}</th>
+						<th>{{ctx.Locale.Tr "admin.packages.size"}}</th>
 					</tr>
 				</thead>
 				<tbody>
@@ -47,13 +47,13 @@
 		</div>
 	{{end}}
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{.PackageDescriptor.Metadata.Description}}
 		</div>
 	{{end}}
 	{{if .PackageDescriptor.Metadata.ImageLayers}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.container.layers"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.layers"}}</h4>
 		<div class="ui attached segment gt-word-break">
 			<table class="ui very basic compact table">
 				<tbody>
@@ -67,13 +67,13 @@
 		</div>
 	{{end}}
 	{{if .PackageDescriptor.Metadata.Labels}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.container.labels"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.labels"}}</h4>
 		<div class="ui attached segment">
 			<table class="ui very basic compact table">
 				<thead>
 					<tr>
-						<th>{{.locale.Tr "packages.container.labels.key"}}</th>
-						<th>{{.locale.Tr "packages.container.labels.value"}}</th>
+						<th>{{ctx.Locale.Tr "packages.container.labels.key"}}</th>
+						<th>{{ctx.Locale.Tr "packages.container.labels.value"}}</th>
 					</tr>
 				</thead>
 				<tbody>
diff --git a/templates/package/content/cran.tmpl b/templates/package/content/cran.tmpl
index 1f3200130c..f9a3f70107 100644
--- a/templates/package/content/cran.tmpl
+++ b/templates/package/content/cran.tmpl
@@ -1,30 +1,30 @@
 {{if eq .PackageDescriptor.Package.Type "cran"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.cran.registry" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.cran.registry" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>options("repos" = c(getOption("repos"), c(gitea="<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cran"></gitea-origin-url>")))</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.cran.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.cran.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>install.packages("{{.PackageDescriptor.Package.Name}}")</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "CRAN" "https://docs.gitea.com/usage/packages/cran/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "CRAN" "https://docs.gitea.com/usage/packages/cran/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Title}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Title}}{{else}}{{end}}
 		</div>
 	{{end}}
 
 	{{if or .PackageDescriptor.Metadata.Imports .PackageDescriptor.Metadata.Depends .PackageDescriptor.Metadata.LinkingTo .PackageDescriptor.Metadata.Suggests}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<table class="ui single line very basic table">
 				<tbody>
diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl
index b222767035..242ee1fba4 100644
--- a/templates/package/content/debian.tmpl
+++ b/templates/package/content/debian.tmpl
@@ -1,40 +1,40 @@
 {{if eq .PackageDescriptor.Package.Type "debian"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.debian.registry"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.debian.registry"}}</label>
 				<div class="markup"><pre class="code-block"><code>sudo curl <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian/repository.key"></gitea-origin-url> -o /etc/apt/trusted.gpg.d/gitea-{{$.PackageDescriptor.Owner.Name}}.asc
 echo "deb <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian"></gitea-origin-url> $distribution $component" | sudo tee -a /etc/apt/sources.list.d/gitea.list
 sudo apt update</code></pre></div>
-				<p>{{.locale.Tr "packages.debian.registry.info" | Safe}}</p>
+				<p>{{ctx.Locale.Tr "packages.debian.registry.info" | Safe}}</p>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.debian.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.debian.install"}}</label>
 				<div class="markup">
 					<pre class="code-block"><code>sudo apt install {{$.PackageDescriptor.Package.Name}}={{$.PackageDescriptor.Version.Version}}</code></pre>
 				</div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Debian" "https://docs.gitea.com/usage/packages/debian/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Debian" "https://docs.gitea.com/usage/packages/debian/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
-	<h4 class="ui top attached header">{{.locale.Tr "packages.debian.repository"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.debian.repository"}}</h4>
 	<div class="ui attached segment">
 		<table class="ui single line very basic table">
 			<tbody>
 				<tr>
-					<td class="collapsing"><h5>{{.locale.Tr "packages.debian.repository.distributions"}}</h5></td>
+					<td class="collapsing"><h5>{{ctx.Locale.Tr "packages.debian.repository.distributions"}}</h5></td>
 					<td>{{StringUtils.Join .Distributions ", "}}</td>
 				</tr>
 				<tr>
-					<td class="collapsing"><h5>{{.locale.Tr "packages.debian.repository.components"}}</h5></td>
+					<td class="collapsing"><h5>{{ctx.Locale.Tr "packages.debian.repository.components"}}</h5></td>
 					<td>{{StringUtils.Join .Components ", "}}</td>
 				</tr>
 				<tr>
-					<td class="collapsing"><h5>{{.locale.Tr "packages.debian.repository.architectures"}}</h5></td>
+					<td class="collapsing"><h5>{{ctx.Locale.Tr "packages.debian.repository.architectures"}}</h5></td>
 					<td>{{StringUtils.Join .Architectures ", "}}</td>
 				</tr>
 			</tbody>
@@ -42,14 +42,14 @@ sudo apt update</code></pre></div>
 	</div>
 
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{.PackageDescriptor.Metadata.Description}}
 		</div>
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Dependencies}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<table class="ui single line very basic table">
 				<tbody>
diff --git a/templates/package/content/generic.tmpl b/templates/package/content/generic.tmpl
index 01012a5f0a..ba4df0a57d 100644
--- a/templates/package/content/generic.tmpl
+++ b/templates/package/content/generic.tmpl
@@ -1,9 +1,9 @@
 {{if eq .PackageDescriptor.Package.Type "generic"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.generic.download"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.generic.download"}}</label>
 				<div class="markup"><pre class="code-block"><code>
 {{- range .PackageDescriptor.Files -}}
 curl <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/generic/{{$.PackageDescriptor.Package.Name}}/{{$.PackageDescriptor.Version.Version}}/{{.File.Name}}"></gitea-origin-url>
@@ -11,7 +11,7 @@ curl <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescripto
 				</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Generic" "https://docs.gitea.com/usage/packages/generic" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Generic" "https://docs.gitea.com/usage/packages/generic" | Safe}}</label>
 			</div>
 		</div>
 	</div>
diff --git a/templates/package/content/go.tmpl b/templates/package/content/go.tmpl
index db25cc2b92..f98fc69fb6 100644
--- a/templates/package/content/go.tmpl
+++ b/templates/package/content/go.tmpl
@@ -1,13 +1,13 @@
 {{if eq .PackageDescriptor.Package.Type "go"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.go.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.go.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>GOPROXY=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/go"></gitea-origin-url> go install {{$.PackageDescriptor.Package.Name}}@{{$.PackageDescriptor.Version.Version}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Go" "https://docs.gitea.com/usage/packages/go" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Go" "https://docs.gitea.com/usage/packages/go" | Safe}}</label>
 			</div>
 		</div>
 	</div>
diff --git a/templates/package/content/helm.tmpl b/templates/package/content/helm.tmpl
index 44d01b6013..68e53133f1 100644
--- a/templates/package/content/helm.tmpl
+++ b/templates/package/content/helm.tmpl
@@ -1,37 +1,37 @@
 {{if eq .PackageDescriptor.Package.Type "helm"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.helm.registry"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.helm.registry"}}</label>
 				<div class="markup"><pre class="code-block"><code>helm repo add {{AppDomain}} <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/helm"></gitea-origin-url>
 helm repo update</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.helm.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.helm.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>helm install {{.PackageDescriptor.Package.Name}} {{AppDomain}}/{{.PackageDescriptor.Package.Name}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Helm" "https://docs.gitea.com/usage/packages/helm/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Helm" "https://docs.gitea.com/usage/packages/helm/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{.PackageDescriptor.Metadata.Description}}
 		</div>
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Dependencies}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<table class="ui single line very basic table">
 				<thead>
 					<tr>
-						<th class="ten wide">{{.locale.Tr "packages.dependency.id"}}</th>
-						<th class="six wide">{{.locale.Tr "packages.dependency.version"}}</th>
+						<th class="ten wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th>
+						<th class="six wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th>
 					</tr>
 				</thead>
 				<tbody>
@@ -47,7 +47,7 @@ helm repo update</code></pre></div>
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Keywords}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4>
 		<div class="ui attached segment">
 			{{range .PackageDescriptor.Metadata.Keywords}}
 				{{.}}
diff --git a/templates/package/content/maven.tmpl b/templates/package/content/maven.tmpl
index f5da72d711..b2cd567e16 100644
--- a/templates/package/content/maven.tmpl
+++ b/templates/package/content/maven.tmpl
@@ -1,9 +1,9 @@
 {{if eq .PackageDescriptor.Package.Type "maven"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.maven.registry" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.maven.registry" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>&lt;repositories&gt;
 	&lt;repository&gt;
 		&lt;id&gt;gitea&lt;/id&gt;
@@ -24,7 +24,7 @@
 &lt;/distributionManagement&gt;</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.maven.install" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.maven.install" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>&lt;dependency&gt;
 	&lt;groupId&gt;{{.PackageDescriptor.Metadata.GroupID}}&lt;/groupId&gt;
 	&lt;artifactId&gt;{{.PackageDescriptor.Metadata.ArtifactID}}&lt;/artifactId&gt;
@@ -32,28 +32,28 @@
 &lt;/dependency&gt;</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.maven.install2"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.maven.install2"}}</label>
 				<div class="markup"><pre class="code-block"><code>mvn install</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.maven.download"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.maven.download"}}</label>
 				<div class="markup"><pre class="code-block"><code>mvn dependency:get -DremoteRepositories=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-origin-url> -Dartifact={{.PackageDescriptor.Metadata.GroupID}}:{{.PackageDescriptor.Metadata.ArtifactID}}:{{.PackageDescriptor.Version.Version}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Maven" "https://docs.gitea.com/usage/packages/maven/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Maven" "https://docs.gitea.com/usage/packages/maven/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{.PackageDescriptor.Metadata.Description}}
 		</div>
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Dependencies}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<div class="ui list">
 				{{range .PackageDescriptor.Metadata.Dependencies}}
diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl
index c648d96162..882e999bed 100644
--- a/templates/package/content/npm.tmpl
+++ b/templates/package/content/npm.tmpl
@@ -1,27 +1,27 @@
 {{if eq .PackageDescriptor.Package.Type "npm"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.npm.registry" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.npm.registry" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>{{if .PackageDescriptor.Metadata.Scope}}{{.PackageDescriptor.Metadata.Scope}}:{{end}}registry=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/npm/"></gitea-origin-url></code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.npm.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.npm.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>npm install {{.PackageDescriptor.Package.Name}}@{{.PackageDescriptor.Version.Version}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.npm.install2"}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.npm.install2"}}</label>
 				<div class="markup"><pre class="code-block"><code>&quot;{{.PackageDescriptor.Package.Name}}&quot;: &quot;{{.PackageDescriptor.Version.Version}}&quot;</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "npm" "https://docs.gitea.com/usage/packages/npm/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "npm" "https://docs.gitea.com/usage/packages/npm/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{if .PackageDescriptor.Metadata.Readme}}
 			<div class="markup markdown">
@@ -34,19 +34,19 @@
 	{{end}}
 
 	{{if or .PackageDescriptor.Metadata.Dependencies .PackageDescriptor.Metadata.DevelopmentDependencies .PackageDescriptor.Metadata.PeerDependencies .PackageDescriptor.Metadata.OptionalDependencies}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<div class="ui list">
-				{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Dependencies "title" (.locale.Tr "packages.npm.dependencies")}}
-				{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.DevelopmentDependencies "title" (.locale.Tr "packages.npm.dependencies.development")}}
-				{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.PeerDependencies "title" (.locale.Tr "packages.npm.dependencies.peer")}}
-				{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.OptionalDependencies "title" (.locale.Tr "packages.npm.dependencies.optional")}}
+				{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Dependencies "title" (ctx.Locale.Tr "packages.npm.dependencies")}}
+				{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.DevelopmentDependencies "title" (ctx.Locale.Tr "packages.npm.dependencies.development")}}
+				{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.PeerDependencies "title" (ctx.Locale.Tr "packages.npm.dependencies.peer")}}
+				{{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.OptionalDependencies "title" (ctx.Locale.Tr "packages.npm.dependencies.optional")}}
 			</div>
 		</div>
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Keywords}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4>
 		<div class="ui attached segment">
 			{{range .PackageDescriptor.Metadata.Keywords}}
 				{{.}}
diff --git a/templates/package/content/npm_dependencies.tmpl b/templates/package/content/npm_dependencies.tmpl
index b55c1b5b88..dba45750b7 100644
--- a/templates/package/content/npm_dependencies.tmpl
+++ b/templates/package/content/npm_dependencies.tmpl
@@ -3,8 +3,8 @@
 <table class="ui single line very basic table">
 	<thead>
 		<tr>
-			<th class="eleven wide">{{.root.locale.Tr "packages.dependency.id"}}</th>
-			<th class="five wide">{{.root.locale.Tr "packages.dependency.version"}}</th>
+			<th class="eleven wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th>
+			<th class="five wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th>
 		</tr>
 	</thead>
 	<tbody>
diff --git a/templates/package/content/nuget.tmpl b/templates/package/content/nuget.tmpl
index 2b3a74316c..04dac89843 100644
--- a/templates/package/content/nuget.tmpl
+++ b/templates/package/content/nuget.tmpl
@@ -1,23 +1,23 @@
 {{if eq .PackageDescriptor.Package.Type "nuget"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.nuget.registry"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.nuget.registry"}}</label>
 				<div class="markup"><pre class="code-block"><code>dotnet nuget add source --name {{.PackageDescriptor.Owner.Name}} --username your_username --password your_token <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/nuget/index.json"></gitea-origin-url></code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.nuget.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.nuget.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>dotnet add package --source {{.PackageDescriptor.Owner.Name}} --version {{.PackageDescriptor.Version.Version}} {{.PackageDescriptor.Package.Name}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "NuGet" "https://docs.gitea.com/usage/packages/nuget/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "NuGet" "https://docs.gitea.com/usage/packages/nuget/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.ReleaseNotes}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{end}}
 			{{if .PackageDescriptor.Metadata.ReleaseNotes}}{{Str2html .PackageDescriptor.Metadata.ReleaseNotes}}{{end}}
@@ -25,14 +25,14 @@
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Dependencies}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<table class="ui single line very basic table">
 				<thead>
 					<tr>
-						<th class="ten wide">{{.locale.Tr "packages.dependency.id"}}</th>
-						<th class="three wide">{{.locale.Tr "packages.dependency.version"}}</th>
-						<th class="three wide">{{.locale.Tr "packages.nuget.dependency.framework"}}</th>
+						<th class="ten wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th>
+						<th class="three wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th>
+						<th class="three wide">{{ctx.Locale.Tr "packages.nuget.dependency.framework"}}</th>
 					</tr>
 				</thead>
 				<tbody>
diff --git a/templates/package/content/pub.tmpl b/templates/package/content/pub.tmpl
index 075d52cf49..8657d55dbf 100644
--- a/templates/package/content/pub.tmpl
+++ b/templates/package/content/pub.tmpl
@@ -1,18 +1,18 @@
 {{if eq .PackageDescriptor.Package.Type "pub"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.pub.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.pub.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>dart pub add {{.PackageDescriptor.Package.Name}}:{{.PackageDescriptor.Version.Version}} --hosted-url=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/pub/"></gitea-origin-url></code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Pub" "https://docs.gitea.com/usage/packages/pub/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Pub" "https://docs.gitea.com/usage/packages/pub/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 	{{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		{{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}}
 		{{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}</div>{{end}}
 	{{end}}
diff --git a/templates/package/content/pypi.tmpl b/templates/package/content/pypi.tmpl
index 1534197219..ef9beb4280 100644
--- a/templates/package/content/pypi.tmpl
+++ b/templates/package/content/pypi.tmpl
@@ -1,18 +1,18 @@
 {{if eq .PackageDescriptor.Package.Type "pypi"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.pypi.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.pypi.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>pip install --index-url <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/pypi/simple/"></gitea-origin-url> {{.PackageDescriptor.Package.Name}}</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "PyPI" "https://docs.gitea.com/usage/packages/pypi/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "PyPI" "https://docs.gitea.com/usage/packages/pypi/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 	{{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.LongDescription .PackageDescriptor.Metadata.Summary}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			<p>{{if .PackageDescriptor.Metadata.Summary}}{{.PackageDescriptor.Metadata.Summary}}{{end}}</p>
 			{{if .PackageDescriptor.Metadata.LongDescription}}
@@ -23,9 +23,9 @@
 		</div>
 	{{end}}
 	{{if .PackageDescriptor.Metadata.RequiresPython}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.requirements"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.requirements"}}</h4>
 		<div class="ui attached segment">
-			{{.locale.Tr "packages.pypi.requires"}}: {{.PackageDescriptor.Metadata.RequiresPython}}
+			{{ctx.Locale.Tr "packages.pypi.requires"}}: {{.PackageDescriptor.Metadata.RequiresPython}}
 		</div>
 	{{end}}
 {{end}}
diff --git a/templates/package/content/rpm.tmpl b/templates/package/content/rpm.tmpl
index fc7af639aa..3fd979567c 100644
--- a/templates/package/content/rpm.tmpl
+++ b/templates/package/content/rpm.tmpl
@@ -1,33 +1,33 @@
 {{if eq .PackageDescriptor.Package.Type "rpm"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.rpm.registry"}}</label>
-				<div class="markup"><pre class="code-block"><code># {{.locale.Tr "packages.rpm.distro.redhat"}}
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.rpm.registry"}}</label>
+				<div class="markup"><pre class="code-block"><code># {{ctx.Locale.Tr "packages.rpm.distro.redhat"}}
 dnf config-manager --add-repo <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/rpm.repo"></gitea-origin-url>
 
-# {{.locale.Tr "packages.rpm.distro.suse"}}
+# {{ctx.Locale.Tr "packages.rpm.distro.suse"}}
 zypper addrepo <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/rpm.repo"></gitea-origin-url></code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.rpm.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.rpm.install"}}</label>
 				<div class="markup">
-					<pre class="code-block"><code># {{.locale.Tr "packages.rpm.distro.redhat"}}
+					<pre class="code-block"><code># {{ctx.Locale.Tr "packages.rpm.distro.redhat"}}
 dnf install {{$.PackageDescriptor.Package.Name}}
 
-# {{.locale.Tr "packages.rpm.distro.suse"}}
+# {{ctx.Locale.Tr "packages.rpm.distro.suse"}}
 zypper install {{$.PackageDescriptor.Package.Name}}</code></pre>
 				</div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "RPM" "https://docs.gitea.com/usage/packages/rpm/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "RPM" "https://docs.gitea.com/usage/packages/rpm/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if or .PackageDescriptor.Metadata.Summary .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		{{if .PackageDescriptor.Metadata.Summary}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Summary}}</div>{{end}}
 		{{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}}
 	{{end}}
diff --git a/templates/package/content/rubygems.tmpl b/templates/package/content/rubygems.tmpl
index f94968b094..180ff60f7d 100644
--- a/templates/package/content/rubygems.tmpl
+++ b/templates/package/content/rubygems.tmpl
@@ -1,39 +1,39 @@
 {{if eq .PackageDescriptor.Package.Type "rubygems"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.rubygems.install" | Safe}}:</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.rubygems.install" | Safe}}:</label>
 				<div class="markup"><pre class="code-block"><code>gem install {{.PackageDescriptor.Package.Name}} --version &quot;{{.PackageDescriptor.Version.Version}}&quot; --source &quot;<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/rubygems"></gitea-origin-url>&quot;</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.rubygems.install2"}}:</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.rubygems.install2"}}:</label>
 				<div class="markup"><pre class="code-block"><code>source "<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/rubygems"></gitea-origin-url>" do
 	gem "{{.PackageDescriptor.Package.Name}}", "{{.PackageDescriptor.Version.Version}}"
 end</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "RubyGems" "https://docs.gitea.com/usage/packages/rubygems/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "RubyGems" "https://docs.gitea.com/usage/packages/rubygems/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>
 	{{end}}
 	{{if or .PackageDescriptor.Metadata.RequiredRubyVersion .PackageDescriptor.Metadata.RequiredRubygemsVersion}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.requirements"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.requirements"}}</h4>
 		<div class="ui attached segment">
-			{{if .PackageDescriptor.Metadata.RequiredRubyVersion}}<p>{{.locale.Tr "packages.rubygems.required.ruby"}}: {{range $i, $v := .PackageDescriptor.Metadata.RequiredRubyVersion}}{{if gt $i 0}}, {{end}}{{$v.Restriction}}{{$v.Version}}{{end}}</p>{{end}}
-			{{if .PackageDescriptor.Metadata.RequiredRubygemsVersion}}<p>{{.locale.Tr "packages.rubygems.required.rubygems"}}: {{range $i, $v := .PackageDescriptor.Metadata.RequiredRubygemsVersion}}{{if gt $i 0}}, {{end}}{{$v.Restriction}}{{$v.Version}}{{end}}</p>{{end}}
+			{{if .PackageDescriptor.Metadata.RequiredRubyVersion}}<p>{{ctx.Locale.Tr "packages.rubygems.required.ruby"}}: {{range $i, $v := .PackageDescriptor.Metadata.RequiredRubyVersion}}{{if gt $i 0}}, {{end}}{{$v.Restriction}}{{$v.Version}}{{end}}</p>{{end}}
+			{{if .PackageDescriptor.Metadata.RequiredRubygemsVersion}}<p>{{ctx.Locale.Tr "packages.rubygems.required.rubygems"}}: {{range $i, $v := .PackageDescriptor.Metadata.RequiredRubygemsVersion}}{{if gt $i 0}}, {{end}}{{$v.Restriction}}{{$v.Version}}{{end}}</p>{{end}}
 		</div>
 	{{end}}
 	{{if or .PackageDescriptor.Metadata.RuntimeDependencies .PackageDescriptor.Metadata.DevelopmentDependencies}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4>
 		<div class="ui attached segment">
 			<div class="ui list">
-				{{template "package/content/rubygems_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.RuntimeDependencies "title" (.locale.Tr "packages.rubygems.dependencies.runtime")}}
-				{{template "package/content/rubygems_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.DevelopmentDependencies "title" (.locale.Tr "packages.rubygems.dependencies.development")}}
+				{{template "package/content/rubygems_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.RuntimeDependencies "title" (ctx.Locale.Tr "packages.rubygems.dependencies.runtime")}}
+				{{template "package/content/rubygems_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.DevelopmentDependencies "title" (ctx.Locale.Tr "packages.rubygems.dependencies.development")}}
 			</div>
 		</div>
 	{{end}}
diff --git a/templates/package/content/rubygems_dependencies.tmpl b/templates/package/content/rubygems_dependencies.tmpl
index 80febc84f4..2c42dcead2 100644
--- a/templates/package/content/rubygems_dependencies.tmpl
+++ b/templates/package/content/rubygems_dependencies.tmpl
@@ -3,8 +3,8 @@
 <table class="ui single line very basic table">
 	<thead>
 		<tr>
-			<th class="eleven wide">{{.root.locale.Tr "packages.dependency.id"}}</th>
-			<th class="five wide">{{.root.locale.Tr "packages.dependency.version"}}</th>
+			<th class="eleven wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th>
+			<th class="five wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th>
 		</tr>
 	</thead>
 	<tbody>
diff --git a/templates/package/content/swift.tmpl b/templates/package/content/swift.tmpl
index 92559491a9..ca36033df9 100644
--- a/templates/package/content/swift.tmpl
+++ b/templates/package/content/swift.tmpl
@@ -1,36 +1,36 @@
 {{if eq .PackageDescriptor.Package.Type "swift"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.swift.registry"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.swift.registry"}}</label>
 				<div class="markup"><pre class="code-block"><code>swift package-registry set <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/swift"></gitea-origin-url></code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-code"}} {{.locale.Tr "packages.swift.install" | Safe}}</label>
+				<label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.swift.install" | Safe}}</label>
 				<div class="markup"><pre class="code-block"><code>dependencies: [
 	.package(id: "{{.PackageDescriptor.Package.Name}}", from:"{{.PackageDescriptor.Version.Version}}")
 ]</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.swift.install2"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.swift.install2"}}</label>
 				<div class="markup"><pre class="code-block"><code>swift package resolve</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Swift" "https://docs.gitea.com/usage/packages/swift/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Swift" "https://docs.gitea.com/usage/packages/swift/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">
 			{{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{end}}
 		</div>
 	{{end}}
 
 	{{if .PackageDescriptor.Metadata.Keywords}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4>
 		<div class="ui attached segment">
 			{{range .PackageDescriptor.Metadata.Keywords}}
 				{{.}}
diff --git a/templates/package/content/vagrant.tmpl b/templates/package/content/vagrant.tmpl
index 8590b44b37..bbb461e4fb 100644
--- a/templates/package/content/vagrant.tmpl
+++ b/templates/package/content/vagrant.tmpl
@@ -1,18 +1,18 @@
 {{if eq .PackageDescriptor.Package.Type "vagrant"}}
-	<h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+	<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4>
 	<div class="ui attached segment">
 		<div class="ui form">
 			<div class="field">
-				<label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.vagrant.install"}}</label>
+				<label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.vagrant.install"}}</label>
 				<div class="markup"><pre class="code-block"><code>vagrant box add --box-version {{.PackageDescriptor.Version.Version}} "<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/vagrant/{{.PackageDescriptor.Package.Name}}"></gitea-origin-url>"</code></pre></div>
 			</div>
 			<div class="field">
-				<label>{{.locale.Tr "packages.registry.documentation" "Vagrant" "https://docs.gitea.com/usage/packages/vagrant/" | Safe}}</label>
+				<label>{{ctx.Locale.Tr "packages.registry.documentation" "Vagrant" "https://docs.gitea.com/usage/packages/vagrant/" | Safe}}</label>
 			</div>
 		</div>
 	</div>
 	{{if .PackageDescriptor.Metadata.Description}}
-		<h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4>
 		<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>
 	{{end}}
 {{end}}
diff --git a/templates/package/metadata/alpine.tmpl b/templates/package/metadata/alpine.tmpl
index 9011bfce10..73cbc06aac 100644
--- a/templates/package/metadata/alpine.tmpl
+++ b/templates/package/metadata/alpine.tmpl
@@ -1,5 +1,5 @@
 {{if eq .PackageDescriptor.Package.Type "alpine"}}
-	{{if .PackageDescriptor.Metadata.Maintainer}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Maintainer}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.Maintainer}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Maintainer}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/cargo.tmpl b/templates/package/metadata/cargo.tmpl
index 79078b4008..9cc0fde730 100644
--- a/templates/package/metadata/cargo.tmpl
+++ b/templates/package/metadata/cargo.tmpl
@@ -1,7 +1,7 @@
 {{if eq .PackageDescriptor.Package.Type "cargo"}}
-	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.cargo.details.repository_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.cargo.details.documentation_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
+	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.cargo.details.repository_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.cargo.details.documentation_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/chef.tmpl b/templates/package/metadata/chef.tmpl
index b414535f9a..fa6e068d23 100644
--- a/templates/package/metadata/chef.tmpl
+++ b/templates/package/metadata/chef.tmpl
@@ -1,5 +1,5 @@
 {{if eq .PackageDescriptor.Package.Type "chef"}}
-	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.repository_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.repository_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/composer.tmpl b/templates/package/metadata/composer.tmpl
index e6f67a1dd5..fbdc33f73d 100644
--- a/templates/package/metadata/composer.tmpl
+++ b/templates/package/metadata/composer.tmpl
@@ -1,5 +1,5 @@
 {{if eq .PackageDescriptor.Package.Type "composer"}}
-	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.Name}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.Homepage}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.Homepage}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{range .PackageDescriptor.Metadata.License}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}}
+	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.Name}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.Homepage}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.Homepage}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{range .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/conan.tmpl b/templates/package/metadata/conan.tmpl
index 0060f91d75..55892bb919 100644
--- a/templates/package/metadata/conan.tmpl
+++ b/templates/package/metadata/conan.tmpl
@@ -1,6 +1,6 @@
 {{if eq .PackageDescriptor.Package.Type "conan"}}
-	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.conan.details.repository"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.conan.details.repository"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/conda.tmpl b/templates/package/metadata/conda.tmpl
index 4021e6b91c..fb7c212863 100644
--- a/templates/package/metadata/conda.tmpl
+++ b/templates/package/metadata/conda.tmpl
@@ -1,6 +1,6 @@
 {{if eq .PackageDescriptor.Package.Type "conda"}}
 	{{if .PackageDescriptor.Metadata.License}}<div class="item">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.conda.details.repository_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.conda.details.documentation_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.conda.details.repository_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.conda.details.documentation_site"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/container.tmpl b/templates/package/metadata/container.tmpl
index 7ff137080e..b05ef0b846 100644
--- a/templates/package/metadata/container.tmpl
+++ b/templates/package/metadata/container.tmpl
@@ -1,9 +1,9 @@
 {{if eq .PackageDescriptor.Package.Type "container"}}
-	<div class="item" title="{{.locale.Tr "packages.container.details.type"}}">{{svg "octicon-package" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Type.Name}}</div>
-	{{if .PackageDescriptor.Metadata.Platform}}<div class="item" title="{{$.locale.Tr "packages.container.details.platform"}}">{{svg "octicon-cpu" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Platform}}</div>{{end}}
-	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}}
+	<div class="item" title="{{ctx.Locale.Tr "packages.container.details.type"}}">{{svg "octicon-package" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Type.Name}}</div>
+	{{if .PackageDescriptor.Metadata.Platform}}<div class="item" title="{{ctx.Locale.Tr "packages.container.details.platform"}}">{{svg "octicon-cpu" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Platform}}</div>{{end}}
+	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}}
 	{{if .PackageDescriptor.Metadata.Licenses}}<div class="item">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Licenses}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.repository_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.documentation_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.repository_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.documentation_site"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/cran.tmpl b/templates/package/metadata/cran.tmpl
index 7b113ec797..1d5a11e196 100644
--- a/templates/package/metadata/cran.tmpl
+++ b/templates/package/metadata/cran.tmpl
@@ -1,5 +1,5 @@
 {{if eq .PackageDescriptor.Package.Type "cran"}}
-	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
-	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.}}</div>{{end}}
-	{{range .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.}}" target="_blank" rel="noopener noreferrer me">{{$.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
+	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.}}</div>{{end}}
+	{{range .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/debian.tmpl b/templates/package/metadata/debian.tmpl
index 93b6db3bd2..3cd845c9fe 100644
--- a/templates/package/metadata/debian.tmpl
+++ b/templates/package/metadata/debian.tmpl
@@ -1,4 +1,4 @@
 {{if eq .PackageDescriptor.Package.Type "debian"}}
-	{{if .PackageDescriptor.Metadata.Maintainer}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Maintainer}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.Maintainer}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Maintainer}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/helm.tmpl b/templates/package/metadata/helm.tmpl
index 33e603bb32..499f77e80d 100644
--- a/templates/package/metadata/helm.tmpl
+++ b/templates/package/metadata/helm.tmpl
@@ -1,4 +1,4 @@
 {{if eq .PackageDescriptor.Package.Type "helm"}}
-	{{range .PackageDescriptor.Metadata.Maintainers}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.Name}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.Home}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.Home}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{range .PackageDescriptor.Metadata.Maintainers}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.Name}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.Home}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.Home}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/maven.tmpl b/templates/package/metadata/maven.tmpl
index 78c0d32267..36f5eca840 100644
--- a/templates/package/metadata/maven.tmpl
+++ b/templates/package/metadata/maven.tmpl
@@ -1,5 +1,5 @@
 {{if eq .PackageDescriptor.Package.Type "maven"}}
 	{{if .PackageDescriptor.Metadata.Name}}<div class="item">{{svg "octicon-note" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Name}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{range .PackageDescriptor.Metadata.Licenses}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{range .PackageDescriptor.Metadata.Licenses}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/npm.tmpl b/templates/package/metadata/npm.tmpl
index cbebf996f4..9794d851af 100644
--- a/templates/package/metadata/npm.tmpl
+++ b/templates/package/metadata/npm.tmpl
@@ -1,8 +1,8 @@
 {{if eq .PackageDescriptor.Package.Type "npm"}}
-	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
 	{{range .PackageDescriptor.VersionProperties}}
-		{{if eq .Name "npm.tag"}}<div class="item" title="{{$.locale.Tr "packages.npm.details.tag"}}">{{svg "octicon-versions" 16 "gt-mr-3"}} {{.Value}}</div>{{end}}
+		{{if eq .Name "npm.tag"}}<div class="item" title="{{ctx.Locale.Tr "packages.npm.details.tag"}}">{{svg "octicon-versions" 16 "gt-mr-3"}} {{.Value}}</div>{{end}}
 	{{end}}
 {{end}}
diff --git a/templates/package/metadata/nuget.tmpl b/templates/package/metadata/nuget.tmpl
index 3b56102203..48c8d602dd 100644
--- a/templates/package/metadata/nuget.tmpl
+++ b/templates/package/metadata/nuget.tmpl
@@ -1,4 +1,4 @@
 {{if eq .PackageDescriptor.Package.Type "nuget"}}
-	{{if .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Authors}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Authors}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/pub.tmpl b/templates/package/metadata/pub.tmpl
index 8147ba85cc..1e4a90e78c 100644
--- a/templates/package/metadata/pub.tmpl
+++ b/templates/package/metadata/pub.tmpl
@@ -1,5 +1,5 @@
 {{if eq .PackageDescriptor.Package.Type "pub"}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.repository_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.documentation_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.repository_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.documentation_site"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/pypi.tmpl b/templates/package/metadata/pypi.tmpl
index 205487d3ce..f447cb7f4f 100644
--- a/templates/package/metadata/pypi.tmpl
+++ b/templates/package/metadata/pypi.tmpl
@@ -1,5 +1,5 @@
 {{if eq .PackageDescriptor.Package.Type "pypi"}}
-	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/rpm.tmpl b/templates/package/metadata/rpm.tmpl
index 1bbc2c89ae..026f129590 100644
--- a/templates/package/metadata/rpm.tmpl
+++ b/templates/package/metadata/rpm.tmpl
@@ -1,4 +1,4 @@
 {{if eq .PackageDescriptor.Package.Type "rpm"}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/rubygems.tmpl b/templates/package/metadata/rubygems.tmpl
index 7e9af01eb7..62150b1a43 100644
--- a/templates/package/metadata/rubygems.tmpl
+++ b/templates/package/metadata/rubygems.tmpl
@@ -1,5 +1,5 @@
 {{if eq .PackageDescriptor.Package.Type "rubygems"}}
-	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>	{{end}}
-	{{range .PackageDescriptor.Metadata.Licenses}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}}
+	{{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>	{{end}}
+	{{range .PackageDescriptor.Metadata.Licenses}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/swift.tmpl b/templates/package/metadata/swift.tmpl
index 8a9ab071fc..3df38e3200 100644
--- a/templates/package/metadata/swift.tmpl
+++ b/templates/package/metadata/swift.tmpl
@@ -1,4 +1,4 @@
 {{if eq .PackageDescriptor.Package.Type "swift"}}
-	{{if .PackageDescriptor.Metadata.Author.String}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.Author.String}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/metadata/vagrant.tmpl b/templates/package/metadata/vagrant.tmpl
index 030da9c156..62c50a0dfd 100644
--- a/templates/package/metadata/vagrant.tmpl
+++ b/templates/package/metadata/vagrant.tmpl
@@ -1,5 +1,5 @@
 {{if eq .PackageDescriptor.Package.Type "vagrant"}}
-	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
-	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
-	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.conan.details.repository"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
+	{{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+	{{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.conan.details.repository"}}</a></div>{{end}}
 {{end}}
diff --git a/templates/package/settings.tmpl b/templates/package/settings.tmpl
index d6c431de03..6ef62753e2 100644
--- a/templates/package/settings.tmpl
+++ b/templates/package/settings.tmpl
@@ -4,12 +4,12 @@
 	<div class="ui container">
 		{{template "user/overview/header" .}}
 		{{template "base/alert" .}}
-		<p><a href="{{.PackageDescriptor.FullWebLink}}">{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</a> / <strong>{{.locale.Tr "repo.settings"}}</strong></p>
+		<p><a href="{{.PackageDescriptor.FullWebLink}}">{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</a> / <strong>{{ctx.Locale.Tr "repo.settings"}}</strong></p>
 		<h4 class="ui top attached header">
-			{{.locale.Tr "packages.settings.link"}}
+			{{ctx.Locale.Tr "packages.settings.link"}}
 		</h4>
 		<div class="ui attached segment">
-			<p>{{.locale.Tr "packages.settings.link.description"}}</p>
+			<p>{{ctx.Locale.Tr "packages.settings.link.description"}}</p>
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{template "base/disable_form_autofill"}}
 				{{.CsrfTokenHtml}}
@@ -22,7 +22,7 @@
 						{{end}}
 						<input type="hidden" name="repo_id" value="{{$repoID}}">
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
-						<div class="default text">{{.locale.Tr "packages.settings.link.select"}}</div>
+						<div class="default text">{{ctx.Locale.Tr "packages.settings.link.select"}}</div>
 						<div class="menu">
 							{{range .Repos}}
 								<div class="item" data-value="{{.ID}}">{{.Name}}</div>
@@ -31,30 +31,30 @@
 					</div>
 				</div>
 				<div class="field">
-					<button class="ui primary button">{{.locale.Tr "packages.settings.link.button"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "packages.settings.link.button"}}</button>
 				</div>
 			</form>
 		</div>
 		<h4 class="ui top attached error header">
-			{{.locale.Tr "repo.settings.danger_zone"}}
+			{{ctx.Locale.Tr "repo.settings.danger_zone"}}
 		</h4>
 		<div class="ui attached error danger segment">
 			<div class="flex-list">
 				<div class="flex-item">
 					<div class="flex-item-main">
-						<div class="flex-item-title">{{.locale.Tr "packages.settings.delete"}}</div>
-						<div class="flex-item-body">{{.locale.Tr "packages.settings.delete.description"}}</div>
+						<div class="flex-item-title">{{ctx.Locale.Tr "packages.settings.delete"}}</div>
+						<div class="flex-item-body">{{ctx.Locale.Tr "packages.settings.delete.description"}}</div>
 					</div>
 					<div class="flex-item-trailing">
-						<button class="ui basic red show-modal button" data-modal="#delete-package-modal">{{.locale.Tr "packages.settings.delete"}}</button>
+						<button class="ui basic red show-modal button" data-modal="#delete-package-modal">{{ctx.Locale.Tr "packages.settings.delete"}}</button>
 					</div>
 					<div class="ui tiny modal" id="delete-package-modal">
 						<div class="header">
-							{{.locale.Tr "packages.settings.delete"}}
+							{{ctx.Locale.Tr "packages.settings.delete"}}
 						</div>
 						<div class="content">
 							<div class="ui warning message gt-word-break">
-								{{.locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}}
+								{{ctx.Locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}}
 							</div>
 							<form class="ui form" action="{{.Link}}" method="post">
 								{{.CsrfTokenHtml}}
diff --git a/templates/package/shared/cargo.tmpl b/templates/package/shared/cargo.tmpl
index 9761cb2133..b452065881 100644
--- a/templates/package/shared/cargo.tmpl
+++ b/templates/package/shared/cargo.tmpl
@@ -1,24 +1,24 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "packages.owner.settings.cargo.title"}}
+	{{ctx.Locale.Tr "packages.owner.settings.cargo.title"}}
 </h4>
 <div class="ui attached segment">
 	<div class="ui form">
 		<div class="field">
-			<label>{{$.locale.Tr "packages.owner.settings.cargo.initialize.description"}}</label>
+			<label>{{ctx.Locale.Tr "packages.owner.settings.cargo.initialize.description"}}</label>
 		</div>
 		<form class="field" action="{{.Link}}/cargo/initialize" method="post">
 			{{.CsrfTokenHtml}}
-			<button class="ui primary button">{{$.locale.Tr "packages.owner.settings.cargo.initialize"}}</button>
+			<button class="ui primary button">{{ctx.Locale.Tr "packages.owner.settings.cargo.initialize"}}</button>
 		</form>
 		<div class="field">
-			<label>{{$.locale.Tr "packages.owner.settings.cargo.rebuild.description"}}</label>
+			<label>{{ctx.Locale.Tr "packages.owner.settings.cargo.rebuild.description"}}</label>
 		</div>
 		<form class="field" action="{{.Link}}/cargo/rebuild" method="post">
 			{{.CsrfTokenHtml}}
-			<button class="ui primary button">{{$.locale.Tr "packages.owner.settings.cargo.rebuild"}}</button>
+			<button class="ui primary button">{{ctx.Locale.Tr "packages.owner.settings.cargo.rebuild"}}</button>
 		</form>
 		<div class="field">
-			<label>{{.locale.Tr "packages.registry.documentation" "Cargo" "https://docs.gitea.com/usage/packages/cargo/" | Safe}}</label>
+			<label>{{ctx.Locale.Tr "packages.registry.documentation" "Cargo" "https://docs.gitea.com/usage/packages/cargo/" | Safe}}</label>
 		</div>
 	</div>
 </div>
diff --git a/templates/package/shared/cleanup_rules/edit.tmpl b/templates/package/shared/cleanup_rules/edit.tmpl
index 1bfa6260a1..8729494412 100644
--- a/templates/package/shared/cleanup_rules/edit.tmpl
+++ b/templates/package/shared/cleanup_rules/edit.tmpl
@@ -1,16 +1,16 @@
-<h4 class="ui top attached header">{{if .IsEditRule}}{{.locale.Tr "packages.owner.settings.cleanuprules.edit"}}{{else}}{{.locale.Tr "packages.owner.settings.cleanuprules.add"}}{{end}}</h4>
+<h4 class="ui top attached header">{{if .IsEditRule}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.edit"}}{{else}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.add"}}{{end}}</h4>
 <div class="ui attached segment">
 	<form class="ui form" action="{{.Link}}" method="post">
 		{{.CsrfTokenHtml}}
 		<input name="id" type="hidden" value="{{.CleanupRule.ID}}">
 		<div class="field">
 			<div class="ui checkbox">
-				<label>{{.locale.Tr "enabled"}}</label>
+				<label>{{ctx.Locale.Tr "enabled"}}</label>
 				<input type="checkbox" name="enabled" {{if .CleanupRule.Enabled}}checked{{end}}>
 			</div>
 		</div>
 		<div class="{{if .IsEditRule}}disabled {{end}}field {{if .Err_Type}}error{{end}}">
-			<label>{{.locale.Tr "packages.filter.type"}}</label>
+			<label>{{ctx.Locale.Tr "packages.filter.type"}}</label>
 			<select class="ui selection dropdown" name="type">
 				{{range $type := .AvailableTypes}}
 				<option{{if eq $.CleanupRule.Type $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option>
@@ -19,54 +19,54 @@
 		</div>
 		<div class="field">
 			<div class="ui checkbox">
-				<label>{{.locale.Tr "packages.owner.settings.cleanuprules.pattern_full_match"}}</label>
+				<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.pattern_full_match"}}</label>
 				<input type="checkbox" name="match_full_name" {{if .CleanupRule.MatchFullName}}checked{{end}}>
 			</div>
 		</div>
 		<div class="divider"></div>
-		<p>{{.locale.Tr "packages.owner.settings.cleanuprules.keep.title"}}</p>
+		<p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.title"}}</p>
 		<div class="field {{if .Err_KeepCount}}error{{end}}">
-			<label>{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</label>
+			<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</label>
 			<select class="ui selection dropdown" name="keep_count">
 				<option{{if eq .CleanupRule.KeepCount 0}} selected="selected"{{end}} value="0"></option>
-				<option{{if eq .CleanupRule.KeepCount 1}} selected="selected"{{end}} value="1">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}</option>
-				<option{{if eq .CleanupRule.KeepCount 5}} selected="selected"{{end}} value="5">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 5}}</option>
-				<option{{if eq .CleanupRule.KeepCount 10}} selected="selected"{{end}} value="10">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 10}}</option>
-				<option{{if eq .CleanupRule.KeepCount 25}} selected="selected"{{end}} value="25">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 25}}</option>
-				<option{{if eq .CleanupRule.KeepCount 50}} selected="selected"{{end}} value="50">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 50}}</option>
-				<option{{if eq .CleanupRule.KeepCount 100}} selected="selected"{{end}} value="100">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 100}}</option>
+				<option{{if eq .CleanupRule.KeepCount 1}} selected="selected"{{end}} value="1">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}</option>
+				<option{{if eq .CleanupRule.KeepCount 5}} selected="selected"{{end}} value="5">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 5}}</option>
+				<option{{if eq .CleanupRule.KeepCount 10}} selected="selected"{{end}} value="10">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 10}}</option>
+				<option{{if eq .CleanupRule.KeepCount 25}} selected="selected"{{end}} value="25">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 25}}</option>
+				<option{{if eq .CleanupRule.KeepCount 50}} selected="selected"{{end}} value="50">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 50}}</option>
+				<option{{if eq .CleanupRule.KeepCount 100}} selected="selected"{{end}} value="100">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 100}}</option>
 			</select>
 		</div>
 		<div class="field {{if .Err_KeepPattern}}error{{end}}">
-			<label>{{.locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</label>
+			<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</label>
 			<input name="keep_pattern" type="text" value="{{.CleanupRule.KeepPattern}}">
-			<p>{{.locale.Tr "packages.owner.settings.cleanuprules.keep.pattern.container" | Safe}}</p>
+			<p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern.container" | Safe}}</p>
 		</div>
 		<div class="divider"></div>
-		<p>{{.locale.Tr "packages.owner.settings.cleanuprules.remove.title"}}</p>
+		<p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.title"}}</p>
 		<div class="field {{if .Err_RemoveDays}}error{{end}}">
-			<label>{{.locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</label>
+			<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</label>
 			<select class="ui selection dropdown" name="remove_days">
 				<option{{if eq .CleanupRule.RemoveDays 0}} selected="selected"{{end}} value="0"></option>
-				<option{{if eq .CleanupRule.RemoveDays 7}} selected="selected"{{end}} value="7">{{.locale.Tr "tool.days" 7}}</option>
-				<option{{if eq .CleanupRule.RemoveDays 14}} selected="selected"{{end}} value="14">{{.locale.Tr "tool.days" 14}}</option>
-				<option{{if eq .CleanupRule.RemoveDays 30}} selected="selected"{{end}} value="30">{{.locale.Tr "tool.days" 30}}</option>
-				<option{{if eq .CleanupRule.RemoveDays 60}} selected="selected"{{end}} value="60">{{.locale.Tr "tool.days" 60}}</option>
-				<option{{if eq .CleanupRule.RemoveDays 90}} selected="selected"{{end}} value="90">{{.locale.Tr "tool.days" 90}}</option>
-				<option{{if eq .CleanupRule.RemoveDays 180}} selected="selected"{{end}} value="180">{{.locale.Tr "tool.days" 180}}</option>
+				<option{{if eq .CleanupRule.RemoveDays 7}} selected="selected"{{end}} value="7">{{ctx.Locale.Tr "tool.days" 7}}</option>
+				<option{{if eq .CleanupRule.RemoveDays 14}} selected="selected"{{end}} value="14">{{ctx.Locale.Tr "tool.days" 14}}</option>
+				<option{{if eq .CleanupRule.RemoveDays 30}} selected="selected"{{end}} value="30">{{ctx.Locale.Tr "tool.days" 30}}</option>
+				<option{{if eq .CleanupRule.RemoveDays 60}} selected="selected"{{end}} value="60">{{ctx.Locale.Tr "tool.days" 60}}</option>
+				<option{{if eq .CleanupRule.RemoveDays 90}} selected="selected"{{end}} value="90">{{ctx.Locale.Tr "tool.days" 90}}</option>
+				<option{{if eq .CleanupRule.RemoveDays 180}} selected="selected"{{end}} value="180">{{ctx.Locale.Tr "tool.days" 180}}</option>
 			</select>
 		</div>
 		<div class="field {{if .Err_RemovePattern}}error{{end}}">
-			<label>{{.locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</label>
+			<label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</label>
 			<input name="remove_pattern" type="text" value="{{.CleanupRule.RemovePattern}}">
 		</div>
 		<div class="field">
 			{{if .IsEditRule}}
-			<button class="ui primary button" name="action" value="save">{{.locale.Tr "save"}}</button>
-			<button class="ui red button" name="action" value="remove">{{.locale.Tr "remove"}}</button>
-			<a class="ui button" href="{{.Link}}/preview">{{.locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a>
+			<button class="ui primary button" name="action" value="save">{{ctx.Locale.Tr "save"}}</button>
+			<button class="ui red button" name="action" value="remove">{{ctx.Locale.Tr "remove"}}</button>
+			<a class="ui button" href="{{.Link}}/preview">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a>
 			{{else}}
-			<button class="ui primary button" name="action" value="save">{{.locale.Tr "add"}}</button>
+			<button class="ui primary button" name="action" value="save">{{ctx.Locale.Tr "add"}}</button>
 			{{end}}
 		</div>
 	</form>
diff --git a/templates/package/shared/cleanup_rules/list.tmpl b/templates/package/shared/cleanup_rules/list.tmpl
index e2af344817..6505c8f9a5 100644
--- a/templates/package/shared/cleanup_rules/list.tmpl
+++ b/templates/package/shared/cleanup_rules/list.tmpl
@@ -1,7 +1,7 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "packages.owner.settings.cleanuprules.title"}}
+	{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.title"}}
 	<div class="ui right">
-		<a class="ui primary tiny button" href="{{.Link}}/rules/add">{{.locale.Tr "packages.owner.settings.cleanuprules.add"}}</a>
+		<a class="ui primary tiny button" href="{{.Link}}/rules/add">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.add"}}</a>
 	</div>
 </h4>
 <div class="ui attached segment">
@@ -16,26 +16,26 @@
 						<a class="item" href="{{$.Link}}/rules/{{.ID}}">{{.Type.Name}}</a>
 					</div>
 					<div class="flex-item-body">
-						<i>{{if .Enabled}}{{$.locale.Tr "enabled"}}{{else}}{{$.locale.Tr "disabled"}}{{end}}</i>
+						<i>{{if .Enabled}}{{ctx.Locale.Tr "enabled"}}{{else}}{{ctx.Locale.Tr "disabled"}}{{end}}</i>
 					</div>
 					{{if .KeepCount}}
 					<div class="flex-item-body">
-						<i>{{$.locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</i> {{if eq .KeepCount 1}}{{$.locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}{{else}}{{$.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" .KeepCount}}{{end}}
+						<i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</i> {{if eq .KeepCount 1}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}{{else}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" .KeepCount}}{{end}}
 					</div>
 					{{end}}
 					{{if .KeepPattern}}
 					<div class="flex-item-body">
-						<i>{{$.locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</i> {{StringUtils.EllipsisString .KeepPattern 100}}
+						<i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</i> {{StringUtils.EllipsisString .KeepPattern 100}}
 					</div>
 					{{end}}
 					{{if .RemoveDays}}
 					<div class="flex-item-body">
-						<i>{{$.locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</i> {{$.locale.Tr "tool.days" .RemoveDays}}
+						<i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</i> {{ctx.Locale.Tr "tool.days" .RemoveDays}}
 					</div>
 					{{end}}
 					{{if .RemovePattern}}
 					<div class="flex-item-body">
-						<i>{{$.locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</i> {{StringUtils.EllipsisString .RemovePattern 100}}
+						<i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</i> {{StringUtils.EllipsisString .RemovePattern 100}}
 					</div>
 					{{end}}
 				</div>
@@ -43,14 +43,14 @@
 					<div class="ui dropdown tiny basic button">
 						{{svg "octicon-kebab-horizontal"}}
 						<div class="menu">
-							<a class="item" href="{{$.Link}}/rules/{{.ID}}">{{$.locale.Tr "edit"}}</a>
-							<a class="item" href="{{$.Link}}/rules/{{.ID}}/preview">{{$.locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a>
+							<a class="item" href="{{$.Link}}/rules/{{.ID}}">{{ctx.Locale.Tr "edit"}}</a>
+							<a class="item" href="{{$.Link}}/rules/{{.ID}}/preview">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a>
 						</div>
 					</div>
 				</div>
 			</div>
 		{{else}}
-			<div class="item">{{.locale.Tr "packages.owner.settings.cleanuprules.none"}}</div>
+			<div class="item">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.none"}}</div>
 		{{end}}
 	</div>
 </div>
diff --git a/templates/package/shared/cleanup_rules/preview.tmpl b/templates/package/shared/cleanup_rules/preview.tmpl
index 5992ea60be..7a50d5ccca 100644
--- a/templates/package/shared/cleanup_rules/preview.tmpl
+++ b/templates/package/shared/cleanup_rules/preview.tmpl
@@ -1,17 +1,17 @@
-<h4 class="ui top attached header">{{.locale.Tr "packages.owner.settings.cleanuprules.preview"}}</h4>
+<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}</h4>
 <div class="ui attached segment">
-	<p>{{.locale.Tr "packages.owner.settings.cleanuprules.preview.overview" (len .VersionsToRemove)}}</p>
+	<p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview.overview" (len .VersionsToRemove)}}</p>
 </div>
 <div class="ui attached table segment">
 	<table class="ui very basic striped table unstackable">
 		<thead>
 			<tr>
-				<th>{{.locale.Tr "admin.packages.type"}}</th>
-				<th>{{.locale.Tr "admin.packages.name"}}</th>
-				<th>{{.locale.Tr "admin.packages.version"}}</th>
-				<th>{{.locale.Tr "admin.packages.creator"}}</th>
-				<th>{{.locale.Tr "admin.packages.size"}}</th>
-				<th>{{.locale.Tr "admin.packages.published"}}</th>
+				<th>{{ctx.Locale.Tr "admin.packages.type"}}</th>
+				<th>{{ctx.Locale.Tr "admin.packages.name"}}</th>
+				<th>{{ctx.Locale.Tr "admin.packages.version"}}</th>
+				<th>{{ctx.Locale.Tr "admin.packages.creator"}}</th>
+				<th>{{ctx.Locale.Tr "admin.packages.size"}}</th>
+				<th>{{ctx.Locale.Tr "admin.packages.published"}}</th>
 			</tr>
 		</thead>
 		<tbody>
@@ -26,7 +26,7 @@
 				</tr>
 			{{else}}
 				<tr>
-					<td colspan="6">{{.locale.Tr "packages.owner.settings.cleanuprules.preview.none"}}</td>
+					<td colspan="6">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview.none"}}</td>
 				</tr>
 			{{end}}
 		</tbody>
diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl
index d30767cd7f..af79490f4d 100644
--- a/templates/package/shared/list.tmpl
+++ b/templates/package/shared/list.tmpl
@@ -3,13 +3,13 @@
 	<div class="ui fluid action input">
 		{{template "shared/searchinput" dict "Value" .Query "AutoFocus" true}}
 		<select class="ui dropdown" name="type">
-			<option value="">{{.locale.Tr "packages.filter.type"}}</option>
-			<option value="all">{{.locale.Tr "packages.filter.type.all"}}</option>
+			<option value="">{{ctx.Locale.Tr "packages.filter.type"}}</option>
+			<option value="all">{{ctx.Locale.Tr "packages.filter.type.all"}}</option>
 			{{range $type := .AvailableTypes}}
 			<option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option>
 			{{end}}
 		</select>
-		<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+		<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 	</div>
 </form>
 <div>
@@ -22,15 +22,15 @@
 					<span class="ui label">{{svg .Package.Type.SVGName 16}} {{.Package.Type.Name}}</span>
 				</div>
 				<div class="flex-item-body">
-					{{$timeStr := TimeSinceUnix .Version.CreatedUnix $.locale}}
+					{{$timeStr := TimeSinceUnix .Version.CreatedUnix ctx.Locale}}
 					{{$hasRepositoryAccess := false}}
 					{{if .Repository}}
 						{{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}}
 					{{end}}
 					{{if $hasRepositoryAccess}}
-						{{$.locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.Link (.Repository.FullName | Escape) | Safe}}
+						{{ctx.Locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.Link (.Repository.FullName | Escape) | Safe}}
 					{{else}}
-						{{$.locale.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}}
+						{{ctx.Locale.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}}
 					{{end}}
 				</div>
 			</div>
@@ -40,15 +40,15 @@
 		{{if not .HasPackages}}
 			<div class="empty center">
 				{{svg "octicon-package" 48}}
-				<h2>{{.locale.Tr "packages.empty"}}</h2>
+				<h2>{{ctx.Locale.Tr "packages.empty"}}</h2>
 				{{if and .Repository .CanWritePackages}}
 					{{$packagesUrl := URLJoin .Owner.HomeLink "-" "packages"}}
-					<p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p>
+					<p>{{ctx.Locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p>
 				{{end}}
-				<p>{{.locale.Tr "packages.empty.documentation" "https://docs.gitea.com/usage/packages/overview/" | Safe}}</p>
+				<p>{{ctx.Locale.Tr "packages.empty.documentation" "https://docs.gitea.com/usage/packages/overview/" | Safe}}</p>
 			</div>
 		{{else}}
-			<p class="gt-py-4">{{.locale.Tr "packages.filter.no_result"}}</p>
+			<p class="gt-py-4">{{ctx.Locale.Tr "packages.filter.no_result"}}</p>
 		{{end}}
 	{{end}}
 	{{template "base/paginate" .}}
diff --git a/templates/package/shared/versionlist.tmpl b/templates/package/shared/versionlist.tmpl
index b372d45df2..71a1557ffb 100644
--- a/templates/package/shared/versionlist.tmpl
+++ b/templates/package/shared/versionlist.tmpl
@@ -1,21 +1,21 @@
-<p><a href="{{.PackageDescriptor.PackageWebLink}}">{{.PackageDescriptor.Package.Name}}</a> / <strong>{{.locale.Tr "packages.versions"}}</strong></p>
+<p><a href="{{.PackageDescriptor.PackageWebLink}}">{{.PackageDescriptor.Package.Name}}</a> / <strong>{{ctx.Locale.Tr "packages.versions"}}</strong></p>
 <form class="ui form ignore-dirty">
 	<div class="ui fluid action input">
 		{{template "shared/searchinput" dict "Value" .Query "AutoFocus" true}}
 		<select class="ui dropdown" name="sort">
-			<option value="version_asc"{{if eq .Sort "version_asc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.asc"}}</option>
-			<option value="version_desc"{{if eq .Sort "version_desc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.desc"}}</option>
-			<option value="created_asc"{{if eq .Sort "created_asc"}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.oldest"}}</option>
-			<option value="created_desc"{{if or (eq .Sort "") (eq .Sort "created_desc")}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.latest"}}</option>
+			<option value="version_asc"{{if eq .Sort "version_asc"}} selected="selected"{{end}}>{{ctx.Locale.Tr "filter.string.asc"}}</option>
+			<option value="version_desc"{{if eq .Sort "version_desc"}} selected="selected"{{end}}>{{ctx.Locale.Tr "filter.string.desc"}}</option>
+			<option value="created_asc"{{if eq .Sort "created_asc"}} selected="selected"{{end}}>{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</option>
+			<option value="created_desc"{{if or (eq .Sort "") (eq .Sort "created_desc")}} selected="selected"{{end}}>{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</option>
 		</select>
 		{{if eq .PackageDescriptor.Package.Type "container"}}
 		<select class="ui dropdown" name="tagged">
 			{{$isTagged := or (eq .Tagged "") (eq .Tagged "tagged")}}
-			<option value="tagged"{{if $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.tagged"}}</option>
-			<option value="untagged"{{if not $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.untagged"}}</option>
+			<option value="tagged"{{if $isTagged}} selected="selected"{{end}}>{{ctx.Locale.Tr "packages.filter.container.tagged"}}</option>
+			<option value="untagged"{{if not $isTagged}} selected="selected"{{end}}>{{ctx.Locale.Tr "packages.filter.container.untagged"}}</option>
 		</select>
 		{{end}}
-		<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
+		<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
 	</div>
 </form>
 <div>
@@ -25,13 +25,13 @@
 			<div class="flex-item-main">
 				<a class="flex-item-title" href="{{.FullWebLink}}">{{.Version.LowerVersion}}</a>
 				<div class="flex-item-body">
-					{{$.locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix $.locale) .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}}
+					{{ctx.Locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix ctx.Locale) .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}}
 				</div>
 			</div>
 		</div>
 	</div>
 	{{else}}
-		<p class="gt-py-4">{{.locale.Tr "packages.filter.no_result"}}</p>
+		<p class="gt-py-4">{{ctx.Locale.Tr "packages.filter.no_result"}}</p>
 	{{end}}
 	{{template "base/paginate" .}}
 </div>
diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl
index 2f22b4ec2a..bee4d4e56c 100644
--- a/templates/package/view.tmpl
+++ b/templates/package/view.tmpl
@@ -8,11 +8,11 @@
 				<h1>{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</h1>
 			</div>
 			<div>
-				{{$timeStr := TimeSinceUnix .PackageDescriptor.Version.CreatedUnix $.locale}}
+				{{$timeStr := TimeSinceUnix .PackageDescriptor.Version.CreatedUnix ctx.Locale}}
 				{{if .HasRepositoryAccess}}
-					{{.locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) .PackageDescriptor.Repository.Link (.PackageDescriptor.Repository.FullName | Escape) | Safe}}
+					{{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) .PackageDescriptor.Repository.Link (.PackageDescriptor.Repository.FullName | Escape) | Safe}}
 				{{else}}
-					{{.locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) | Safe}}
+					{{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) | Safe}}
 				{{end}}
 			</div>
 		</div>
@@ -41,13 +41,13 @@
 				{{template "package/content/vagrant" .}}
 			</div>
 			<div class="issue-content-right ui segment">
-				<strong>{{.locale.Tr "packages.details"}}</strong>
+				<strong>{{ctx.Locale.Tr "packages.details"}}</strong>
 				<div class="ui relaxed list">
 					<div class="item">{{svg .PackageDescriptor.Package.Type.SVGName 16 "gt-mr-3"}} {{.PackageDescriptor.Package.Type.Name}}</div>
 					{{if .HasRepositoryAccess}}
 					<div class="item">{{svg "octicon-repo" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Repository.Link}}">{{.PackageDescriptor.Repository.FullName}}</a></div>
 					{{end}}
-					<div class="item">{{svg "octicon-calendar" 16 "gt-mr-3"}} {{TimeSinceUnix .PackageDescriptor.Version.CreatedUnix $.locale}}</div>
+					<div class="item">{{svg "octicon-calendar" 16 "gt-mr-3"}} {{TimeSinceUnix .PackageDescriptor.Version.CreatedUnix ctx.Locale}}</div>
 					<div class="item">{{svg "octicon-download" 16 "gt-mr-3"}} {{.PackageDescriptor.Version.DownloadCount}}</div>
 					{{template "package/metadata/alpine" .}}
 					{{template "package/metadata/cargo" .}}
@@ -75,7 +75,7 @@
 				</div>
 				{{if not (eq .PackageDescriptor.Package.Type "container")}}
 					<div class="divider"></div>
-					<strong>{{.locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}})</strong>
+					<strong>{{ctx.Locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}})</strong>
 					<div class="ui relaxed list">
 					{{range .PackageDescriptor.Files}}
 						<div class="item">
@@ -86,8 +86,8 @@
 					</div>
 				{{end}}
 				<div class="divider"></div>
-				<strong>{{.locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong>
-				<a class="gt-float-right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{.locale.Tr "packages.versions.view_all"}}</a>
+				<strong>{{ctx.Locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong>
+				<a class="gt-float-right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{ctx.Locale.Tr "packages.versions.view_all"}}</a>
 				<div class="ui relaxed list">
 				{{range .LatestVersions}}
 					<div class="item gt-df">
@@ -100,10 +100,10 @@
 					<div class="divider"></div>
 					<div class="ui relaxed list">
 						{{if .HasRepositoryAccess}}
-						<div class="item">{{svg "octicon-issue-opened" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Repository.Link}}/issues">{{.locale.Tr "repo.issues"}}</a></div>
+						<div class="item">{{svg "octicon-issue-opened" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Repository.Link}}/issues">{{ctx.Locale.Tr "repo.issues"}}</a></div>
 						{{end}}
 						{{if .CanWritePackages}}
-						<div class="item">{{svg "octicon-tools" 16 "gt-mr-3"}} <a href="{{.Link}}/settings">{{.locale.Tr "repo.settings"}}</a></div>
+						<div class="item">{{svg "octicon-tools" 16 "gt-mr-3"}} <a href="{{.Link}}/settings">{{ctx.Locale.Tr "repo.settings"}}</a></div>
 						{{end}}
 					</div>
 				{{end}}
diff --git a/templates/post-install.tmpl b/templates/post-install.tmpl
index 5048b910d8..fb234008fb 100644
--- a/templates/post-install.tmpl
+++ b/templates/post-install.tmpl
@@ -7,13 +7,13 @@
 					<div class="ui stackable middle very relaxed page grid">
 						<div class="sixteen wide center aligned centered column">
 							<div>
-								<img src="{{AssetUrlPrefix}}/img/loading.png" alt="{{.locale.Tr "loading"}}">
+								<img src="{{AssetUrlPrefix}}/img/loading.png" alt="{{ctx.Locale.Tr "loading"}}">
 							</div>
 						</div>
 					</div>
 					<div class="ui stackable middle very relaxed page grid">
 						<div class="sixteen wide center aligned centered column">
-							<p><a id="goto-user-login" href="{{AppSubUrl}}/user/login">{{.locale.Tr "loading"}}</a></p>
+							<p><a id="goto-user-login" href="{{AppSubUrl}}/user/login">{{ctx.Locale.Tr "loading"}}</a></p>
 						</div>
 					</div>
 				</div>
diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl
index 1af2000f4a..36c8bb19dd 100644
--- a/templates/projects/list.tmpl
+++ b/templates/projects/list.tmpl
@@ -3,15 +3,15 @@
 		<div class="small-menu-items ui compact tiny menu list-header-toggle">
 			<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=open&q={{$.Keyword}}">
 				{{svg "octicon-project-symlink" 16 "gt-mr-3"}}
-				{{.locale.PrettyNumber .OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}
+				{{ctx.Locale.PrettyNumber .OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
 			</a>
 			<a class="item{{if .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=closed&q={{$.Keyword}}">
 				{{svg "octicon-check" 16 "gt-mr-3"}}
-				{{.locale.PrettyNumber .ClosedCount}}&nbsp;{{.locale.Tr "repo.issues.closed_title"}}
+				{{ctx.Locale.PrettyNumber .ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
 			</a>
 		</div>
 		<div class="gt-text-right">
-			<a class="ui small primary button" href="{{$.Link}}/new">{{.locale.Tr "repo.projects.new"}}</a>
+			<a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.projects.new"}}</a>
 		</div>
 	</div>
 {{end}}
@@ -24,7 +24,7 @@
 		<div class="ui small search fluid action input">
 			<input type="hidden" name="state" value="{{$.State}}">
 			{{template "shared/searchinput" dict "Value" .Keyword}}
-			<button class="ui small icon button" type="submit" aria-label="{{.locale.Tr "explore.search"}}">
+			<button class="ui small icon button" type="submit" aria-label="{{ctx.Locale.Tr "explore.search"}}">
 				{{svg "octicon-search"}}
 			</button>
 		</div>
@@ -32,13 +32,13 @@
 	<!-- Sort -->
 	<div class="list-header-sort ui small dropdown type jump item">
 		<span class="text">
-			{{.locale.Tr "repo.issues.filter_sort"}}
+			{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 		</span>
 		{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 		<div class="menu">
-			<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&sort=oldest&state={{$.State}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a>
-			<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&sort=recentupdate&state={{$.State}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
-			<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&sort=leastupdate&state={{$.State}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+			<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&sort=oldest&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+			<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&sort=recentupdate&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+			<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&sort=leastupdate&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
 		</div>
 	</div>
 </div>
@@ -54,22 +54,22 @@
 				<div class="group">
 					<div class="flex-text-block">
 						{{svg "octicon-issue-opened" 14}}
-						{{$.locale.PrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
+						{{ctx.Locale.PrettyNumber .NumOpenIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
 					</div>
 					<div class="flex-text-block">
 						{{svg "octicon-check" 14}}
-						{{$.locale.PrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
+						{{ctx.Locale.PrettyNumber .NumClosedIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
 					</div>
 				</div>
 				{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
 				<div class="group">
-					<a class="flex-text-inline" href="{{.Link}}/edit">{{svg "octicon-pencil" 14}}{{$.locale.Tr "repo.issues.label_edit"}}</a>
+					<a class="flex-text-inline" href="{{.Link}}/edit">{{svg "octicon-pencil" 14}}{{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
 					{{if .IsClosed}}
-						<a class="link-action flex-text-inline" href data-url="{{.Link}}/open">{{svg "octicon-check" 14}}{{$.locale.Tr "repo.projects.open"}}</a>
+						<a class="link-action flex-text-inline" href data-url="{{.Link}}/open">{{svg "octicon-check" 14}}{{ctx.Locale.Tr "repo.projects.open"}}</a>
 					{{else}}
-						<a class="link-action flex-text-inline" href data-url="{{.Link}}/close">{{svg "octicon-skip" 14}}{{$.locale.Tr "repo.projects.close"}}</a>
+						<a class="link-action flex-text-inline" href data-url="{{.Link}}/close">{{svg "octicon-skip" 14}}{{ctx.Locale.Tr "repo.projects.close"}}</a>
 					{{end}}
-					<a class="delete-button flex-text-inline" href="#" data-url="{{.Link}}/delete">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a>
+					<a class="delete-button flex-text-inline" href="#" data-url="{{.Link}}/delete">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
 				</div>
 				{{end}}
 			</div>
@@ -88,10 +88,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.projects.deletion"}}
+		{{ctx.Locale.Tr "repo.projects.deletion"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.projects.deletion_desc"}}</p>
+		<p>{{ctx.Locale.Tr "repo.projects.deletion_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/projects/new.tmpl b/templates/projects/new.tmpl
index 711dbe842a..3618edd41b 100644
--- a/templates/projects/new.tmpl
+++ b/templates/projects/new.tmpl
@@ -29,7 +29,7 @@
 					<div class="default text">{{ctx.Locale.Tr "repo.projects.template.desc_helper"}}</div>
 					<div class="menu">
 						{{range $element := .BoardTypes}}
-							<div class="item" data-id="{{$element.BoardType}}" data-value="{{$element.BoardType}}">{{ctx.Locale.Tr $element.Translation}}</div>
+							<div class="item" data-id="{{$element.BoardType}}" data-value="{{$element.BoardType}}">{{ctx.Locale.Tr ctx.Locale.Translation}}</div>
 						{{end}}
 					</div>
 				</div>
@@ -43,12 +43,12 @@
 				{{range $element := .CardTypes}}
 					{{if or (eq $.card_type $element.CardType) (and (not $.PageIsEditProjects) (eq $element.CardType 1))}}
 						<input type="hidden" name="card_type" value="{{$element.CardType}}">
-						<div class="default text">{{ctx.Locale.Tr $element.Translation}}</div>
+						<div class="default text">{{ctx.Locale.Tr ctx.Locale.Translation}}</div>
 					{{end}}
 				{{end}}
 				<div class="menu">
 					{{range $element := .CardTypes}}
-						<div class="item" data-id="{{$element.CardType}}" data-value="{{$element.CardType}}">{{ctx.Locale.Tr $element.Translation}}</div>
+						<div class="item" data-id="{{$element.CardType}}" data-value="{{$element.CardType}}">{{ctx.Locale.Tr ctx.Locale.Translation}}</div>
 					{{end}}
 				</div>
 			</div>
diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl
index 9d256820ae..aa6d66fa68 100644
--- a/templates/repo/actions/list.tmpl
+++ b/templates/repo/actions/list.tmpl
@@ -7,7 +7,7 @@
 		<div class="ui stackable grid">
 			<div class="four wide column">
 				<div class="ui fluid vertical menu">
-					<a class="item{{if not $.CurWorkflow}} active{{end}}" href="{{$.Link}}?actor={{$.CurActor}}&status={{$.CurStatus}}">{{.locale.Tr "actions.runs.all_workflows"}}</a>
+					<a class="item{{if not $.CurWorkflow}} active{{end}}" href="{{$.Link}}?actor={{$.CurActor}}&status={{$.CurStatus}}">{{ctx.Locale.Tr "actions.runs.all_workflows"}}</a>
 					{{range .workflows}}
 						<a class="item{{if eq .Entry.Name $.CurWorkflow}} active{{end}}" href="{{$.Link}}?workflow={{.Entry.Name}}&actor={{$.CurActor}}&status={{$.CurStatus}}">{{.Entry.Name}}
 							{{if .ErrMsg}}
@@ -17,7 +17,7 @@
 							{{end}}
 
 							{{if $.ActionsConfig.IsWorkflowDisabled .Entry.Name}}
-								<div class="ui red label">{{$.locale.Tr "disabled"}}</div>
+								<div class="ui red label">{{ctx.Locale.Tr "disabled"}}</div>
 							{{end}}
 						</a>
 					{{end}}
@@ -27,15 +27,15 @@
 				<div class="ui secondary filter menu gt-je gt-df gt-ac">
 					<!-- Actor -->
 					<div class="ui{{if not .Actors}} disabled{{end}} dropdown jump item">
-						<span class="text">{{.locale.Tr "actions.runs.actor"}}</span>
+						<span class="text">{{ctx.Locale.Tr "actions.runs.actor"}}</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
 							<div class="ui icon search input">
 								<i class="icon">{{svg "octicon-search"}}</i>
-								<input type="text" placeholder="{{.locale.Tr "actions.runs.actor"}}">
+								<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.actor"}}">
 							</div>
 							<a class="item{{if not $.CurActor}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&status={{$.CurStatus}}&actor=0">
-								{{.locale.Tr "actions.runs.actors_no_select"}}
+								{{ctx.Locale.Tr "actions.runs.actors_no_select"}}
 							</a>
 							{{range .Actors}}
 								<a class="item{{if eq .ID $.CurActor}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&actor={{.ID}}&status={{$.CurStatus}}">
@@ -46,15 +46,15 @@
 					</div>
 					<!-- Status -->
 					<div class="ui dropdown jump item">
-						<span class="text">{{.locale.Tr "actions.runs.status"}}</span>
+						<span class="text">{{ctx.Locale.Tr "actions.runs.status"}}</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
 							<div class="ui icon search input">
 								<i class="icon">{{svg "octicon-search"}}</i>
-								<input type="text" placeholder="{{.locale.Tr "actions.runs.status"}}">
+								<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.status"}}">
 							</div>
 							<a class="item{{if not $.CurStatus}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status=0">
-								{{.locale.Tr "actions.runs.status_no_select"}}
+								{{ctx.Locale.Tr "actions.runs.status_no_select"}}
 							</a>
 							{{range .StatusInfoList}}
 								<a class="item{{if eq .Status $.CurStatus}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{.Status}}">
@@ -69,7 +69,7 @@
 							{{svg "octicon-kebab-horizontal"}}
 							<div class="menu">
 								<a class="item link-action" data-url="{{$.Link}}/{{if .CurWorkflowDisabled}}enable{{else}}disable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}">
-									{{if .CurWorkflowDisabled}}{{.locale.Tr "actions.workflow.enable"}}{{else}}{{.locale.Tr "actions.workflow.disable"}}{{end}}
+									{{if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
 								</a>
 							</div>
 						</button>
diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl
index 34b9547029..37b19f0bdc 100644
--- a/templates/repo/actions/runs_list.tmpl
+++ b/templates/repo/actions/runs_list.tmpl
@@ -2,7 +2,7 @@
 	{{if eq (len .Runs) 0}}
 	<div class="empty center">
 		{{svg "octicon-no-entry" 48}}
-		<h2>{{if $.IsFiltered}}{{.locale.Tr "actions.runs.no_results"}}{{else}}{{.locale.Tr "actions.runs.no_runs"}}{{end}}</h2>
+		<h2>{{if $.IsFiltered}}{{ctx.Locale.Tr "actions.runs.no_results"}}{{else}}{{ctx.Locale.Tr "actions.runs.no_runs"}}{{end}}</h2>
 	</div>
 	{{end}}
 	{{range .Runs}}
@@ -17,11 +17,11 @@
 				<div class="flex-item-body">
 					<b>{{if not $.CurWorkflow}}{{.WorkflowID}} {{end}}#{{.Index}}</b>:
 					{{- if .ScheduleID -}}
-						{{$.locale.Tr "actions.runs.scheduled"}}
+						{{ctx.Locale.Tr "actions.runs.scheduled"}}
 					{{- else -}}
-						{{$.locale.Tr "actions.runs.commit"}}
+						{{ctx.Locale.Tr "actions.runs.commit"}}
 						<a href="{{$.RepoLink}}/commit/{{.CommitSHA}}">{{ShortSha .CommitSHA}}</a>
-						{{$.locale.Tr "actions.runs.pushed_by"}}
+						{{ctx.Locale.Tr "actions.runs.pushed_by"}}
 						<a href="{{.TriggerUser.HomeLink}}">{{.TriggerUser.GetDisplayName}}</a>
 					{{- end -}}
 				</div>
@@ -34,7 +34,7 @@
 				{{end}}
 			</div>
 			<div class="run-list-item-right">
-				<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{TimeSinceUnix .Updated $.locale}}</div>
+				<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{TimeSinceUnix .Updated ctx.Locale}}</div>
 				<div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{.Duration}}</div>
 			</div>
 		</div>
diff --git a/templates/repo/actions/view.tmpl b/templates/repo/actions/view.tmpl
index 7b07aa155b..6b07e7000a 100644
--- a/templates/repo/actions/view.tmpl
+++ b/templates/repo/actions/view.tmpl
@@ -6,23 +6,23 @@
 		data-run-index="{{.RunIndex}}"
 		data-job-index="{{.JobIndex}}"
 		data-actions-url="{{.ActionsURL}}"
-		data-locale-approve="{{.locale.Tr "repo.diff.review.approve"}}"
-		data-locale-cancel="{{.locale.Tr "cancel"}}"
-		data-locale-rerun="{{.locale.Tr "rerun"}}"
-		data-locale-rerun-all="{{.locale.Tr "rerun_all"}}"
-		data-locale-status-unknown="{{.locale.Tr "actions.status.unknown"}}"
-		data-locale-status-waiting="{{.locale.Tr "actions.status.waiting"}}"
-		data-locale-status-running="{{.locale.Tr "actions.status.running"}}"
-		data-locale-status-success="{{.locale.Tr "actions.status.success"}}"
-		data-locale-status-failure="{{.locale.Tr "actions.status.failure"}}"
-		data-locale-status-cancelled="{{.locale.Tr "actions.status.cancelled"}}"
-		data-locale-status-skipped="{{.locale.Tr "actions.status.skipped"}}"
-		data-locale-status-blocked="{{.locale.Tr "actions.status.blocked"}}"
-		data-locale-artifacts-title="{{$.locale.Tr "artifacts"}}"
-		data-locale-show-timestamps="{{.locale.Tr "show_timestamps"}}"
-		data-locale-show-log-seconds="{{.locale.Tr "show_log_seconds"}}"
-		data-locale-show-full-screen="{{.locale.Tr "show_full_screen"}}"
-		data-locale-download-logs="{{.locale.Tr "download_logs"}}"
+		data-locale-approve="{{ctx.Locale.Tr "repo.diff.review.approve"}}"
+		data-locale-cancel="{{ctx.Locale.Tr "cancel"}}"
+		data-locale-rerun="{{ctx.Locale.Tr "rerun"}}"
+		data-locale-rerun-all="{{ctx.Locale.Tr "rerun_all"}}"
+		data-locale-status-unknown="{{ctx.Locale.Tr "actions.status.unknown"}}"
+		data-locale-status-waiting="{{ctx.Locale.Tr "actions.status.waiting"}}"
+		data-locale-status-running="{{ctx.Locale.Tr "actions.status.running"}}"
+		data-locale-status-success="{{ctx.Locale.Tr "actions.status.success"}}"
+		data-locale-status-failure="{{ctx.Locale.Tr "actions.status.failure"}}"
+		data-locale-status-cancelled="{{ctx.Locale.Tr "actions.status.cancelled"}}"
+		data-locale-status-skipped="{{ctx.Locale.Tr "actions.status.skipped"}}"
+		data-locale-status-blocked="{{ctx.Locale.Tr "actions.status.blocked"}}"
+		data-locale-artifacts-title="{{ctx.Locale.Tr "artifacts"}}"
+		data-locale-show-timestamps="{{ctx.Locale.Tr "show_timestamps"}}"
+		data-locale-show-log-seconds="{{ctx.Locale.Tr "show_log_seconds"}}"
+		data-locale-show-full-screen="{{ctx.Locale.Tr "show_full_screen"}}"
+		data-locale-download-logs="{{ctx.Locale.Tr "download_logs"}}"
 	>
 	</div>
 </div>
diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl
index 444f21e779..fe592c0000 100644
--- a/templates/repo/activity.tmpl
+++ b/templates/repo/activity.tmpl
@@ -7,24 +7,24 @@
 			<!-- Period -->
 			<div class="ui floating dropdown jump filter">
 				<div class="ui basic compact button">
-					{{.locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong>
+					{{ctx.Locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong>
 					{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				</div>
 				<div class="menu">
-					<a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{.locale.Tr "repo.activity.period.daily"}}</a>
-					<a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{.locale.Tr "repo.activity.period.halfweekly"}}</a>
-					<a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{.locale.Tr "repo.activity.period.weekly"}}</a>
-					<a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{.locale.Tr "repo.activity.period.monthly"}}</a>
-					<a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{.locale.Tr "repo.activity.period.quarterly"}}</a>
-					<a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{.locale.Tr "repo.activity.period.semiyearly"}}</a>
-					<a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{.locale.Tr "repo.activity.period.yearly"}}</a>
+					<a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{ctx.Locale.Tr "repo.activity.period.daily"}}</a>
+					<a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{ctx.Locale.Tr "repo.activity.period.halfweekly"}}</a>
+					<a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{ctx.Locale.Tr "repo.activity.period.weekly"}}</a>
+					<a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{ctx.Locale.Tr "repo.activity.period.monthly"}}</a>
+					<a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{ctx.Locale.Tr "repo.activity.period.quarterly"}}</a>
+					<a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{ctx.Locale.Tr "repo.activity.period.semiyearly"}}</a>
+					<a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{ctx.Locale.Tr "repo.activity.period.yearly"}}</a>
 				</div>
 			</div>
 		</h2>
 		<div class="divider"></div>
 
 		{{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}}
-		<h4 class="ui top attached header">{{.locale.Tr "repo.activity.overview"}}</h4>
+		<h4 class="ui top attached header">{{ctx.Locale.Tr "repo.activity.overview"}}</h4>
 		<div class="ui attached segment two column grid">
 			{{if .Permission.CanRead $.UnitTypePullRequests}}
 				<div class="column">
@@ -38,7 +38,7 @@
 						<a class="table-cell tiny background light grey"></a>
 					</div>
 					{{end}}
-					{{.locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}}
+					{{ctx.Locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}}
 				</div>
 			{{end}}
 			{{if .Permission.CanRead $.UnitTypeIssues}}
@@ -53,7 +53,7 @@
 						<a class="table-cell tiny background light grey"></a>
 					</div>
 					{{end}}
-					{{.locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}}
+					{{ctx.Locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}}
 				</div>
 			{{end}}
 		</div>
@@ -61,21 +61,21 @@
 			{{if .Permission.CanRead $.UnitTypePullRequests}}
 				<a href="#merged-pull-requests" class="ui attached segment text center">
 					<span class="text purple">{{svg "octicon-git-pull-request"}}</span> <strong>{{.Activity.MergedPRCount}}</strong><br>
-					{{.locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}}
+					{{ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}}
 				</a>
 				<a href="#proposed-pull-requests" class="ui attached segment text center">
 					<span class="text green">{{svg "octicon-git-branch"}}</span> <strong>{{.Activity.OpenedPRCount}}</strong><br>
-					{{.locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}}
+					{{ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}}
 				</a>
 			{{end}}
 			{{if .Permission.CanRead $.UnitTypeIssues}}
 				<a href="#closed-issues" class="ui attached segment text center">
 					<span class="text red">{{svg "octicon-issue-closed"}}</span> <strong>{{.Activity.ClosedIssueCount}}</strong><br>
-					{{.locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}}
+					{{ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}}
 				</a>
 				<a href="#new-issues" class="ui attached segment text center">
 					<span class="text green">{{svg "octicon-issue-opened"}}</span> <strong>{{.Activity.OpenedIssueCount}}</strong><br>
-					{{.locale.TrN .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n"}}
+					{{ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n"}}
 				</a>
 			{{end}}
 		</div>
@@ -84,26 +84,26 @@
 		{{if .Permission.CanRead $.UnitTypeCode}}
 			{{if eq .Activity.Code.CommitCountInAllBranches 0}}
 				<div class="ui center aligned segment">
-				<h4 class="ui header">{{.locale.Tr "repo.activity.no_git_activity"}}</h4>
+				<h4 class="ui header">{{ctx.Locale.Tr "repo.activity.no_git_activity"}}</h4>
 				</div>
 			{{end}}
 			{{if gt .Activity.Code.CommitCountInAllBranches 0}}
 				<div class="ui attached segment horizontal segments">
 					<div class="ui attached segment text">
-						{{.locale.Tr "repo.activity.git_stats_exclude_merges"}}
-						<strong>{{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong>
-						{{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}}
-						<strong>{{.locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong>
-						{{.locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}}
-						<strong>{{.locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong>
-						{{.locale.Tr "repo.activity.git_stats_push_to_all_branches"}}
-						{{.locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}}
-						<strong>{{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong>
-						{{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}}
-						{{.locale.Tr "repo.activity.git_stats_additions"}}
-						<strong class="text green">{{.locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}}</strong>
-						{{.locale.Tr "repo.activity.git_stats_and_deletions"}}
-						<strong class="text red">{{.locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}</strong>.
+						{{ctx.Locale.Tr "repo.activity.git_stats_exclude_merges"}}
+						<strong>{{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong>
+						{{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}}
+						<strong>{{ctx.Locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong>
+						{{ctx.Locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}}
+						<strong>{{ctx.Locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong>
+						{{ctx.Locale.Tr "repo.activity.git_stats_push_to_all_branches"}}
+						{{ctx.Locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}}
+						<strong>{{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong>
+						{{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}}
+						{{ctx.Locale.Tr "repo.activity.git_stats_additions"}}
+						<strong class="text green">{{ctx.Locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}}</strong>
+						{{ctx.Locale.Tr "repo.activity.git_stats_and_deletions"}}
+						<strong class="text red">{{ctx.Locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}</strong>.
 					</div>
 					<div class="ui attached segment">
 						<div id="repo-activity-top-authors-chart"></div>
@@ -115,20 +115,20 @@
 		{{if gt .Activity.PublishedReleaseCount 0}}
 			<h4 class="divider divider-text gt-normal-case" id="published-releases">
 				{{svg "octicon-tag" 16 "gt-mr-3"}}
-				{{.locale.Tr "repo.activity.title.releases_published_by"
-					(.locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount)
-					(.locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount)
+				{{ctx.Locale.Tr "repo.activity.title.releases_published_by"
+					(ctx.Locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount)
+					(ctx.Locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount)
 				}}
 			</h4>
 			<div class="list">
 				{{range .Activity.PublishedReleases}}
 					<p class="desc">
-						<span class="ui green label">{{$.locale.Tr "repo.activity.published_release_label"}}</span>
+						<span class="ui green label">{{ctx.Locale.Tr "repo.activity.published_release_label"}}</span>
 						{{.TagName}}
 						{{if not .IsTag}}
 							<a class="title" href="{{$.RepoLink}}/src/{{.TagName | PathEscapeSegments}}">{{.Title | RenderEmoji $.Context}}</a>
 						{{end}}
-						{{TimeSinceUnix .CreatedUnix $.locale}}
+						{{TimeSinceUnix .CreatedUnix ctx.Locale}}
 					</p>
 				{{end}}
 			</div>
@@ -137,17 +137,17 @@
 		{{if gt .Activity.MergedPRCount 0}}
 			<h4 class="divider divider-text gt-normal-case" id="merged-pull-requests">
 				{{svg "octicon-git-pull-request" 16 "gt-mr-3"}}
-				{{.locale.Tr "repo.activity.title.prs_merged_by"
-					(.locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount)
-					(.locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount)
+				{{ctx.Locale.Tr "repo.activity.title.prs_merged_by"
+					(ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount)
+					(ctx.Locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount)
 				}}
 			</h4>
 			<div class="list">
 				{{range .Activity.MergedPRs}}
 					<p class="desc">
-						<span class="ui purple label">{{$.locale.Tr "repo.activity.merged_prs_label"}}</span>
+						<span class="ui purple label">{{ctx.Locale.Tr "repo.activity.merged_prs_label"}}</span>
 						#{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context}}</a>
-						{{TimeSinceUnix .MergedUnix $.locale}}
+						{{TimeSinceUnix .MergedUnix ctx.Locale}}
 					</p>
 				{{end}}
 			</div>
@@ -156,17 +156,17 @@
 		{{if gt .Activity.OpenedPRCount 0}}
 			<h4 class="divider divider-text gt-normal-case" id="proposed-pull-requests">
 				{{svg "octicon-git-branch" 16 "gt-mr-3"}}
-				{{.locale.Tr "repo.activity.title.prs_opened_by"
-					(.locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount)
-					(.locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount)
+				{{ctx.Locale.Tr "repo.activity.title.prs_opened_by"
+					(ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount)
+					(ctx.Locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount)
 				}}
 			</h4>
 			<div class="list">
 				{{range .Activity.OpenedPRs}}
 					<p class="desc">
-						<span class="ui green label">{{$.locale.Tr "repo.activity.opened_prs_label"}}</span>
+						<span class="ui green label">{{ctx.Locale.Tr "repo.activity.opened_prs_label"}}</span>
 						#{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context}}</a>
-						{{TimeSinceUnix .Issue.CreatedUnix $.locale}}
+						{{TimeSinceUnix .Issue.CreatedUnix ctx.Locale}}
 					</p>
 				{{end}}
 			</div>
@@ -175,17 +175,17 @@
 		{{if gt .Activity.ClosedIssueCount 0}}
 			<h4 class="divider divider-text gt-normal-case" id="closed-issues">
 				{{svg "octicon-issue-closed" 16 "gt-mr-3"}}
-				{{.locale.Tr "repo.activity.title.issues_closed_from"
-					(.locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount)
-					(.locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount)
+				{{ctx.Locale.Tr "repo.activity.title.issues_closed_from"
+					(ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount)
+					(ctx.Locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount)
 				}}
 			</h4>
 			<div class="list">
 				{{range .Activity.ClosedIssues}}
 					<p class="desc">
-						<span class="ui red label">{{$.locale.Tr "repo.activity.closed_issue_label"}}</span>
+						<span class="ui red label">{{ctx.Locale.Tr "repo.activity.closed_issue_label"}}</span>
 						#{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a>
-						{{TimeSinceUnix .ClosedUnix $.locale}}
+						{{TimeSinceUnix .ClosedUnix ctx.Locale}}
 					</p>
 				{{end}}
 			</div>
@@ -194,38 +194,38 @@
 		{{if gt .Activity.OpenedIssueCount 0}}
 			<h4 class="divider divider-text gt-normal-case" id="new-issues">
 				{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
-				{{.locale.Tr "repo.activity.title.issues_created_by"
-					(.locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount)
-					(.locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount)
+				{{ctx.Locale.Tr "repo.activity.title.issues_created_by"
+					(ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount)
+					(ctx.Locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount)
 				}}
 			</h4>
 			<div class="list">
 				{{range .Activity.OpenedIssues}}
 					<p class="desc">
-						<span class="ui green label">{{$.locale.Tr "repo.activity.new_issue_label"}}</span>
+						<span class="ui green label">{{ctx.Locale.Tr "repo.activity.new_issue_label"}}</span>
 						#{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a>
-						{{TimeSinceUnix .CreatedUnix $.locale}}
+						{{TimeSinceUnix .CreatedUnix ctx.Locale}}
 					</p>
 				{{end}}
 			</div>
 		{{end}}
 
 		{{if gt .Activity.UnresolvedIssueCount 0}}
-			<h4 class="divider divider-text gt-normal-case" id="unresolved-conversations" data-tooltip-content="{{.locale.Tr "repo.activity.unresolved_conv_desc"}}">
+			<h4 class="divider divider-text gt-normal-case" id="unresolved-conversations" data-tooltip-content="{{ctx.Locale.Tr "repo.activity.unresolved_conv_desc"}}">
 				{{svg "octicon-comment-discussion" 16 "gt-mr-3"}}
-				{{.locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}}
+				{{ctx.Locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}}
 			</h4>
 			<div class="list">
 				{{range .Activity.UnresolvedIssues}}
 					<p class="desc">
-						<span class="ui green label">{{$.locale.Tr "repo.activity.unresolved_conv_label"}}</span>
+						<span class="ui green label">{{ctx.Locale.Tr "repo.activity.unresolved_conv_label"}}</span>
 						#{{.Index}}
 						{{if .IsPull}}
 						<a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a>
 						{{else}}
 						<a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a>
 						{{end}}
-						{{TimeSinceUnix .UpdatedUnix $.locale}}
+						{{TimeSinceUnix .UpdatedUnix ctx.Locale}}
 					</p>
 				{{end}}
 			</div>
diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl
index f164900f08..31cd5b23f6 100644
--- a/templates/repo/blame.tmpl
+++ b/templates/repo/blame.tmpl
@@ -2,11 +2,11 @@
 	{{$revsFileLink := URLJoin .RepoLink "src" .BranchNameSubURL "/.git-blame-ignore-revs"}}
 	{{if .UsesIgnoreRevs}}
 		<div class="ui info message">
-			<p>{{.locale.Tr "repo.blame.ignore_revs" $revsFileLink (print $revsFileLink "?bypass-blame-ignore=true") | Str2html}}</p>
+			<p>{{ctx.Locale.Tr "repo.blame.ignore_revs" $revsFileLink (print $revsFileLink "?bypass-blame-ignore=true") | Str2html}}</p>
 		</div>
 	{{else}}
 		<div class="ui error message">
-			<p>{{.locale.Tr "repo.blame.ignore_revs.failed" $revsFileLink | Str2html}}</p>
+			<p>{{ctx.Locale.Tr "repo.blame.ignore_revs.failed" $revsFileLink | Str2html}}</p>
 		</div>
 	{{end}}
 {{end}}
@@ -17,14 +17,14 @@
 		</div>
 		<div class="file-header-right file-actions gt-df gt-ac gt-fw">
 			<div class="ui buttons">
-				<a class="ui tiny button" href="{{$.RawFileLink}}">{{.locale.Tr "repo.file_raw"}}</a>
+				<a class="ui tiny button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a>
 				{{if not .IsViewCommit}}
-					<a class="ui tiny button" href="{{.RepoLink}}/src/commit/{{.CommitID | PathEscape}}/{{.TreePath | PathEscapeSegments}}">{{.locale.Tr "repo.file_permalink"}}</a>
+					<a class="ui tiny button" href="{{.RepoLink}}/src/commit/{{.CommitID | PathEscape}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.file_permalink"}}</a>
 				{{end}}
-				<a class="ui tiny button" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{.locale.Tr "repo.normal_view"}}</a>
-				<a class="ui tiny button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{.locale.Tr "repo.file_history"}}</a>
-				<button class="ui tiny button unescape-button">{{.locale.Tr "repo.unescape_control_characters"}}</button>
-				<button class="ui tiny button escape-button gt-hidden">{{.locale.Tr "repo.escape_control_characters"}}</button>
+				<a class="ui tiny button" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.normal_view"}}</a>
+				<a class="ui tiny button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.file_history"}}</a>
+				<button class="ui tiny button unescape-button">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
+				<button class="ui tiny button escape-button gt-hidden">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
 			</div>
 		</div>
 	</h4>
@@ -53,7 +53,7 @@
 							</td>
 							<td class="lines-blame-btn">
 								{{if $row.PreviousSha}}
-									<a href="{{$row.PreviousShaURL}}" data-tooltip-content='{{$.locale.Tr "repo.blame_prior"}}'>
+									<a href="{{$row.PreviousShaURL}}" data-tooltip-content='{{ctx.Locale.Tr "repo.blame_prior"}}'>
 										{{svg "octicon-versions"}}
 									</a>
 								{{end}}
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl
index d47c9f9686..36d1b628c9 100644
--- a/templates/repo/branch/list.tmpl
+++ b/templates/repo/branch/list.tmpl
@@ -6,9 +6,9 @@
 		{{template "repo/sub_menu" .}}
 		{{if .DefaultBranchBranch}}
 			<h4 class="ui top attached header">
-				{{.locale.Tr "repo.default_branch"}}
+				{{ctx.Locale.Tr "repo.default_branch"}}
 				{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
-				<a role="button" class="right" href="{{.RepoLink}}/settings/branches" data-tooltip-content="{{.locale.Tr "repo.settings.branches.switch_default_branch"}}">
+				<a role="button" class="right" href="{{.RepoLink}}/settings/branches" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.branches.switch_default_branch"}}">
 					{{svg "octicon-arrow-switch"}}
 				</a>
 				{{end}}
@@ -27,7 +27,7 @@
 									<button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button>
 									{{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}
 								</div>
-								<p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}}</span> · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p>
+								<p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p>
 							</td>
 							<td class="right aligned middle aligned overflow-visible">
 								{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
@@ -35,7 +35,7 @@
 										data-modal="#create-branch-modal"
 										data-branch-from="{{$.DefaultBranchBranch.DBBranch.Name}}"
 										data-branch-from-urlcomponent="{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}"
-										data-tooltip-content="{{$.locale.Tr "repo.branch.new_branch_from" ($.DefaultBranchBranch.DBBranch.Name)}}"
+										data-tooltip-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" ($.DefaultBranchBranch.DBBranch.Name)}}"
 									>
 										{{svg "octicon-git-branch"}}
 									</button>
@@ -44,7 +44,7 @@
 									<a role="button" class="btn interact-bg gt-p-3" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-rss"}}</a>
 								{{end}}
 								{{if not $.DisableDownloadSourceArchives}}
-									<div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{$.locale.Tr "repo.branch.download" ($.DefaultBranchBranch.DBBranch.Name)}}">
+									<div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.download" ($.DefaultBranchBranch.DBBranch.Name)}}">
 										{{svg "octicon-download"}}
 										<div class="menu">
 											<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
@@ -57,7 +57,7 @@
 										data-is-default-branch="true"
 										data-modal="#rename-branch-modal"
 										data-old-branch-name="{{$.DefaultBranchBranch.DBBranch.Name}}"
-										data-tooltip-content="{{$.locale.Tr "repo.branch.rename" ($.DefaultBranchBranch.DBBranch.Name)}}"
+										data-tooltip-content="{{ctx.Locale.Tr "repo.branch.rename" ($.DefaultBranchBranch.DBBranch.Name)}}"
 									>
 										{{svg "octicon-pencil"}}
 									</button>
@@ -72,14 +72,14 @@
 		{{if .Branches}}
 			<h4 class="ui top attached header gt-df gt-ac gt-sb">
 				<div class="gt-df gt-ac">
-					{{.locale.Tr "repo.branches"}}
+					{{ctx.Locale.Tr "repo.branches"}}
 				</div>
 				<div class="gt-whitespace-nowrap">
 					<form class="ignore-dirty" method="get">
 						<div class="ui tiny search input">
-							<input name="q" placeholder="{{.locale.Tr "repo.branch.search"}}" value="{{.Keyword}}" autofocus>
+							<input name="q" placeholder="{{ctx.Locale.Tr "repo.branch.search"}}" value="{{.Keyword}}" autofocus>
 						</div>
-						<button class="ui primary tiny button gt-mr-0" data-tooltip-content={{.locale.Tr "repo.commits.search.tooltip"}}>{{.locale.Tr "repo.commits.find"}}</button>
+						<button class="ui primary tiny button gt-mr-0" data-tooltip-content={{ctx.Locale.Tr "repo.commits.search.tooltip"}}>{{ctx.Locale.Tr "repo.commits.find"}}</button>
 					</form>
 				</div>
 			</h4>
@@ -95,7 +95,7 @@
 										<a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a>
 										<button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button>
 									</div>
-									<p class="info">{{$.locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix $.locale}}</p>
+									<p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix ctx.Locale}}</p>
 								{{else}}
 									{{if .IsProtected}}
 										{{svg "octicon-shield-lock"}}
@@ -105,7 +105,7 @@
 										<button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button>
 										{{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}
 									</div>
-										<p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p>
+										<p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p>
 								{{end}}
 								</td>
 								<td class="two wide ui">
@@ -126,28 +126,28 @@
 								<td class="two wide right aligned">
 									{{if not .LatestPullRequest}}
 										{{if .IsIncluded}}
-											<span class="ui orange large label" data-tooltip-content="{{$.locale.Tr "repo.branch.included_desc"}}">
-												{{svg "octicon-git-pull-request"}} {{$.locale.Tr "repo.branch.included"}}
+											<span class="ui orange large label" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.included_desc"}}">
+												{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.branch.included"}}
 											</span>
 										{{else if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
 										<a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}">
-											<button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{$.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{$.locale.Tr "action.compare_branch"}}{{end}}</button>
+											<button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button>
 										</a>
 										{{end}}
 									{{else if and .LatestPullRequest.HasMerged .MergeMovedOn}}
 										{{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
 										<a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}">
-											<button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{$.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{$.locale.Tr "action.compare_branch"}}{{end}}</button>
+											<button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button>
 										</a>
 										{{end}}
 									{{else}}
 										<a href="{{.LatestPullRequest.Issue.Link}}" class="gt-vm ref-issue">{{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}}</a>
 										{{if .LatestPullRequest.HasMerged}}
-											<a href="{{.LatestPullRequest.Issue.Link}}" class="ui purple large label">{{svg "octicon-git-merge" 16 "gt-mr-2"}}{{$.locale.Tr "repo.pulls.merged"}}</a>
+											<a href="{{.LatestPullRequest.Issue.Link}}" class="ui purple large label">{{svg "octicon-git-merge" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.pulls.merged"}}</a>
 										{{else if .LatestPullRequest.Issue.IsClosed}}
-											<a href="{{.LatestPullRequest.Issue.Link}}" class="ui red large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.closed_title"}}</a>
+											<a href="{{.LatestPullRequest.Issue.Link}}" class="ui red large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.issues.closed_title"}}</a>
 										{{else}}
-											<a href="{{.LatestPullRequest.Issue.Link}}" class="ui green large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.open_title"}}</a>
+											<a href="{{.LatestPullRequest.Issue.Link}}" class="ui green large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.issues.open_title"}}</a>
 										{{end}}
 									{{end}}
 								</td>
@@ -156,7 +156,7 @@
 										<button class="btn interact-bg gt-p-3 show-modal show-create-branch-modal"
 											data-branch-from="{{.DBBranch.Name}}"
 											data-branch-from-urlcomponent="{{PathEscapeSegments .DBBranch.Name}}"
-											data-tooltip-content="{{$.locale.Tr "repo.branch.new_branch_from" .DBBranch.Name}}"
+											data-tooltip-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" .DBBranch.Name}}"
 											data-modal="#create-branch-modal" data-name="{{.DBBranch.Name}}"
 										>
 											{{svg "octicon-git-branch"}}
@@ -166,7 +166,7 @@
 										<a role="button" class="btn interact-bg gt-p-3" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .DBBranch.Name}}">{{svg "octicon-rss"}}</a>
 									{{end}}
 									{{if and (not .DBBranch.IsDeleted) (not $.DisableDownloadSourceArchives)}}
-										<div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{$.locale.Tr "repo.branch.download" (.DBBranch.Name)}}">
+										<div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.download" (.DBBranch.Name)}}">
 											{{svg "octicon-download"}}
 											<div class="menu">
 												<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
@@ -179,20 +179,20 @@
 											data-is-default-branch="false"
 											data-old-branch-name="{{.DBBranch.Name}}"
 											data-modal="#rename-branch-modal"
-											data-tooltip-content="{{$.locale.Tr "repo.branch.rename" (.DBBranch.Name)}}"
+											data-tooltip-content="{{ctx.Locale.Tr "repo.branch.rename" (.DBBranch.Name)}}"
 										>
 											{{svg "octicon-pencil"}}
 										</button>
 									{{end}}
 									{{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}}
 										{{if .DBBranch.IsDeleted}}
-											<button class="btn interact-bg gt-p-3 link-action restore-branch-button" data-url="{{$.Link}}/restore?branch_id={{.DBBranch.ID}}&name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{$.locale.Tr "repo.branch.restore" (.DBBranch.Name)}}">
+											<button class="btn interact-bg gt-p-3 link-action restore-branch-button" data-url="{{$.Link}}/restore?branch_id={{.DBBranch.ID}}&name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.restore" (.DBBranch.Name)}}">
 												<span class="text blue">
 													{{svg "octicon-reply"}}
 												</span>
 											</button>
 										{{else}}
-											<button class="btn interact-bg gt-p-3 delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{$.locale.Tr "repo.branch.delete" (.DBBranch.Name)}}" data-name="{{.DBBranch.Name}}">
+											<button class="btn interact-bg gt-p-3 delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.delete" (.DBBranch.Name)}}" data-name="{{.DBBranch.Name}}">
 												{{svg "octicon-trash"}}
 											</button>
 										{{end}}
@@ -211,28 +211,28 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.branch.delete_html"}} <span class="name"></span>
+		{{ctx.Locale.Tr "repo.branch.delete_html"}} <span class="name"></span>
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p>
+		<p>{{ctx.Locale.Tr "repo.branch.delete_desc" | Str2html}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
 
 <div class="ui mini modal" id="create-branch-modal">
 	<div class="header">
-		{{.locale.Tr "repo.branch.new_branch"}}
+		{{ctx.Locale.Tr "repo.branch.new_branch"}}
 	</div>
 
 	<form class="ui form" id="create-branch-form" action="" data-base-action="{{.Link}}/_new/branch/" method="post">
 		<div class="content">
 			{{.CsrfTokenHtml}}
 			<div class="field">
-				{{.locale.Tr "repo.branch.create_new_branch"}}
+				{{ctx.Locale.Tr "repo.branch.create_new_branch"}}
 				<span id="modal-create-branch-from-span"></span>
 			</div>
 			<div class="required field">
-				<label for="new_branch_name">{{.locale.Tr "repo.branch.name"}}</label>
+				<label for="new_branch_name">{{ctx.Locale.Tr "repo.branch.name"}}</label>
 				<input id="new_branch_name" name="new_branch_name" required>
 			</div>
 		</div>
@@ -242,16 +242,16 @@
 
 <div class="ui mini modal" id="rename-branch-modal">
 	<div class="header">
-		{{.locale.Tr "repo.settings.rename_branch"}}
+		{{ctx.Locale.Tr "repo.settings.rename_branch"}}
 	</div>
 	<form class="ui form" action="{{$.Repository.Link}}/settings/rename_branch" method="post">
 		<div class="content">
 			{{.CsrfTokenHtml}}
 			<div class="field default-branch-warning">
-				<span class="text red">{{.locale.Tr "repo.branch.warning_rename_default_branch"}}</span>
+				<span class="text red">{{ctx.Locale.Tr "repo.branch.warning_rename_default_branch"}}</span>
 			</div>
 			<div class="field">
-				<span class="text" data-rename-branch-to="{{.locale.Tr "repo.branch.rename_branch_to"}}"></span>
+				<span class="text" data-rename-branch-to="{{ctx.Locale.Tr "repo.branch.rename_branch_to"}}"></span>
 			</div>
 			<input name="from" type="hidden" required>
 			<div class="required field">
diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl
index d826eee4f6..bee5363296 100644
--- a/templates/repo/branch_dropdown.tmpl
+++ b/templates/repo/branch_dropdown.tmpl
@@ -24,17 +24,17 @@
 
 <script type="module">
 	const data = {
-		'textReleaseCompare': {{.root.locale.Tr "repo.release.compare"}},
-		'textCreateTag': {{.root.locale.Tr "repo.tag.create_tag"}},
-		'textCreateBranch': {{.root.locale.Tr "repo.branch.create_branch"}},
-		'textCreateBranchFrom': {{.root.locale.Tr "repo.branch.create_from"}},
-		'textBranches': {{.root.locale.Tr "repo.branches"}},
-		'textTags': {{.root.locale.Tr "repo.tags"}},
-		'textDefaultBranchLabel': {{.root.locale.Tr "repo.default_branch_label"}},
+		'textReleaseCompare': {{ctx.Locale.Tr "repo.release.compare"}},
+		'textCreateTag': {{ctx.Locale.Tr "repo.tag.create_tag"}},
+		'textCreateBranch': {{ctx.Locale.Tr "repo.branch.create_branch"}},
+		'textCreateBranchFrom': {{ctx.Locale.Tr "repo.branch.create_from"}},
+		'textBranches': {{ctx.Locale.Tr "repo.branches"}},
+		'textTags': {{ctx.Locale.Tr "repo.tags"}},
+		'textDefaultBranchLabel': {{ctx.Locale.Tr "repo.default_branch_label"}},
 
 		'mode': '{{if or .root.IsViewTag .isTag}}tags{{else}}branches{{end}}',
 		'showBranchesInDropdown': {{$showBranchesInDropdown}},
-		'searchFieldPlaceholder': '{{if $.noTag}}{{.root.locale.Tr "repo.pulls.filter_branch"}}{{else if $showBranchesInDropdown}}{{.root.locale.Tr "repo.filter_branch_and_tag"}}{{else}}{{.root.locale.Tr "repo.find_tag"}}{{end}}...',
+		'searchFieldPlaceholder': '{{if $.noTag}}{{ctx.Locale.Tr "repo.pulls.filter_branch"}}{{else if $showBranchesInDropdown}}{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}{{else}}{{ctx.Locale.Tr "repo.find_tag"}}{{end}}...',
 		'branchForm': {{$.branchForm}},
 		'disableCreateBranch': {{if .disableCreateBranch}}{{.disableCreateBranch}}{{else}}{{not .root.CanCreateBranch}}{{end}},
 		'setAction': {{.setAction}},
@@ -56,7 +56,7 @@
 		'repoLink': {{.root.RepoLink}},
 		'treePath': {{.root.TreePath}},
 		'branchNameSubURL': {{.root.BranchNameSubURL}},
-		'noResults': {{.root.locale.Tr "repo.pulls.no_results"}},
+		'noResults': {{ctx.Locale.Tr "repo.pulls.no_results"}},
 	};
 	{{if .release}}
 	data.release = {
@@ -73,7 +73,7 @@
 		<button class="branch-dropdown-button gt-ellipsis ui basic small compact button gt-df gt-m-0">
 			<span class="text gt-df gt-ac gt-mr-2">
 				{{if .release}}
-					{{.root.locale.Tr "repo.release.compare"}}
+					{{ctx.Locale.Tr "repo.release.compare"}}
 				{{else}}
 					{{if eq $type "tag"}}
 						{{svg "octicon-tag"}}
diff --git a/templates/repo/cite/cite_buttons.tmpl b/templates/repo/cite/cite_buttons.tmpl
index 6f9315249a..c0d3bf75f2 100644
--- a/templates/repo/cite/cite_buttons.tmpl
+++ b/templates/repo/cite/cite_buttons.tmpl
@@ -6,6 +6,6 @@ BibTeX
 </button>
 <!-- the value will be updated by initCitationFileCopyContent, the code below is used to avoid UI flicking  -->
 <input id="citation-copy-content" value="" size="1" readonly>
-<button class="ui basic icon button" id="citation-clipboard-btn" data-tooltip-content="{{.locale.Tr "copy"}}" data-clipboard-text="" data-clipboard-target="#citation-copy-content">
+<button class="ui basic icon button" id="citation-clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy"}}" data-clipboard-text="" data-clipboard-target="#citation-copy-content">
 	{{svg "octicon-copy"}}
 </button>
diff --git a/templates/repo/cite/cite_modal.tmpl b/templates/repo/cite/cite_modal.tmpl
index e296a1d6d3..c34c77e0c4 100644
--- a/templates/repo/cite/cite_modal.tmpl
+++ b/templates/repo/cite/cite_modal.tmpl
@@ -1,13 +1,13 @@
 <div class="ui tiny modal" id="cite-repo-modal">
 	<div class="header">
-		{{.locale.Tr "repo.cite_this_repo"}}
+		{{ctx.Locale.Tr "repo.cite_this_repo"}}
 	</div>
 	<div class="content">
 		<div class="ui stackable secondary menu">
 			<div class="fitted item">
 				<div class="ui action input" id="citation-panel">
 					{{template "repo/cite/cite_buttons" .}}
-					<a id="goto-citation-btn" class="ui basic jump icon button" href="{{$.RepoLink}}/src/{{$.BranchName}}/CITATION.cff" data-tooltip-content="{{.locale.Tr "repo.find_file.go_to_file"}}">
+					<a id="goto-citation-btn" class="ui basic jump icon button" href="{{$.RepoLink}}/src/{{$.BranchName}}/CITATION.cff" data-tooltip-content="{{ctx.Locale.Tr "repo.find_file.go_to_file"}}">
 						{{svg "octicon-file-moved"}}
 					</a>
 				</div>
@@ -16,7 +16,7 @@
 	</div>
 	<div class="actions">
 		<button class="ui cancel button">
-			{{.locale.Tr "cancel"}}
+			{{ctx.Locale.Tr "cancel"}}
 		</button>
 	</div>
 </div>
diff --git a/templates/repo/clone_buttons.tmpl b/templates/repo/clone_buttons.tmpl
index 9f008ff5d2..a664c4bda8 100644
--- a/templates/repo/clone_buttons.tmpl
+++ b/templates/repo/clone_buttons.tmpl
@@ -10,6 +10,6 @@
 	</button>
 {{end}}
 <input id="repo-clone-url" size="20" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly>
-<button class="ui basic small compact icon button" id="clipboard-btn" data-tooltip-content="{{.locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{.locale.Tr "copy_url"}}">
+<button class="ui basic small compact icon button" id="clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{ctx.Locale.Tr "copy_url"}}">
 	{{svg "octicon-copy" 14}}
 </button>
diff --git a/templates/repo/code/recently_pushed_new_branches.tmpl b/templates/repo/code/recently_pushed_new_branches.tmpl
index d460fd6852..8910a9e5b6 100644
--- a/templates/repo/code/recently_pushed_new_branches.tmpl
+++ b/templates/repo/code/recently_pushed_new_branches.tmpl
@@ -1,11 +1,11 @@
 {{range .RecentlyPushedNewBranches}}
 	<div class="ui positive message gt-df gt-ac">
 		<div class="gt-f1">
-			{{$timeSince := TimeSince .CommitTime.AsTime $.locale}}
-			{{$.locale.Tr "repo.pulls.recently_pushed_new_branches" (Escape .Name) $timeSince | Safe}}
+			{{$timeSince := TimeSince .CommitTime.AsTime ctx.Locale}}
+			{{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" (Escape .Name) $timeSince | Safe}}
 		</div>
 		<a role="button" class="ui compact positive button gt-m-0" href="{{$.Repository.ComposeBranchCompareURL $.Repository.BaseRepo .Name}}">
-			{{$.locale.Tr "repo.pulls.compare_changes"}}
+			{{ctx.Locale.Tr "repo.pulls.compare_changes"}}
 		</a>
 	</div>
 {{end}}
diff --git a/templates/repo/commit_load_branches_and_tags.tmpl b/templates/repo/commit_load_branches_and_tags.tmpl
index 4d90696cb4..6d5eb29d8a 100644
--- a/templates/repo/commit_load_branches_and_tags.tmpl
+++ b/templates/repo/commit_load_branches_and_tags.tmpl
@@ -1,12 +1,12 @@
 {{if not .PageIsWiki}}
-<div class="branch-and-tag-area" data-text-default-branch-tooltip="{{.locale.Tr "repo.commit.contained_in_default_branch"}}">
+<div class="branch-and-tag-area" data-text-default-branch-tooltip="{{ctx.Locale.Tr "repo.commit.contained_in_default_branch"}}">
 	<button class="ui button ellipsis-button load-branches-and-tags gt-mt-3" aria-expanded="false"
 		data-fetch-url="{{.RepoLink}}/commit/{{.CommitID}}/load-branches-and-tags"
-		data-tooltip-content="{{.locale.Tr "repo.commit.load_referencing_branches_and_tags"}}"
+		data-tooltip-content="{{ctx.Locale.Tr "repo.commit.load_referencing_branches_and_tags"}}"
 	>...</button>
 	<div class="branch-and-tag-detail gt-hidden">
 		<div class="divider"></div>
-		<div>{{.locale.Tr "repo.commit.contained_in"}}</div>
+		<div>{{ctx.Locale.Tr "repo.commit.contained_in"}}</div>
 		<div class="gt-df gt-mt-3">
 			<div class="gt-p-2">{{svg "octicon-git-branch"}}</div>
 			<div class="branch-area flex-text-block gt-f1"></div>
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl
index 1663e76a40..e0a63f3041 100644
--- a/templates/repo/commit_page.tmpl
+++ b/templates/repo/commit_page.tmpl
@@ -23,43 +23,43 @@
 				{{if not $.PageIsWiki}}
 					<div>
 						<a class="ui primary tiny button" href="{{.SourcePath}}">
-							{{.locale.Tr "repo.diff.browse_source"}}
+							{{ctx.Locale.Tr "repo.diff.browse_source"}}
 						</a>
 						{{if and ($.Permission.CanWrite $.UnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}}{{- /* */ -}}
 							<div class="ui dropdown primary tiny button">
-								{{.locale.Tr "repo.commit.operations"}}
+								{{ctx.Locale.Tr "repo.commit.operations"}}
 								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 								<div class="menu">
-									<div class="ui header">{{.locale.Tr "repo.commit.operations"}}</div>
+									<div class="ui header">{{ctx.Locale.Tr "repo.commit.operations"}}</div>
 									<div class="divider"></div>
 									<div class="item show-create-branch-modal"
-										data-content="{{$.locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}}
+										data-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}}
 										data-branch-from="{{ShortSha .CommitID}}"
 										data-branch-from-urlcomponent="{{.CommitID}}"
 										data-modal="#create-branch-modal">
-										{{.locale.Tr "repo.branch.create_branch_operation"}}
+										{{ctx.Locale.Tr "repo.branch.create_branch_operation"}}
 									</div>
 									<div class="item show-create-branch-modal"
-										data-content="{{$.locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}}
+										data-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" (.CommitID)}}" {{/* used by the form */}}
 										data-branch-from="{{ShortSha .CommitID}}"
 										data-branch-from-urlcomponent="{{.CommitID}}"
 										data-modal="#create-tag-modal"
 										data-modal-from-span="#modal-create-tag-from-span"
 										data-modal-form="#create-tag-form">
-										{{.locale.Tr "repo.tag.create_tag_operation"}}
+										{{ctx.Locale.Tr "repo.tag.create_tag_operation"}}
 									</div>
 									<div class="item show-modal revert-button"
 										data-modal="#cherry-pick-modal"
 										data-modal-cherry-pick-type="revert"
-										data-modal-cherry-pick-header="{{$.locale.Tr "repo.commit.revert-header" (ShortSha .CommitID)}}"
-										data-modal-cherry-pick-content="{{$.locale.Tr "repo.commit.revert-content"}}"
-										data-modal-cherry-pick-submit="{{.locale.Tr "repo.commit.revert"}}">{{.locale.Tr "repo.commit.revert"}}</div>
+										data-modal-cherry-pick-header="{{ctx.Locale.Tr "repo.commit.revert-header" (ShortSha .CommitID)}}"
+										data-modal-cherry-pick-content="{{ctx.Locale.Tr "repo.commit.revert-content"}}"
+										data-modal-cherry-pick-submit="{{ctx.Locale.Tr "repo.commit.revert"}}">{{ctx.Locale.Tr "repo.commit.revert"}}</div>
 									<div class="item cherry-pick-button show-modal"
 										data-modal="#cherry-pick-modal"
 										data-modal-cherry-pick-type="cherry-pick"
-										data-modal-cherry-pick-header="{{$.locale.Tr "repo.commit.cherry-pick-header" (ShortSha .CommitID)}}"
-										data-modal-cherry-pick-content="{{$.locale.Tr "repo.commit.cherry-pick-content"}}"
-										data-modal-cherry-pick-submit="{{.locale.Tr "repo.commit.cherry-pick"}}">{{.locale.Tr "repo.commit.cherry-pick"}}</div>
+										data-modal-cherry-pick-header="{{ctx.Locale.Tr "repo.commit.cherry-pick-header" (ShortSha .CommitID)}}"
+										data-modal-cherry-pick-content="{{ctx.Locale.Tr "repo.commit.cherry-pick-content"}}"
+										data-modal-cherry-pick-submit="{{ctx.Locale.Tr "repo.commit.cherry-pick"}}">{{ctx.Locale.Tr "repo.commit.cherry-pick"}}</div>
 									<div class="ui g-modal-confirm modal" id="cherry-pick-modal">
 										<div class="header">
 											<span id="cherry-pick-header"></span>
@@ -81,31 +81,31 @@
 									</div>
 									<div class="ui small modal" id="create-branch-modal">
 										<div class="header">
-											{{.locale.Tr "repo.branch.new_branch"}}
+											{{ctx.Locale.Tr "repo.branch.new_branch"}}
 										</div>
 										<div class="content">
 											<form class="ui form" id="create-branch-form" action="" data-base-action="{{.RepoLink}}/branches/_new/commit/" method="post">
 												{{.CsrfTokenHtml}}
 												<div class="field">
 													<label>
-														{{.locale.Tr "repo.branch.new_branch_from" "<span class=\"text\" id=\"modal-create-branch-from-span\"></span>" | Safe}}
+														{{ctx.Locale.Tr "repo.branch.new_branch_from" "<span class=\"text\" id=\"modal-create-branch-from-span\"></span>" | Safe}}
 													</label>
 												</div>
 												<div class="required field">
-													<label for="new_branch_name">{{.locale.Tr "repo.branch.name"}}</label>
+													<label for="new_branch_name">{{ctx.Locale.Tr "repo.branch.name"}}</label>
 													<input id="new_branch_name" name="new_branch_name" required>
 												</div>
 
 												<div class="text right actions">
-													<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
-													<button class="ui primary button">{{.locale.Tr "repo.branch.confirm_create_branch"}}</button>
+													<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+													<button class="ui primary button">{{ctx.Locale.Tr "repo.branch.confirm_create_branch"}}</button>
 												</div>
 											</form>
 										</div>
 									</div>
 									<div class="ui small modal" id="create-tag-modal">
 										<div class="header">
-											{{.locale.Tr "repo.tag.create_tag_operation"}}
+											{{ctx.Locale.Tr "repo.tag.create_tag_operation"}}
 										</div>
 										<div class="content">
 											<form class="ui form" id="create-tag-form" action="" data-base-action="{{.RepoLink}}/branches/_new/commit/" method="post">
@@ -113,17 +113,17 @@
 												<input type="hidden" name="create_tag" value="true">
 												<div class="field">
 													<label>
-														{{.locale.Tr "repo.tag.create_tag_from" "<span class=\"text\" id=\"modal-create-tag-from-span\"></span>" | Safe}}
+														{{ctx.Locale.Tr "repo.tag.create_tag_from" "<span class=\"text\" id=\"modal-create-tag-from-span\"></span>" | Safe}}
 													</label>
 												</div>
 												<div class="required field">
-													<label for="new_branch_name">{{.locale.Tr "repo.release.tag_name"}}</label>
+													<label for="new_branch_name">{{ctx.Locale.Tr "repo.release.tag_name"}}</label>
 													<input id="new_branch_name" name="new_branch_name" required>
 												</div>
 
 												<div class="text right actions">
-													<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
-													<button class="ui primary button">{{.locale.Tr "repo.tag.confirm_create_tag"}}</button>
+													<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+													<button class="ui primary button">{{ctx.Locale.Tr "repo.tag.confirm_create_tag"}}</button>
 												</div>
 											</form>
 										</div>
@@ -152,9 +152,9 @@
 						{{ctx.AvatarUtils.AvatarByEmail .Commit.Author.Email .Commit.Author.Email 28 "gt-mr-3"}}
 						<strong>{{.Commit.Author.Name}}</strong>
 					{{end}}
-					<span class="text grey gt-ml-3" id="authored-time">{{TimeSince .Commit.Author.When $.locale}}</span>
+					<span class="text grey gt-ml-3" id="authored-time">{{TimeSince .Commit.Author.When ctx.Locale}}</span>
 					{{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}}
-						<span class="text grey gt-mx-3">{{.locale.Tr "repo.diff.committed_by"}}</span>
+						<span class="text grey gt-mx-3">{{ctx.Locale.Tr "repo.diff.committed_by"}}</span>
 						{{if ne .Verification.CommittingUser.ID 0}}
 							{{ctx.AvatarUtils.Avatar .Verification.CommittingUser 28 "gt-mx-3"}}
 							<a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a>
@@ -167,7 +167,7 @@
 				<div class="ui horizontal list gt-df gt-ac">
 					{{if .Parents}}
 						<div class="item">
-							<span>{{.locale.Tr "repo.diff.parent"}}</span>
+							<span>{{ctx.Locale.Tr "repo.diff.parent"}}</span>
 							{{range .Parents}}
 								{{if $.PageIsWiki}}
 									<a class="ui primary sha label" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .}}">{{ShortSha .}}</a>
@@ -178,7 +178,7 @@
 						</div>
 					{{end}}
 					<div class="item">
-						<span>{{.locale.Tr "repo.diff.commit"}}</span>
+						<span>{{ctx.Locale.Tr "repo.diff.commit"}}</span>
 						<span class="ui primary sha label">{{ShortSha .CommitID}}</span>
 					</div>
 				</div>
@@ -190,23 +190,23 @@
 						{{if ne .Verification.SigningUser.ID 0}}
 							{{svg "gitea-lock" 16 "gt-mr-3"}}
 							{{if eq .Verification.TrustStatus "trusted"}}
-								<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by"}}:</span>
+								<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.signed_by"}}:</span>
 							{{else if eq .Verification.TrustStatus "untrusted"}}
-								<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by_untrusted_user"}}:</span>
+								<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user"}}:</span>
 							{{else}}
-								<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}:</span>
+								<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}:</span>
 							{{end}}
 							{{ctx.AvatarUtils.Avatar .Verification.SigningUser 28 "gt-mr-3"}}
 							<a href="{{.Verification.SigningUser.HomeLink}}"><strong>{{.Verification.SigningUser.GetDisplayName}}</strong></a>
 						{{else}}
-							<span title="{{.locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog" 16 "gt-mr-3"}}</span>
-							<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by"}}:</span>
+							<span title="{{ctx.Locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog" 16 "gt-mr-3"}}</span>
+							<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.signed_by"}}:</span>
 							{{ctx.AvatarUtils.AvatarByEmail .Verification.SigningEmail "" 28}}
 							<strong>{{.Verification.SigningUser.GetDisplayName}}</strong>
 						{{end}}
 					{{else}}
 						{{svg "gitea-unlock" 16 "gt-mr-3"}}
-						<span class="ui text">{{.locale.Tr .Verification.Reason}}</span>
+						<span class="ui text">{{ctx.Locale.Tr .Verification.Reason}}</span>
 					{{end}}
 				</div>
 				<div class="gt-df gt-ac">
@@ -214,43 +214,43 @@
 						{{if ne .Verification.SigningUser.ID 0}}
 							{{svg "octicon-verified" 16 "gt-mr-3"}}
 							{{if .Verification.SigningSSHKey}}
-								<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span>
+								<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span>
 								{{.Verification.SigningSSHKey.Fingerprint}}
 							{{else}}
-								<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.gpg_key_id"}}:</span>
+								<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span>
 								{{.Verification.SigningKey.PaddedKeyID}}
 							{{end}}
 						{{else}}
 							{{svg "octicon-unverified" 16 "gt-mr-3"}}
 							{{if .Verification.SigningSSHKey}}
-								<span class="ui text gt-mr-3" data-tooltip-content="{{.locale.Tr "gpg.default_key"}}">{{.locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span>
+								<span class="ui text gt-mr-3" data-tooltip-content="{{ctx.Locale.Tr "gpg.default_key"}}">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span>
 								{{.Verification.SigningSSHKey.Fingerprint}}
 							{{else}}
-								<span class="ui text gt-mr-3" data-tooltip-content="{{.locale.Tr "gpg.default_key"}}">{{.locale.Tr "repo.commits.gpg_key_id"}}:</span>
+								<span class="ui text gt-mr-3" data-tooltip-content="{{ctx.Locale.Tr "gpg.default_key"}}">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span>
 								{{.Verification.SigningKey.PaddedKeyID}}
 							{{end}}
 						{{end}}
 					{{else if .Verification.Warning}}
 						{{svg "octicon-unverified" 16 "gt-mr-3"}}
 						{{if .Verification.SigningSSHKey}}
-							<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span>
+							<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span>
 							{{.Verification.SigningSSHKey.Fingerprint}}
 						{{else}}
-							<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.gpg_key_id"}}:</span>
+							<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span>
 							{{.Verification.SigningKey.PaddedKeyID}}
 						{{end}}
 					{{else}}
 						{{if .Verification.SigningKey}}
 							{{if ne .Verification.SigningKey.KeyID ""}}
 								{{svg "octicon-verified" 16 "gt-mr-3"}}
-								<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.gpg_key_id"}}:</span>
+								<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.gpg_key_id"}}:</span>
 								{{.Verification.SigningKey.PaddedKeyID}}
 							{{end}}
 						{{end}}
 						{{if .Verification.SigningSSHKey}}
 							{{if ne .Verification.SigningSSHKey.Fingerprint ""}}
 								{{svg "octicon-verified" 16 "gt-mr-3"}}
-								<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span>
+								<span class="ui text gt-mr-3">{{ctx.Locale.Tr "repo.commits.ssh_key_fingerprint"}}:</span>
 								{{.Verification.SigningSSHKey.Fingerprint}}
 							{{end}}
 						{{end}}
@@ -261,7 +261,7 @@
 		{{if .Note}}
 			<div class="ui top attached header segment git-notes">
 				{{svg "octicon-note" 16 "gt-mr-3"}}
-				{{.locale.Tr "repo.diff.git-notes"}}:
+				{{ctx.Locale.Tr "repo.diff.git-notes"}}:
 				{{if .NoteAuthor}}
 					<a href="{{.NoteAuthor.HomeLink}}">
 						{{if .NoteAuthor.FullName}}
@@ -273,7 +273,7 @@
 				{{else}}
 					<strong>{{.NoteCommit.Author.Name}}</strong>
 				{{end}}
-				<span class="text grey" id="note-authored-time">{{TimeSince .NoteCommit.Author.When $.locale}}</span>
+				<span class="text grey" id="note-authored-time">{{TimeSince .NoteCommit.Author.When ctx.Locale}}</span>
 			</div>
 			<div class="ui bottom attached info segment git-notes">
 				<pre class="commit-body">{{RenderNote $.Context .Note $.RepoLink $.Repository.ComposeMetas}}</pre>
diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl
index 18bb78cb06..42004c2610 100644
--- a/templates/repo/commits.tmpl
+++ b/templates/repo/commits.tmpl
@@ -8,7 +8,7 @@
 				{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
 				<a href="{{.RepoLink}}/graph" class="ui basic small compact button">
 					{{svg "octicon-git-branch"}}
-					{{.locale.Tr "repo.commit_graph"}}
+					{{ctx.Locale.Tr "repo.commit_graph"}}
 				</a>
 			</div>
 		</div>
diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl
index 7ecbc8f884..9fb2788a45 100644
--- a/templates/repo/commits_list.tmpl
+++ b/templates/repo/commits_list.tmpl
@@ -2,10 +2,10 @@
 		<table class="ui very basic striped table unstackable" id="commits-table">
 			<thead>
 				<tr>
-					<th class="three wide">{{.locale.Tr "repo.commits.author"}}</th>
+					<th class="three wide">{{ctx.Locale.Tr "repo.commits.author"}}</th>
 					<th class="two wide sha">SHA1</th>
-					<th class="nine wide message">{{.locale.Tr "repo.commits.message"}}</th>
-					<th class="two wide right aligned">{{.locale.Tr "repo.commits.date"}}</th>
+					<th class="nine wide message">{{ctx.Locale.Tr "repo.commits.message"}}</th>
+					<th class="two wide right aligned">{{ctx.Locale.Tr "repo.commits.date"}}</th>
 				</tr>
 			</thead>
 			<tbody class="commit-list">
@@ -72,9 +72,9 @@
 							{{end}}
 						</td>
 						{{if .Committer}}
-							<td class="text right aligned">{{TimeSince .Committer.When $.locale}}</td>
+							<td class="text right aligned">{{TimeSince .Committer.When ctx.Locale}}</td>
 						{{else}}
-							<td class="text right aligned">{{TimeSince .Author.When $.locale}}</td>
+							<td class="text right aligned">{{TimeSince .Author.When ctx.Locale}}</td>
 						{{end}}
 					</tr>
 				{{end}}
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl
index 0670635baf..054a3f6bec 100644
--- a/templates/repo/commits_table.tmpl
+++ b/templates/repo/commits_table.tmpl
@@ -1,25 +1,25 @@
 <h4 class="ui top attached header commits-table gt-df gt-ac gt-sb">
 	<div class="commits-table-left gt-df gt-ac">
 		{{if or .PageIsCommits (gt .CommitCount 0)}}
-			{{.CommitCount}} {{.locale.Tr "repo.commits.commits"}}
+			{{.CommitCount}} {{ctx.Locale.Tr "repo.commits.commits"}}
 		{{else if .IsNothingToCompare}}
-			{{.locale.Tr "repo.commits.nothing_to_compare"}}
+			{{ctx.Locale.Tr "repo.commits.nothing_to_compare"}}
 		{{else}}
-			{{.locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}}
+			{{ctx.Locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}}
 		{{end}}
 	</div>
 	<div class="commits-table-right gt-whitespace-nowrap">
 		{{if .PageIsCommits}}
 			<form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/search">
 				<div class="ui tiny search input">
-					<input name="q" placeholder="{{.locale.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus>
+					<input name="q" placeholder="{{ctx.Locale.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus>
 				</div>
 
 				<div class="ui tiny checkbox">
 					<input type="checkbox" name="all" value="true" {{.All}}>
-					<label>{{.locale.Tr "repo.commits.search_all"}}</label>
+					<label>{{ctx.Locale.Tr "repo.commits.search_all"}}</label>
 				</div>
-				<button class="ui primary tiny button gt-mr-0" data-panel="#add-deploy-key-panel" data-tooltip-content={{.locale.Tr "repo.commits.search.tooltip"}}>{{.locale.Tr "repo.commits.find"}}</button>
+				<button class="ui primary tiny button gt-mr-0" data-panel="#add-deploy-key-panel" data-tooltip-content={{ctx.Locale.Tr "repo.commits.search.tooltip"}}>{{ctx.Locale.Tr "repo.commits.find"}}</button>
 			</form>
 		{{else if .IsDiffCompare}}
 			<a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID | PathEscape}}" class="ui green sha label gt-mx-0">{{if not .BaseIsCommit}}{{if .BaseIsBranch}}{{svg "octicon-git-branch"}}{{else if .BaseIsTag}}{{svg "octicon-tag"}}{{end}}{{.BaseBranch}}{{else}}{{ShortSha .BaseBranch}}{{end}}</a>
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl
index 4125cb9c8f..7b2e51130f 100644
--- a/templates/repo/create.tmpl
+++ b/templates/repo/create.tmpl
@@ -5,7 +5,7 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "new_repo"}}
+					{{ctx.Locale.Tr "new_repo"}}
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
@@ -13,11 +13,11 @@
 
 					{{if not .CanCreateRepo}}
 						<div class="ui negative message">
-							<p>{{.locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}</p>
+							<p>{{ctx.Locale.TrN .MaxCreationLimit "repo.form.reach_limit_of_creation_1" "repo.form.reach_limit_of_creation_n" .MaxCreationLimit}}</p>
 						</div>
 					{{end}}
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -38,33 +38,33 @@
 								{{end}}
 							</div>
 						</div>
-						<span class="help">{{.locale.Tr "repo.owner_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "repo.owner_helper"}}</span>
 					</div>
 
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" autofocus required maxlength="100">
-						<span class="help">{{.locale.Tr "repo.repo_name_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "repo.repo_name_helper"}}</span>
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui checkbox">
 							{{if .IsForcedPrivate}}
 								<input name="private" type="checkbox" checked readonly>
-								<label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
 							{{else}}
 								<input name="private" type="checkbox" {{if .private}}checked{{end}}>
-								<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 							{{end}}
 						</div>
-						<span class="help">{{.locale.Tr "repo.visibility_description"}}</span>
+						<span class="help">{{ctx.Locale.Tr "repo.visibility_description"}}</span>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
-						<textarea id="description" name="description" placeholder="{{.locale.Tr "repo.repo_desc_helper"}}" maxlength="2048">{{.description}}</textarea>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
+						<textarea id="description" name="description" placeholder="{{ctx.Locale.Tr "repo.repo_desc_helper"}}" maxlength="2048">{{.description}}</textarea>
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.template"}}</label>
+						<label>{{ctx.Locale.Tr "repo.template"}}</label>
 						<div id="repo_template_search" class="ui search normal selection dropdown">
 							<input type="hidden" id="repo_template" name="repo_template" value="{{.repo_template}}">
 							<div class="default text">{{.repo_template_name}}</div>
@@ -75,55 +75,55 @@
 
 					<div id="template_units" class="gt-hidden">
 						<div class="inline field">
-							<label>{{.locale.Tr "repo.template.items"}}</label>
+							<label>{{ctx.Locale.Tr "repo.template.items"}}</label>
 							<div class="ui checkbox">
 								<input name="git_content" type="checkbox" {{if .git_content}}checked{{end}}>
-								<label>{{.locale.Tr "repo.template.git_content"}}</label>
+								<label>{{ctx.Locale.Tr "repo.template.git_content"}}</label>
 							</div>
-							<div class="ui checkbox" {{if not .SignedUser.CanEditGitHook}}data-tooltip-content="{{.locale.Tr "repo.template.git_hooks_tooltip"}}"{{end}}>
+							<div class="ui checkbox" {{if not .SignedUser.CanEditGitHook}}data-tooltip-content="{{ctx.Locale.Tr "repo.template.git_hooks_tooltip"}}"{{end}}>
 								<input name="git_hooks" type="checkbox" {{if .git_hooks}}checked{{end}}>
-								<label>{{.locale.Tr "repo.template.git_hooks"}}</label>
+								<label>{{ctx.Locale.Tr "repo.template.git_hooks"}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="webhooks" type="checkbox" {{if .webhooks}}checked{{end}}>
-								<label>{{.locale.Tr "repo.template.webhooks"}}</label>
+								<label>{{ctx.Locale.Tr "repo.template.webhooks"}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="topics" type="checkbox" {{if .topics}}checked{{end}}>
-								<label>{{.locale.Tr "repo.template.topics"}}</label>
+								<label>{{ctx.Locale.Tr "repo.template.topics"}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="avatar" type="checkbox" {{if .avatar}}checked{{end}}>
-								<label>{{.locale.Tr "repo.template.avatar"}}</label>
+								<label>{{ctx.Locale.Tr "repo.template.avatar"}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="labels" type="checkbox" {{if .labels}}checked{{end}}>
-								<label>{{.locale.Tr "repo.template.issue_labels"}}</label>
+								<label>{{ctx.Locale.Tr "repo.template.issue_labels"}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="protected_branch" type="checkbox" {{if .protected_branch}}checked{{end}}>
-								<label>{{.locale.Tr "repo.settings.protected_branch"}}</label>
+								<label>{{ctx.Locale.Tr "repo.settings.protected_branch"}}</label>
 							</div>
 						</div>
 					</div>
 
 					<div id="non_template">
 						<div class="inline field">
-							<label>{{.locale.Tr "repo.issue_labels"}}</label>
+							<label>{{ctx.Locale.Tr "repo.issue_labels"}}</label>
 							<div class="ui search normal selection dropdown">
 								<input type="hidden" name="issue_labels" value="{{.issueLabels}}">
-								<div class="default text">{{.locale.Tr "repo.issue_labels_helper"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.issue_labels_helper"}}</div>
 								<div class="menu">
-									<div class="item" data-value="">{{.locale.Tr "repo.issue_labels_helper"}}</div>
+									<div class="item" data-value="">{{ctx.Locale.Tr "repo.issue_labels_helper"}}</div>
 									{{range .LabelTemplateFiles}}
 										<div class="item" data-value="{{.DisplayName}}">{{.DisplayName}}<br><i>({{.Description}})</i></div>
 									{{end}}
@@ -137,82 +137,82 @@
 							<label>.gitignore</label>
 							<div class="ui multiple search normal selection dropdown">
 								<input type="hidden" name="gitignores" value="{{.gitignores}}">
-								<div class="default text">{{.locale.Tr "repo.repo_gitignore_helper"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.repo_gitignore_helper"}}</div>
 								<div class="menu">
 									{{range .Gitignores}}
 										<div class="item" data-value="{{.}}">{{.}}</div>
 									{{end}}
 								</div>
 							</div>
-							<span class="help">{{.locale.Tr "repo.repo_gitignore_helper_desc"}}</span>
+							<span class="help">{{ctx.Locale.Tr "repo.repo_gitignore_helper_desc"}}</span>
 						</div>
 						<div class="inline field">
-							<label>{{.locale.Tr "repo.license"}}</label>
+							<label>{{ctx.Locale.Tr "repo.license"}}</label>
 							<div class="ui search selection dropdown">
 								<input type="hidden" name="license" value="{{.license}}">
-								<div class="default text">{{.locale.Tr "repo.license_helper"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.license_helper"}}</div>
 								<div class="menu">
-									<div class="item" data-value="">{{.locale.Tr "repo.license_helper"}}</div>
+									<div class="item" data-value="">{{ctx.Locale.Tr "repo.license_helper"}}</div>
 									{{range .Licenses}}
 										<div class="item" data-value="{{.}}">{{.}}</div>
 									{{end}}
 								</div>
 							</div>
-							<span class="help">{{.locale.Tr "repo.license_helper_desc" "https://choosealicense.com/" | Str2html}}</span>
+							<span class="help">{{ctx.Locale.Tr "repo.license_helper_desc" "https://choosealicense.com/" | Str2html}}</span>
 						</div>
 
 						<div class="inline field">
-							<label>{{.locale.Tr "repo.readme"}}</label>
+							<label>{{ctx.Locale.Tr "repo.readme"}}</label>
 							<div class="ui selection dropdown">
 								<input type="hidden" name="readme" value="{{.readme}}">
-								<div class="default text">{{.locale.Tr "repo.readme_helper"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.readme_helper"}}</div>
 								<div class="menu">
 									{{range .Readmes}}
 										<div class="item" data-value="{{.}}">{{.}}</div>
 									{{end}}
 								</div>
 							</div>
-							<span class="help">{{.locale.Tr "repo.readme_helper_desc"}}</span>
+							<span class="help">{{ctx.Locale.Tr "repo.readme_helper_desc"}}</span>
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox" id="auto-init">
 								<input name="auto_init" type="checkbox" {{if .auto_init}}checked{{end}}>
-								<label>{{.locale.Tr "repo.auto_init"}}</label>
+								<label>{{ctx.Locale.Tr "repo.auto_init"}}</label>
 							</div>
 						</div>
 						<div class="inline field">
-							<label for="default_branch">{{.locale.Tr "repo.default_branch"}}</label>
+							<label for="default_branch">{{ctx.Locale.Tr "repo.default_branch"}}</label>
 							<input id="default_branch" name="default_branch" value="{{.default_branch}}" placeholder="{{.default_branch}}">
-							<span class="help">{{.locale.Tr "repo.default_branch_helper"}}</span>
+							<span class="help">{{ctx.Locale.Tr "repo.default_branch_helper"}}</span>
 						</div>
 						<div class="inline field">
-							<label>{{.locale.Tr "repo.settings.trust_model"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.trust_model"}}</label>
 							<div class="ui selection owner dropdown">
 								<input type="hidden" id="trust_model" name="trust_model" value="default" required>
-								<div class="default text">{{.locale.Tr "repo.settings.trust_model"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.settings.trust_model"}}</div>
 								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 								<div class="menu">
-									<div class="item" data-value="default">{{.locale.Tr "repo.settings.trust_model.default"}}</div>
-									<div class="item" data-value="collaborator">{{.locale.Tr "repo.settings.trust_model.collaborator"}}</div>
-									<div class="item" data-value="committer">{{.locale.Tr "repo.settings.trust_model.committer"}}</div>
-									<div class="item" data-value="collaboratorcommitter">{{.locale.Tr "repo.settings.trust_model.collaboratorcommitter"}}</div>
+									<div class="item" data-value="default">{{ctx.Locale.Tr "repo.settings.trust_model.default"}}</div>
+									<div class="item" data-value="collaborator">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator"}}</div>
+									<div class="item" data-value="committer">{{ctx.Locale.Tr "repo.settings.trust_model.committer"}}</div>
+									<div class="item" data-value="collaboratorcommitter">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter"}}</div>
 								</div>
 							</div>
 							<div class="help">
-								{{.locale.Tr "repo.trust_model_helper"}}
+								{{ctx.Locale.Tr "repo.trust_model_helper"}}
 								<ul>
-									<li>{{.locale.Tr "repo.trust_model_helper_collaborator"}}</li>
-									<li>{{.locale.Tr "repo.trust_model_helper_committer"}}</li>
-									<li>{{.locale.Tr "repo.trust_model_helper_collaborator_committer"}}</li>
-									<li>{{.locale.Tr "repo.trust_model_helper_default"}}</li>
+									<li>{{ctx.Locale.Tr "repo.trust_model_helper_collaborator"}}</li>
+									<li>{{ctx.Locale.Tr "repo.trust_model_helper_committer"}}</li>
+									<li>{{ctx.Locale.Tr "repo.trust_model_helper_collaborator_committer"}}</li>
+									<li>{{ctx.Locale.Tr "repo.trust_model_helper_default"}}</li>
 								</ul>
 							</div>
 						</div>
 						<div class="inline field">
-							<label>{{.locale.Tr "repo.template"}}</label>
+							<label>{{ctx.Locale.Tr "repo.template"}}</label>
 							<div class="ui checkbox">
 								<input name="template" type="checkbox">
-								<label>{{.locale.Tr "repo.template_helper"}}</label>
+								<label>{{ctx.Locale.Tr "repo.template_helper"}}</label>
 							</div>
 						</div>
 					</div>
@@ -221,7 +221,7 @@
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button{{if not .CanCreateRepo}} disabled{{end}}">
-							{{.locale.Tr "repo.create_repo"}}
+							{{ctx.Locale.Tr "repo.create_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/create_helper.tmpl b/templates/repo/create_helper.tmpl
index 4b91cdf075..653955efc9 100644
--- a/templates/repo/create_helper.tmpl
+++ b/templates/repo/create_helper.tmpl
@@ -1,3 +1,3 @@
 {{if not $.DisableMigrations}}
-	<p class="ui center">{{.locale.Tr "repo.new_repo_helper" ((print AppSubUrl "/repo/migrate")|Escape) | Safe}}</p>
+	<p class="ui center">{{ctx.Locale.Tr "repo.new_repo_helper" ((print AppSubUrl "/repo/migrate")|Escape) | Safe}}</p>
 {{end}}
diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl
index feb2aa5738..2dff28a965 100644
--- a/templates/repo/diff/blob_excerpt.tmpl
+++ b/templates/repo/diff/blob_excerpt.tmpl
@@ -21,10 +21,10 @@
 				{{end}}
 				</div>
 			</td>
-			<td colspan="7" class="lines-code lines-code-old ">{{$inlineDiff := $.section.GetComputedInlineDiffFor $line $.locale}}{{/*
+			<td colspan="7" class="lines-code lines-code-old ">{{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}{{/*
 				*/}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}</td>
 		{{else}}
-			{{$inlineDiff := $.section.GetComputedInlineDiffFor $line $.locale}}
+			{{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}
 			<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$.FileNameHash}}L{{$line.LeftIdx}}{{end}}"></span></td>
 			<td class="blob-excerpt lines-escape lines-escape-old">{{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td>
 			<td class="blob-excerpt lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="gt-mono" data-type-marker=""></span>{{end}}</td>
@@ -71,7 +71,7 @@
 			<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$.FileNameHash}}L{{$line.LeftIdx}}{{end}}"></span></td>
 			<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{$.FileNameHash}}R{{$line.RightIdx}}{{end}}"></span></td>
 		{{end}}
-		{{$inlineDiff := $.section.GetComputedInlineDiffFor $line $.locale}}
+		{{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}
 		<td class="blob-excerpt lines-escape">{{if $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td>
 		<td class="blob-excerpt lines-type-marker"><span class="gt-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
 		<td class="blob-excerpt lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}"><code {{if $inlineDiff.EscapeStatus.Escaped}}class="code-inner has-escaped" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"{{else}}class="code-inner"{{end}}>{{$inlineDiff.Content}}</code></td>
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl
index ff3fc7aef7..15766363e7 100644
--- a/templates/repo/diff/box.tmpl
+++ b/templates/repo/diff/box.tmpl
@@ -2,7 +2,7 @@
 	<div class="diff-detail-box diff-box sticky gt-df gt-sb gt-ac">
 		<div class="gt-df gt-ac gt-fw">
 			{{if not .DiffNotAvailable}}
-				<button class="diff-toggle-file-tree-button gt-df gt-ac not-mobile" data-show-text="{{.locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{.locale.Tr "repo.diff.hide_file_tree"}}">
+				<button class="diff-toggle-file-tree-button gt-df gt-ac not-mobile" data-show-text="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{ctx.Locale.Tr "repo.diff.hide_file_tree"}}">
 					{{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}}
 					{{svg "octicon-sidebar-collapse" 20 "icon gt-hidden"}}
 					{{svg "octicon-sidebar-expand" 20 "icon gt-hidden"}}
@@ -16,15 +16,15 @@
 					diffTreeBtn.setAttribute('data-tooltip-content', diffTreeBtn.getAttribute(diffTreeVisible ? 'data-hide-text' : 'data-show-text'));
 				</script>
 				<div class="diff-detail-stats gt-df gt-ac gt-fw">
-					{{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
+					{{svg "octicon-diff" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
 				</div>
 			{{end}}
 		</div>
 		<div class="diff-detail-actions">
 			{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}}
 				<div class="gt-df gt-ac gt-fc gt-whitespace-nowrap gt-mr-2">
-					<label for="viewed-files-summary" id="viewed-files-summary-label" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}">
-						{{.locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}}
+					<label for="viewed-files-summary" id="viewed-files-summary-label" data-text-changed-template="{{ctx.Locale.Tr "repo.pulls.viewed_files_label"}}">
+						{{ctx.Locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}}
 					</label>
 					<progress id="viewed-files-summary" value="{{.Diff.NumViewedFiles}}" max="{{.Diff.NumFiles}}"></progress>
 				</div>
@@ -32,7 +32,7 @@
 			{{template "repo/diff/whitespace_dropdown" .}}
 			{{template "repo/diff/options_dropdown" .}}
 			{{if .PageIsPullFiles}}
-				<div id="diff-commit-select" data-issuelink="{{$.Issue.Link}}" data-queryparams="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-filter_changes_by_commit="{{.locale.Tr "repo.pulls.filter_changes_by_commit"}}">
+				<div id="diff-commit-select" data-issuelink="{{$.Issue.Link}}" data-queryparams="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-filter_changes_by_commit="{{ctx.Locale.Tr "repo.pulls.filter_changes_by_commit"}}">
 					{{/*
 						the following will be replaced by vue component
 						but this avoids any loading artifacts till the vue component is initialized
@@ -50,21 +50,21 @@
 	{{if not .DiffNotAvailable}}
 		{{if and .IsShowingOnlySingleCommit .PageIsPullFiles}}
 			<div class="ui info message">
-				<div>{{.locale.Tr "repo.pulls.showing_only_single_commit" (ShortSha .BeforeCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{.locale.Tr "repo.pulls.show_all_commits"}}</a></div>
+				<div>{{ctx.Locale.Tr "repo.pulls.showing_only_single_commit" (ShortSha .BeforeCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{ctx.Locale.Tr "repo.pulls.show_all_commits"}}</a></div>
 			</div>
 		{{else if and (not .IsShowingAllCommits) .PageIsPullFiles}}
 			<div class="ui info message">
-				<div>{{.locale.Tr "repo.pulls.showing_specified_commit_range" (ShortSha .BeforeCommitID) (ShortSha .AfterCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{.locale.Tr "repo.pulls.show_all_commits"}}</a></div>
+				<div>{{ctx.Locale.Tr "repo.pulls.showing_specified_commit_range" (ShortSha .BeforeCommitID) (ShortSha .AfterCommitID)}} - <a href="{{$.Issue.Link}}/files?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}">{{ctx.Locale.Tr "repo.pulls.show_all_commits"}}</a></div>
 			</div>
 		{{end}}
 		<script id="diff-data-script" type="module">
 			const diffDataFiles = [{{range $i, $file := .Diff.Files}}{Name:"{{$file.Name}}",NameHash:"{{$file.NameHash}}",Type:{{$file.Type}},IsBin:{{$file.IsBin}},Addition:{{$file.Addition}},Deletion:{{$file.Deletion}},IsViewed:{{$file.IsViewed}}},{{end}}];
 			const diffData = {
 				isIncomplete: {{.Diff.IsIncomplete}},
-				tooManyFilesMessage: "{{$.locale.Tr "repo.diff.too_many_files"}}",
-				binaryFileMessage: "{{$.locale.Tr "repo.diff.bin"}}",
-				showMoreMessage: "{{.locale.Tr "repo.diff.show_more"}}",
-				statisticsMessage: "{{.locale.Tr "repo.diff.stats_desc_file"}}",
+				tooManyFilesMessage: "{{ctx.Locale.Tr "repo.diff.too_many_files"}}",
+				binaryFileMessage: "{{ctx.Locale.Tr "repo.diff.bin"}}",
+				showMoreMessage: "{{ctx.Locale.Tr "repo.diff.show_more"}}",
+				statisticsMessage: "{{ctx.Locale.Tr "repo.diff.stats_desc_file"}}",
 				linkLoadMore: "{{$.Link}}?skip-to={{.Diff.End}}&file-only=true",
 			};
 
@@ -86,7 +86,7 @@
 	{{end}}
 	<div id="diff-container">
 		{{if .DiffNotAvailable}}
-			<h4>{{.locale.Tr "repo.diff.data_not_available"}}</h4>
+			<h4>{{ctx.Locale.Tr "repo.diff.data_not_available"}}</h4>
 		{{else}}
 			<div id="diff-file-tree" class="gt-hidden"></div>
 			<script>
@@ -115,55 +115,55 @@
 								<div class="gt-font-semibold gt-df gt-ac gt-mono">
 									{{if $file.IsBin}}
 										<span class="gt-ml-1 gt-mr-3">
-											{{$.locale.Tr "repo.diff.bin"}}
+											{{ctx.Locale.Tr "repo.diff.bin"}}
 										</span>
 									{{else}}
 										{{template "repo/diff/stats" dict "file" . "root" $}}
 									{{end}}
 								</div>
-								<span class="file gt-mono"><a class="muted file-link" title="{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}" href="#diff-{{$file.NameHash}}">{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}</a>{{if .IsLFSFile}} ({{$.locale.Tr "repo.stored_lfs"}}){{end}}</span>
+								<span class="file gt-mono"><a class="muted file-link" title="{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}" href="#diff-{{$file.NameHash}}">{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}</a>{{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}}</span>
 								<button class="btn interact-fg gt-p-3" data-clipboard-text="{{$file.Name}}">{{svg "octicon-copy" 14}}</button>
 								{{if $file.IsGenerated}}
-									<span class="ui label">{{$.locale.Tr "repo.diff.generated"}}</span>
+									<span class="ui label">{{ctx.Locale.Tr "repo.diff.generated"}}</span>
 								{{end}}
 								{{if $file.IsVendored}}
-									<span class="ui label">{{$.locale.Tr "repo.diff.vendored"}}</span>
+									<span class="ui label">{{ctx.Locale.Tr "repo.diff.vendored"}}</span>
 								{{end}}
 								{{if and $file.Mode $file.OldMode}}
-									{{$old := $.locale.Tr ($file.ModeTranslationKey $file.OldMode)}}
-									{{$new := $.locale.Tr ($file.ModeTranslationKey $file.Mode)}}
-									<span class="gt-ml-4 gt-mono">{{$.locale.Tr "git.filemode.changed_filemode" $old $new}}</span>
+									{{$old := ctx.Locale.Tr ($file.ModeTranslationKey $file.OldMode)}}
+									{{$new := ctx.Locale.Tr ($file.ModeTranslationKey $file.Mode)}}
+									<span class="gt-ml-4 gt-mono">{{ctx.Locale.Tr "git.filemode.changed_filemode" $old $new}}</span>
 								{{else if $file.Mode}}
-									<span class="gt-ml-4 gt-mono">{{$.locale.Tr ($file.ModeTranslationKey $file.Mode)}}</span>
+									<span class="gt-ml-4 gt-mono">{{ctx.Locale.Tr ($file.ModeTranslationKey $file.Mode)}}</span>
 								{{end}}
 							</div>
 							<div class="diff-file-header-actions gt-df gt-ac gt-gap-2 gt-fw">
 								{{if $showFileViewToggle}}
 									<div class="ui compact icon buttons">
-										<button class="ui tiny basic button file-view-toggle" data-toggle-selector="#diff-source-{{$file.NameHash}}" data-tooltip-content="{{$.locale.Tr "repo.file_view_source"}}">{{svg "octicon-code"}}</button>
-										<button class="ui tiny basic button file-view-toggle active" data-toggle-selector="#diff-rendered-{{$file.NameHash}}" data-tooltip-content="{{$.locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file"}}</button>
+										<button class="ui tiny basic button file-view-toggle" data-toggle-selector="#diff-source-{{$file.NameHash}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_source"}}">{{svg "octicon-code"}}</button>
+										<button class="ui tiny basic button file-view-toggle active" data-toggle-selector="#diff-rendered-{{$file.NameHash}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file"}}</button>
 									</div>
 								{{end}}
 								{{if $file.IsProtected}}
-									<span class="ui basic label">{{$.locale.Tr "repo.diff.protected"}}</span>
+									<span class="ui basic label">{{ctx.Locale.Tr "repo.diff.protected"}}</span>
 								{{end}}
 								{{if and $isReviewFile $file.HasChangedSinceLastReview}}
-									<span class="changed-since-last-review unselectable not-mobile">{{$.locale.Tr "repo.pulls.has_changed_since_last_review"}}</span>
+									<span class="changed-since-last-review unselectable not-mobile">{{ctx.Locale.Tr "repo.pulls.has_changed_since_last_review"}}</span>
 								{{end}}
 								{{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}}
-									<button class="ui basic tiny button unescape-button not-mobile">{{$.locale.Tr "repo.unescape_control_characters"}}</button>
-									<button class="ui basic tiny button escape-button gt-hidden">{{$.locale.Tr "repo.escape_control_characters"}}</button>
+									<button class="ui basic tiny button unescape-button not-mobile">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
+									<button class="ui basic tiny button escape-button gt-hidden">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
 								{{end}}
 								{{if and (not $file.IsSubmodule) (not $.PageIsWiki)}}
 									{{if $file.IsDeleted}}
-										<a class="ui basic tiny button" rel="nofollow" href="{{$.BeforeSourcePath}}/{{PathEscapeSegments .Name}}">{{$.locale.Tr "repo.diff.view_file"}}</a>
+										<a class="ui basic tiny button" rel="nofollow" href="{{$.BeforeSourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
 									{{else}}
-										<a class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{$.locale.Tr "repo.diff.view_file"}}</a>
+										<a class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
 									{{end}}
 								{{end}}
 								{{if $isReviewFile}}
 									<label data-link="{{$.Issue.Link}}/viewed-files" data-headcommit="{{$.AfterCommitID}}" class="viewed-file-form unselectable{{if $file.IsViewed}} viewed-file-checked-form{{end}}">
-										<input type="checkbox" name="{{$file.GetDiffFileName}}" autocomplete="off"{{if $file.IsViewed}} checked{{end}}> {{$.locale.Tr "repo.pulls.has_viewed_file"}}
+										<input type="checkbox" name="{{$file.GetDiffFileName}}" autocomplete="off"{{if $file.IsViewed}} checked{{end}}> {{ctx.Locale.Tr "repo.pulls.has_viewed_file"}}
 									</label>
 								{{end}}
 							</div>
@@ -174,13 +174,13 @@
 									<div class="diff-file-body binary" style="padding: 5px 10px;">
 										{{if $file.IsIncomplete}}
 											{{if $file.IsIncompleteLineTooLong}}
-												{{$.locale.Tr "repo.diff.file_suppressed_line_too_long"}}
+												{{ctx.Locale.Tr "repo.diff.file_suppressed_line_too_long"}}
 											{{else}}
-												{{$.locale.Tr "repo.diff.file_suppressed"}}
-												<a class="ui basic tiny button diff-load-button" data-href="{{$.Link}}?file-only=true&files={{$file.Name}}&files={{$file.OldName}}">{{$.locale.Tr "repo.diff.load"}}</a>
+												{{ctx.Locale.Tr "repo.diff.file_suppressed"}}
+												<a class="ui basic tiny button diff-load-button" data-href="{{$.Link}}?file-only=true&files={{$file.Name}}&files={{$file.OldName}}">{{ctx.Locale.Tr "repo.diff.load"}}</a>
 											{{end}}
 										{{else}}
-											{{$.locale.Tr "repo.diff.bin_not_shown"}}
+											{{ctx.Locale.Tr "repo.diff.bin_not_shown"}}
 										{{end}}
 									</div>
 								{{else}}
@@ -212,8 +212,8 @@
 				{{if .Diff.IsIncomplete}}
 					<div class="diff-file-box diff-box file-content gt-mt-3" id="diff-incomplete">
 						<h4 class="ui top attached normal header gt-df gt-ac gt-sb">
-							{{$.locale.Tr "repo.diff.too_many_files"}}
-							<a class="ui basic tiny button" id="diff-show-more-files" data-href="{{$.Link}}?skip-to={{.Diff.End}}&file-only=true">{{.locale.Tr "repo.diff.show_more"}}</a>
+							{{ctx.Locale.Tr "repo.diff.too_many_files"}}
+							<a class="ui basic tiny button" id="diff-show-more-files" data-href="{{$.Link}}?skip-to={{.Diff.End}}&file-only=true">{{ctx.Locale.Tr "repo.diff.show_more"}}</a>
 						</h4>
 					</div>
 				{{end}}
@@ -231,8 +231,8 @@
 					"DropzoneParentContainer" ".ui.form"
 				)}}
 				<div class="text right edit buttons">
-					<button class="ui cancel button" tabindex="3">{{.locale.Tr "repo.issues.cancel"}}</button>
-					<button class="ui primary save button" tabindex="2">{{.locale.Tr "repo.issues.save"}}</button>
+					<button class="ui cancel button" tabindex="3">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
+					<button class="ui primary save button" tabindex="2">{{ctx.Locale.Tr "repo.issues.save"}}</button>
 				</div>
 			</div>
 		</template>
diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl
index 13dd91143c..767c2613a0 100644
--- a/templates/repo/diff/comment_form.tmpl
+++ b/templates/repo/diff/comment_form.tmpl
@@ -14,7 +14,7 @@
 			"MarkdownPreviewUrl" (print $.root.Repository.Link "/markup")
 			"MarkdownPreviewContext" $.root.RepoLink
 			"TextareaName" "content"
-			"TextareaPlaceholder" ($.locale.Tr "repo.diff.comment.placeholder")
+			"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder")
 			"DropzoneParentContainer" "form"
 			"DisableAutosize" "true"
 		)}}
diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl
index 0ca8f436d2..1e9af5c4a1 100644
--- a/templates/repo/diff/comments.tmpl
+++ b/templates/repo/diff/comments.tmpl
@@ -1,6 +1,6 @@
 {{range .comments}}
 
-{{$createdStr:= TimeSinceUnix .CreatedUnix $.root.locale}}
+{{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
 <div class="comment" id="{{.HashTag}}">
 	{{if .OriginalAuthor}}
 		<span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl
index 4d57fd6148..ebeae39222 100644
--- a/templates/repo/diff/compare.tmpl
+++ b/templates/repo/diff/compare.tmpl
@@ -5,10 +5,10 @@
 	<div class="ui container">
 	<h2 class="ui header">
 		{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
-			{{.locale.Tr "repo.pulls.compare_changes"}}
-			<div class="sub header">{{.locale.Tr "repo.pulls.compare_changes_desc"}}</div>
+			{{ctx.Locale.Tr "repo.pulls.compare_changes"}}
+			<div class="sub header">{{ctx.Locale.Tr "repo.pulls.compare_changes_desc"}}</div>
 		{{else}}
-			{{.locale.Tr "action.compare_commits_general"}}
+			{{ctx.Locale.Tr "action.compare_commits_general"}}
 		{{end}}
 	</h2>
 	{{if .Flash.WarningMsg}}
@@ -36,28 +36,28 @@
 		{{- end -}}
 	{{- end -}}
 	<div class="ui segment choose branch">
-		<a href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{.locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
-		<div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}">
+		<a href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
+		<div class="ui floating filter dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}">
 			<div class="ui basic small button">
-				<span class="text">{{if $.PageIsComparePull}}{{.locale.Tr "repo.pulls.compare_base"}}{{else}}{{.locale.Tr "repo.compare.compare_base"}}{{end}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span>
+				<span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_base"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_base"}}{{end}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 			</div>
 			<div class="menu">
 				<div class="ui icon search input">
 					<i class="icon">{{svg "octicon-filter" 16}}</i>
-					<input name="search" placeholder="{{.locale.Tr "repo.filter_branch_and_tag"}}...">
+					<input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
 				</div>
 				<div class="header">
 					<div class="ui grid">
 						<div class="two column row">
 							<a class="reference column" href="#" data-target=".base-branch-list">
 								<span class="text black">
-									{{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.locale.Tr "repo.branches"}}
+									{{svg "octicon-git-branch" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.branches"}}
 								</span>
 							</a>
 							<a class="reference column" href="#" data-target=".base-tag-list">
 								<span class="text black">
-									{{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.tags"}}
+									{{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.tags"}}
 								</span>
 							</a>
 						</div>
@@ -105,28 +105,28 @@
 				</div>
 			</div>
 		</div>
-		<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{.locale.Tr "repo.pulls.switch_comparison_type"}}">{{.CompareSeparator}}</a>
+		<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_comparison_type"}}">{{.CompareSeparator}}</a>
 		<div class="ui floating filter dropdown">
 			<div class="ui basic small button">
-				<span class="text">{{if $.PageIsComparePull}}{{.locale.Tr "repo.pulls.compare_compare"}}{{else}}{{.locale.Tr "repo.compare.compare_head"}}{{end}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span>
+				<span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_compare"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_head"}}{{end}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 			</div>
 			<div class="menu">
 				<div class="ui icon search input">
 					<i class="icon">{{svg "octicon-filter" 16}}</i>
-					<input name="search" placeholder="{{.locale.Tr "repo.filter_branch_and_tag"}}...">
+					<input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
 				</div>
 				<div class="header">
 					<div class="ui grid">
 						<div class="two column row">
 							<a class="reference column" href="#" data-target=".head-branch-list">
 								<span class="text black">
-									{{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.locale.Tr "repo.branches"}}
+									{{svg "octicon-git-branch" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.branches"}}
 								</span>
 							</a>
 							<a class="reference column" href="#" data-target=".head-tag-list">
 								<span class="text black">
-									{{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.tags"}}
+									{{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.tags"}}
 								</span>
 							</a>
 						</div>
@@ -178,21 +178,21 @@
 
 	{{if .IsNothingToCompare}}
 		{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived)}}
-			<div class="ui segment">{{.locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
+			<div class="ui segment">{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
 			<div class="ui info message show-form-container {{if .Flash}}gt-hidden{{end}}">
-				<button class="ui button primary show-form">{{.locale.Tr "repo.pulls.new"}}</button>
+				<button class="ui button primary show-form">{{ctx.Locale.Tr "repo.pulls.new"}}</button>
 			</div>
 			<div class="pullrequest-form {{if not .Flash}}gt-hidden{{end}}">
 				{{template "repo/issue/new_form" .}}
 			</div>
 		{{else}}
-			<div class="ui segment">{{.locale.Tr "repo.pulls.nothing_to_compare"}}</div>
+			<div class="ui segment">{{ctx.Locale.Tr "repo.pulls.nothing_to_compare"}}</div>
 		{{end}}
 	{{else if and .PageIsComparePull (gt .CommitCount 0)}}
 		{{if .HasPullRequest}}
 			<div class="ui segment grid title">
 				<div class="twelve wide column issue-title">
-					{{.locale.Tr "repo.pulls.has_pull_request" (print (Escape $.RepoLink) "/pulls/" .PullRequest.Issue.Index) (Escape $.RepoRelPath) .PullRequest.Index | Safe}}
+					{{ctx.Locale.Tr "repo.pulls.has_pull_request" (print (Escape $.RepoLink) "/pulls/" .PullRequest.Issue.Index) (Escape $.RepoRelPath) .PullRequest.Index | Safe}}
 					<h1>
 						<span id="issue-title">{{RenderIssueTitle $.Context .PullRequest.Issue.Title $.RepoLink $.Repository.ComposeMetas}}</span>
 						<span class="index">#{{.PullRequest.Issue.Index}}</span>
@@ -200,25 +200,25 @@
 				</div>
 				<div class="four wide column middle aligned text right">
 				{{- if .PullRequest.HasMerged -}}
-				<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button purple show-form">{{svg "octicon-git-merge" 16}} {{.locale.Tr "repo.pulls.view"}}</a>
+				<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button purple show-form">{{svg "octicon-git-merge" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a>
 				{{else if .Issue.IsClosed}}
-				<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{.locale.Tr "repo.pulls.view"}}</a>
+				<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a>
 				{{else}}
-				<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button primary show-form">{{svg "octicon-git-pull-request" 16}} {{.locale.Tr "repo.pulls.view"}}</a>
+				<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button primary show-form">{{svg "octicon-git-pull-request" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a>
 				{{end}}
 				</div>
 			</div>
 		{{else}}
 			{{if and $.IsSigned (not .Repository.IsArchived)}}
 				<div class="ui info message show-form-container {{if .Flash}}gt-hidden{{end}}">
-					<button class="ui button primary show-form">{{.locale.Tr "repo.pulls.new"}}</button>
+					<button class="ui button primary show-form">{{ctx.Locale.Tr "repo.pulls.new"}}</button>
 				</div>
 			{{else if .Repository.IsArchived}}
 				<div class="ui warning message gt-text-center">
 					{{if .Repository.ArchivedUnix.IsZero}}
-						{{.locale.Tr "repo.archive.title"}}
+						{{ctx.Locale.Tr "repo.archive.title"}}
 					{{else}}
-						{{.locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}}
+						{{ctx.Locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}}
 					{{end}}
 				</div>
 			{{end}}
diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl
index c6ada10caf..feca7b6c0b 100644
--- a/templates/repo/diff/conversation.tmpl
+++ b/templates/repo/diff/conversation.tmpl
@@ -8,25 +8,25 @@
 		<div class="ui attached header resolved-placeholder gt-df gt-ac gt-sb">
 			<div class="ui grey text gt-df gt-ac gt-fw gt-gap-2">
 				{{svg "octicon-check" 16 "icon gt-mr-2"}}
-				<b>{{$resolveDoer.Name}}</b> {{$.locale.Tr "repo.issues.review.resolved_by"}}
+				<b>{{$resolveDoer.Name}}</b> {{ctx.Locale.Tr "repo.issues.review.resolved_by"}}
 				{{if $invalid}}
 					<!--
 					We only handle the case $resolved=true and $invalid=true in this template because if the comment is not resolved it has the outdated label in the comments area (not the header above).
 					The case $resolved=false and $invalid=true is handled in repo/diff/comments.tmpl
 					-->
-					<a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{$.locale.Tr "repo.issues.review.outdated_description"}}">
-						{{$.locale.Tr "repo.issues.review.outdated"}}
+					<a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
+						{{ctx.Locale.Tr "repo.issues.review.outdated"}}
 					</a>
 				{{end}}
 			</div>
 			<div class="gt-df gt-ac gt-gap-3">
 				<button id="show-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="ui tiny labeled button show-outdated gt-df gt-ac">
 					{{svg "octicon-unfold" 16 "gt-mr-3"}}
-					{{$.locale.Tr "repo.issues.review.show_resolved"}}
+					{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
 				</button>
 				<button id="hide-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="ui tiny labeled button hide-outdated gt-df gt-ac gt-hidden">
 					{{svg "octicon-fold" 16 "gt-mr-3"}}
-					{{$.locale.Tr "repo.issues.review.hide_resolved"}}
+					{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
 				</button>
 			</div>
 		</div>
@@ -40,24 +40,24 @@
 		<div class="gt-df gt-je gt-ac gt-fw gt-mt-3">
 			<div class="ui buttons gt-mr-2">
 				<button class="ui icon tiny basic button previous-conversation">
-					{{svg "octicon-arrow-up" 12 "icon"}} {{$.locale.Tr "repo.issues.previous"}}
+					{{svg "octicon-arrow-up" 12 "icon"}} {{ctx.Locale.Tr "repo.issues.previous"}}
 				</button>
 				<button class="ui icon tiny basic button next-conversation">
-					{{svg "octicon-arrow-down" 12 "icon"}} {{$.locale.Tr "repo.issues.next"}}
+					{{svg "octicon-arrow-down" 12 "icon"}} {{ctx.Locale.Tr "repo.issues.next"}}
 				</button>
 			</div>
 			{{if and $.CanMarkConversation $isNotPending}}
 				<button class="ui icon tiny basic button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
 					{{if $resolved}}
-						{{$.locale.Tr "repo.issues.review.un_resolve_conversation"}}
+						{{ctx.Locale.Tr "repo.issues.review.un_resolve_conversation"}}
 					{{else}}
-						{{$.locale.Tr "repo.issues.review.resolve_conversation"}}
+						{{ctx.Locale.Tr "repo.issues.review.resolve_conversation"}}
 					{{end}}
 				</button>
 			{{end}}
 			{{if and $.SignedUserID (not $.Repository.IsArchived)}}
 				<button class="comment-form-reply ui primary tiny labeled icon button gt-ml-2 gt-mr-0">
-					{{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{$.locale.Tr "repo.diff.comment.reply"}}
+					{{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.comment.reply"}}
 				</button>
 			{{end}}
 		</div>
diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl
index bd461d2800..8abce9479e 100644
--- a/templates/repo/diff/image_diff.tmpl
+++ b/templates/repo/diff/image_diff.tmpl
@@ -4,10 +4,10 @@
 		<div class="image-diff" data-path-before="{{.root.BeforeRawPath}}/{{PathEscapeSegments .file.OldName}}" data-path-after="{{.root.RawPath}}/{{PathEscapeSegments .file.Name}}">
 			<div class="ui secondary pointing tabular top attached borderless menu new-menu">
 				<div class="new-menu-inner">
-					<a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a>
+					<a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.side_by_side"}}</a>
 					{{if and .blobBase .blobHead}}
-					<a class="item" data-tab="diff-swipe-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.swipe"}}</a>
-					<a class="item" data-tab="diff-overlay-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.overlay"}}</a>
+					<a class="item" data-tab="diff-swipe-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.swipe"}}</a>
+					<a class="item" data-tab="diff-overlay-{{.file.Index}}">{{ctx.Locale.Tr "repo.diff.image.overlay"}}</a>
 					{{end}}
 				</div>
 			</div>
@@ -16,31 +16,31 @@
 					<div class="diff-side-by-side">
 						{{if .blobBase}}
 						<span class="side">
-							<p class="side-header">{{.root.locale.Tr "repo.diff.file_before"}}</p>
+							<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_before"}}</p>
 							<span class="before-container"><img class="image-before"></span>
 							<p>
 								<span class="bounds-info-before">
-									{{.root.locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
+									{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
 									&nbsp;|&nbsp;
-									{{.root.locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span>
+									{{ctx.Locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span>
 									&nbsp;|&nbsp;
 								</span>
-								{{.root.locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobBase.Size}}</span>
+								{{ctx.Locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobBase.Size}}</span>
 							</p>
 						</span>
 						{{end}}
 						{{if .blobHead}}
 						<span class="side">
-							<p class="side-header">{{.root.locale.Tr "repo.diff.file_after"}}</p>
+							<p class="side-header">{{ctx.Locale.Tr "repo.diff.file_after"}}</p>
 							<span class="after-container"><img class="image-after"></span>
 							<p>
 								<span class="bounds-info-after">
-									{{.root.locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
+									{{ctx.Locale.Tr "repo.diff.file_image_width"}}: <span class="text bounds-info-width"></span>
 									&nbsp;|&nbsp;
-									{{.root.locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span>
+									{{ctx.Locale.Tr "repo.diff.file_image_height"}}: <span class="text bounds-info-height"></span>
 									&nbsp;|&nbsp;
 								</span>
-								{{.root.locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobHead.Size}}</span>
+								{{ctx.Locale.Tr "repo.diff.file_byte_size"}}: <span class="text">{{FileSize .blobHead.Size}}</span>
 							</p>
 						</span>
 						{{end}}
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl
index 6cdd625790..ae7182c930 100644
--- a/templates/repo/diff/new_review.tmpl
+++ b/templates/repo/diff/new_review.tmpl
@@ -1,6 +1,6 @@
 <div id="review-box">
-	<button class="ui tiny primary button gt-pr-2 gt-df js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{$.locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}>
-		{{.locale.Tr "repo.diff.review"}}
+	<button class="ui tiny primary button gt-pr-2 gt-df js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}>
+		{{ctx.Locale.Tr "repo.diff.review"}}
 		<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
 		{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 	</button>
@@ -11,7 +11,7 @@
 				{{.CsrfTokenHtml}}
 				<input type="hidden" name="commit_id" value="{{.AfterCommitID}}">
 				<div class="field gt-df gt-ac">
-					<div class="gt-f1">{{$.locale.Tr "repo.diff.review.header"}}</div>
+					<div class="gt-f1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div>
 					<a class="muted close">{{svg "octicon-x" 16}}</a>
 				</div>
 				<div class="field">
@@ -19,7 +19,7 @@
 						"MarkdownPreviewUrl" (print .Repository.Link "/markup")
 						"MarkdownPreviewContext" .RepoLink
 						"TextareaName" "content"
-						"TextareaPlaceholder" ($.locale.Tr "repo.diff.review.placeholder")
+						"TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder")
 						"DropzoneParentContainer" "form"
 					)}}
 				</div>
@@ -31,19 +31,19 @@
 				<div class="divider"></div>
 				{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}}
 				{{if $showSelfTooltip}}
-					<span class="gt-dib" data-tooltip-content="{{$.locale.Tr "repo.diff.review.self_approve"}}">
-						<button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
+					<span class="gt-dib" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}">
+						<button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button>
 					</span>
 				{{else}}
-					<button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
+					<button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button>
 				{{end}}
-				<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button>
+				<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button>
 				{{if $showSelfTooltip}}
-					<span class="gt-dib" data-tooltip-content="{{$.locale.Tr "repo.diff.review.self_reject"}}">
-						<button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
+					<span class="gt-dib" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}">
+						<button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button>
 					</span>
 				{{else}}
-					<button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
+					<button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button>
 				{{end}}
 			</form>
 		</div>
diff --git a/templates/repo/diff/options_dropdown.tmpl b/templates/repo/diff/options_dropdown.tmpl
index 172e674770..3bcb877cc6 100644
--- a/templates/repo/diff/options_dropdown.tmpl
+++ b/templates/repo/diff/options_dropdown.tmpl
@@ -1,30 +1,30 @@
-<div class="ui dropdown tiny basic button" data-tooltip-content="{{.locale.Tr "repo.diff.options_button"}}">
+<div class="ui dropdown tiny basic button" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.options_button"}}">
 	{{svg "octicon-kebab-horizontal"}}
 	<div class="menu">
-		<a class="item" id="show-file-list-btn">{{.locale.Tr "repo.diff.show_diff_stats"}}</a>
+		<a class="item" id="show-file-list-btn">{{ctx.Locale.Tr "repo.diff.show_diff_stats"}}</a>
 		{{if .Issue.Index}}
-			<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{.locale.Tr "repo.diff.download_patch"}}</a>
-			<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{.locale.Tr "repo.diff.download_diff"}}</a>
+			<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.patch" download="{{.Issue.Index}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
+			<a class="item" href="{{$.RepoLink}}/pulls/{{.Issue.Index}}.diff" download="{{.Issue.Index}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
 		{{else if $.PageIsWiki}}
-			<a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{.locale.Tr "repo.diff.download_patch"}}</a>
-			<a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{.locale.Tr "repo.diff.download_diff"}}</a>
+			<a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
+			<a class="item" href="{{$.RepoLink}}/wiki/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
 		{{else if .Commit.ID.String}}
-			<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{.locale.Tr "repo.diff.download_patch"}}</a>
-			<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{.locale.Tr "repo.diff.download_diff"}}</a>
+			<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.patch" download="{{ShortSha .Commit.ID.String}}.patch">{{ctx.Locale.Tr "repo.diff.download_patch"}}</a>
+			<a class="item" href="{{$.RepoLink}}/commit/{{PathEscape .Commit.ID.String}}.diff" download="{{ShortSha .Commit.ID.String}}.diff">{{ctx.Locale.Tr "repo.diff.download_diff"}}</a>
 		{{end}}
-		<a id="expand-files-btn" class="item">{{.locale.Tr "repo.pulls.expand_files"}}</a>
-		<a id="collapse-files-btn"class="item">{{.locale.Tr "repo.pulls.collapse_files"}}</a>
+		<a id="expand-files-btn" class="item">{{ctx.Locale.Tr "repo.pulls.expand_files"}}</a>
+		<a id="collapse-files-btn"class="item">{{ctx.Locale.Tr "repo.pulls.collapse_files"}}</a>
 		{{if .Issue.Index}}
 			{{if .ShowOutdatedComments}}
 				<a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=false">
 					<label class="gt-pointer-events-none">
-						{{.locale.Tr "repo.issues.review.option.hide_outdated_comments"}}
+						{{ctx.Locale.Tr "repo.issues.review.option.hide_outdated_comments"}}
 					</label>
 				</a>
 			{{else}}
 				<a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=true">
 					<label class="gt-pointer-events-none">
-						{{.locale.Tr "repo.issues.review.option.show_outdated_comments"}}
+						{{ctx.Locale.Tr "repo.issues.review.option.show_outdated_comments"}}
 					</label>
 				</a>
 			{{end}}
diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl
index c870b1c267..94dea4ac41 100644
--- a/templates/repo/diff/section_split.tmpl
+++ b/templates/repo/diff/section_split.tmpl
@@ -33,15 +33,15 @@
 							</button>
 						{{end}}
 						</div>
-					</td>{{$inlineDiff := $section.GetComputedInlineDiffFor $line $.root.locale}}
+					</td>{{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale}}
 					<td class="lines-escape lines-escape-old">{{if $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td>
 					<td colspan="6" class="lines-code lines-code-old ">{{/*
 						*/}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{/*
 					*/}}</td>
 				{{else if and (eq .GetType 3) $hasmatch}}{{/* DEL */}}
 					{{$match := index $section.Lines $line.Match}}
-					{{- $leftDiff := ""}}{{if $line.LeftIdx}}{{$leftDiff = $section.GetComputedInlineDiffFor $line $.root.locale}}{{end}}
-					{{- $rightDiff := ""}}{{if $match.RightIdx}}{{$rightDiff = $section.GetComputedInlineDiffFor $match $.root.locale}}{{end}}
+					{{- $leftDiff := ""}}{{if $line.LeftIdx}}{{$leftDiff = $section.GetComputedInlineDiffFor $line ctx.Locale}}{{end}}
+					{{- $rightDiff := ""}}{{if $match.RightIdx}}{{$rightDiff = $section.GetComputedInlineDiffFor $match ctx.Locale}}{{end}}
 					<td class="lines-num lines-num-old del-code" data-line-num="{{$line.LeftIdx}}"><span rel="diff-{{$file.NameHash}}L{{$line.LeftIdx}}"></span></td>
 					<td class="lines-escape del-code lines-escape-old">{{if $line.LeftIdx}}{{if $leftDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $leftDiff}}"></button>{{end}}{{end}}</td>
 					<td class="lines-type-marker lines-type-marker-old del-code"><span class="gt-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
@@ -73,7 +73,7 @@
 						*/}}{{end}}{{/*
 					*/}}</td>
 				{{else}}
-					{{$inlineDiff := $section.GetComputedInlineDiffFor $line $.root.locale}}
+					{{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale}}
 					<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$file.NameHash}}L{{$line.LeftIdx}}{{end}}"></span></td>
 					<td class="lines-escape lines-escape-old">{{if $line.LeftIdx}}{{if $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}{{end}}</td>
 					<td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="gt-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span>{{end}}</td>
diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl
index 3a4dc601a2..d2345c3b88 100644
--- a/templates/repo/diff/section_unified.tmpl
+++ b/templates/repo/diff/section_unified.tmpl
@@ -38,7 +38,7 @@
 				<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{$file.NameHash}}L{{$line.LeftIdx}}{{end}}"></span></td>
 				<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{$file.NameHash}}R{{$line.RightIdx}}{{end}}"></span></td>
 			{{end}}
-			{{$inlineDiff := $section.GetComputedInlineDiffFor $line $.root.locale -}}
+			{{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale -}}
 			<td class="lines-escape">
 				{{- if $inlineDiff.EscapeStatus.Escaped -}}
 					<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>
diff --git a/templates/repo/diff/stats.tmpl b/templates/repo/diff/stats.tmpl
index ff7e90d29c..db468ab6c8 100644
--- a/templates/repo/diff/stats.tmpl
+++ b/templates/repo/diff/stats.tmpl
@@ -1,5 +1,5 @@
 {{Eval .file.Addition "+" .file.Deletion}}
-<span class="diff-stats-bar gt-mx-3" data-tooltip-content="{{.root.locale.Tr "repo.diff.stats_desc_file" (Eval .file.Addition "+" .file.Deletion) .file.Addition .file.Deletion | Str2html}}">
+<span class="diff-stats-bar gt-mx-3" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.stats_desc_file" (Eval .file.Addition "+" .file.Deletion) .file.Addition .file.Deletion | Str2html}}">
 	{{/* if the denominator is zero, then the float result is "width: NaNpx", as before, it just works */}}
 	<div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .file.Addition "/" "(" .file.Addition "+" .file.Deletion "+" 0.0 ")"}}%"></div>
 </span>
diff --git a/templates/repo/diff/whitespace_dropdown.tmpl b/templates/repo/diff/whitespace_dropdown.tmpl
index a1830cb288..7bf2ac9aec 100644
--- a/templates/repo/diff/whitespace_dropdown.tmpl
+++ b/templates/repo/diff/whitespace_dropdown.tmpl
@@ -1,30 +1,30 @@
-<div class="ui dropdown tiny basic button" data-tooltip-content="{{.locale.Tr "repo.diff.whitespace_button"}}">
+<div class="ui dropdown tiny basic button" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.whitespace_button"}}">
 	{{svg "gitea-whitespace"}}
 	<div class="menu">
 		<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all&show-outdated={{$.ShowOutdatedComments}}">
 			<label class="gt-pointer-events-none">
 				<input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "show-all"}} checked{{end}}>
-				{{.locale.Tr "repo.diff.whitespace_show_everything"}}
+				{{ctx.Locale.Tr "repo.diff.whitespace_show_everything"}}
 			</label>
 		</a>
 		<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all&show-outdated={{$.ShowOutdatedComments}}">
 			<label class="gt-pointer-events-none">
 				<input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-all"}} checked{{end}}>
-				{{.locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}}
+				{{ctx.Locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}}
 			</label>
 		</a>
 		<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change&show-outdated={{$.ShowOutdatedComments}}">
 			<label class="gt-pointer-events-none">
 				<input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-change"}} checked{{end}}>
-				{{.locale.Tr "repo.diff.whitespace_ignore_amount_changes"}}
+				{{ctx.Locale.Tr "repo.diff.whitespace_ignore_amount_changes"}}
 			</label>
 		</a>
 		<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol&show-outdated={{$.ShowOutdatedComments}}">
 			<label class="gt-pointer-events-none">
 				<input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-eol"}} checked{{end}}>
-				{{.locale.Tr "repo.diff.whitespace_ignore_at_eol"}}
+				{{ctx.Locale.Tr "repo.diff.whitespace_ignore_at_eol"}}
 			</label>
 		</a>
 	</div>
 </div>
-<a class="ui tiny basic button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-tooltip-content="{{if .IsSplitStyle}}{{.locale.Tr "repo.diff.show_unified_view"}}{{else}}{{.locale.Tr "repo.diff.show_split_view"}}{{end}}">{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}}</a>
+<a class="ui tiny basic button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated={{$.ShowOutdatedComments}}" data-tooltip-content="{{if .IsSplitStyle}}{{ctx.Locale.Tr "repo.diff.show_unified_view"}}{{else}}{{ctx.Locale.Tr "repo.diff.show_split_view"}}{{end}}">{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}}</a>
diff --git a/templates/repo/editor/cherry_pick.tmpl b/templates/repo/editor/cherry_pick.tmpl
index 59948f2837..ab2c3c3349 100644
--- a/templates/repo/editor/cherry_pick.tmpl
+++ b/templates/repo/editor/cherry_pick.tmpl
@@ -13,14 +13,14 @@
 					{{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}}
 					{{$shalink := printf `<a class="ui primary sha label" href="%s">%s</a>` (Escape $shaurl) (ShortSha .SHA)}}
 					{{if eq .CherryPickType "revert"}}
-						{{.locale.Tr "repo.editor.revert" $shalink | Str2html}}
+						{{ctx.Locale.Tr "repo.editor.revert" $shalink | Str2html}}
 					{{else}}
-						{{.locale.Tr "repo.editor.cherry_pick" $shalink | Str2html}}
+						{{ctx.Locale.Tr "repo.editor.cherry_pick" $shalink | Str2html}}
 					{{end}}
 					<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
 					<div class="breadcrumb-divider">:</div>
 					<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
-					<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
+					<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$shaurl}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
 				</div>
 			</div>
 			{{template "repo/editor/commit_form" .}}
diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl
index dd6537e1a0..34dde576a1 100644
--- a/templates/repo/editor/commit_form.tmpl
+++ b/templates/repo/editor/commit_form.tmpl
@@ -2,37 +2,37 @@
 	{{ctx.AvatarUtils.Avatar .SignedUser 48 "commit-avatar"}}
 	<div class="commit-form">
 		<h3>{{- if .CanCommitToBranch.WillSign}}
-			<span title="{{.locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span>
-			{{.locale.Tr "repo.editor.commit_signed_changes"}}
+			<span title="{{ctx.Locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span>
+			{{ctx.Locale.Tr "repo.editor.commit_signed_changes"}}
 		{{- else}}
-			<span title="{{.locale.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span>
-			{{.locale.Tr "repo.editor.commit_changes"}}
+			<span title="{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span>
+			{{ctx.Locale.Tr "repo.editor.commit_changes"}}
 		{{- end}}</h3>
 		<div class="field">
-			<input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{.locale.Tr "repo.editor.patch"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
+			<input name="commit_summary" placeholder="{{if .PageIsDelete}}{{ctx.Locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{ctx.Locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{ctx.Locale.Tr "repo.editor.patch"}}{{else}}{{ctx.Locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
 		</div>
 		<div class="field">
-			<textarea name="commit_message" placeholder="{{.locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
+			<textarea name="commit_message" placeholder="{{ctx.Locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
 		</div>
 		<div class="inline field">
 			<div class="ui checkbox">
 				<input name="signoff" type="checkbox">
-				<label>{{.locale.Tr "repo.editor.signoff_desc"}}</label>
+				<label>{{ctx.Locale.Tr "repo.editor.signoff_desc"}}</label>
 			</div>
 		</div>
 		<div class="quick-pull-choice js-quick-pull-choice">
 			<div class="field">
 				<div class="ui radio checkbox {{if not .CanCommitToBranch.CanCommitToBranch}}disabled{{end}}">
-					<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{.locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}>
+					<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}>
 					<label>
 						{{svg "octicon-git-commit"}}
-						{{.locale.Tr "repo.editor.commit_directly_to_this_branch" (.BranchName|Escape) | Safe}}
+						{{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" (.BranchName|Escape) | Safe}}
 						{{if not .CanCommitToBranch.CanCommitToBranch}}
 						<div class="ui visible small warning message">
-							{{.locale.Tr "repo.editor.no_commit_to_branch"}}
+							{{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}}
 							<ul>
-								{{if not .CanCommitToBranch.UserCanPush}}<li>{{.locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}}
-								{{if and .CanCommitToBranch.RequireSigned (not .CanCommitToBranch.WillSign)}}<li>{{.locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}}
+								{{if not .CanCommitToBranch.UserCanPush}}<li>{{ctx.Locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}}
+								{{if and .CanCommitToBranch.RequireSigned (not .CanCommitToBranch.WillSign)}}<li>{{ctx.Locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}}
 							</ul>
 						</div>
 						{{end}}
@@ -43,16 +43,16 @@
 			<div class="field">
 				<div class="ui radio checkbox">
 					{{if .CanCreatePullRequest}}
-						<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{.locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
+						<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
 					{{else}}
-						<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{.locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
+						<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
 					{{end}}
 					<label>
 						{{svg "octicon-git-pull-request"}}
 						{{if .CanCreatePullRequest}}
-							{{.locale.Tr "repo.editor.create_new_branch" | Safe}}
+							{{ctx.Locale.Tr "repo.editor.create_new_branch" | Safe}}
 						{{else}}
-							{{.locale.Tr "repo.editor.create_new_branch_np" | Safe}}
+							{{ctx.Locale.Tr "repo.editor.create_new_branch_np" | Safe}}
 						{{end}}
 					</label>
 				</div>
@@ -60,7 +60,7 @@
 			<div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}gt-hidden{{end}}">
 				<div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}">
 					{{svg "octicon-git-branch"}}
-					<input type="text" name="new_branch_name" value="{{.new_branch_name}}" class="input-contrast gt-mr-2 js-quick-pull-new-branch-name" placeholder="{{.locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{.locale.Tr "repo.editor.new_branch_name"}}">
+					<input type="text" name="new_branch_name" value="{{.new_branch_name}}" class="input-contrast gt-mr-2 js-quick-pull-new-branch-name" placeholder="{{ctx.Locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{ctx.Locale.Tr "repo.editor.new_branch_name"}}">
 					<span class="text-muted js-quick-pull-normalization-info"></span>
 				</div>
 			</div>
@@ -68,7 +68,7 @@
 		</div>
 	</div>
 	<button id="commit-button" type="submit" class="ui primary button">
-		{{if eq .commit_choice "commit-to-new-branch"}}{{.locale.Tr "repo.editor.propose_file_change"}}{{else}}{{.locale.Tr "repo.editor.commit_changes"}}{{end}}
+		{{if eq .commit_choice "commit-to-new-branch"}}{{ctx.Locale.Tr "repo.editor.propose_file_change"}}{{else}}{{ctx.Locale.Tr "repo.editor.commit_changes"}}{{end}}
 	</button>
-	<a class="ui button red" href="{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.editor.cancel"}}</a>
+	<a class="ui button red" href="{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.editor.cancel"}}</a>
 </div>
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl
index abe2e345fc..236f10bb0a 100644
--- a/templates/repo/editor/edit.tmpl
+++ b/templates/repo/editor/edit.tmpl
@@ -15,22 +15,22 @@
 					{{range $i, $v := .TreeNames}}
 						<div class="breadcrumb-divider">/</div>
 						{{if eq $i $l}}
-							<input id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.EditorconfigJson}}" required autofocus>
-							<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
+							<input id="file-name" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.name_your_file"}}" data-editorconfig="{{$.EditorconfigJson}}" required autofocus>
+							<span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
 						{{else}}
 							<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
 						{{end}}
 					{{end}}
-					<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
+					<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{PathEscapeSegments .TreePath}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
 					<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
 				</div>
 			</div>
 			<div class="field">
 				<div class="ui top attached tabular menu" data-write="write" data-preview="preview" data-diff="diff">
-					<a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{.locale.Tr "repo.editor.new_file"}}{{else}}{{.locale.Tr "repo.editor.edit_file"}}{{end}}</a>
-					<a class="item" data-tab="preview" data-url="{{.Repository.Link}}/markup" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL}}" data-markup-mode="file">{{svg "octicon-eye"}} {{.locale.Tr "preview"}}</a>
+					<a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a>
+					<a class="item" data-tab="preview" data-url="{{.Repository.Link}}/markup" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL}}" data-markup-mode="file">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a>
 					{{if not .IsNewFile}}
-					<a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}" data-context="{{.BranchLink}}">{{svg "octicon-diff"}} {{.locale.Tr "repo.editor.preview_changes"}}</a>
+					<a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}" data-context="{{.BranchLink}}">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a>
 					{{end}}
 				</div>
 				<div class="ui bottom attached active tab segment" data-tab="write">
@@ -44,10 +44,10 @@
 					<div class="editor-loading is-loading"></div>
 				</div>
 				<div class="ui bottom attached tab segment markup" data-tab="preview">
-					{{.locale.Tr "loading"}}
+					{{ctx.Locale.Tr "loading"}}
 				</div>
 				<div class="ui bottom attached tab segment diff edit-diff" data-tab="diff">
-					{{.locale.Tr "loading"}}
+					{{ctx.Locale.Tr "loading"}}
 				</div>
 			</div>
 			{{template "repo/editor/commit_form" .}}
@@ -56,19 +56,19 @@
 	<div class="ui g-modal-confirm modal" id="edit-empty-content-modal">
 		<div class="header">
 			{{svg "octicon-file"}}
-			{{.locale.Tr "repo.editor.commit_empty_file_header"}}
+			{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}
 		</div>
 		<div class="center content">
-			<p>{{.locale.Tr "repo.editor.commit_empty_file_text"}}</p>
+			<p>{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}</p>
 		</div>
 		<div class="actions">
 			<button class="ui cancel button">
 				{{svg "octicon-x"}}
-				{{.locale.Tr "repo.editor.cancel"}}
+				{{ctx.Locale.Tr "repo.editor.cancel"}}
 			</button>
 			<button class="ui primary ok button">
 				{{svg "fontawesome-save"}}
-				{{.locale.Tr "repo.editor.commit_changes"}}
+				{{ctx.Locale.Tr "repo.editor.commit_changes"}}
 			</button>
 		</div>
 	</div>
diff --git a/templates/repo/editor/patch.tmpl b/templates/repo/editor/patch.tmpl
index 57126c09ab..44c30bd5f9 100644
--- a/templates/repo/editor/patch.tmpl
+++ b/templates/repo/editor/patch.tmpl
@@ -9,18 +9,18 @@
 			<input type="hidden" name="page_has_posted" value="{{.PageHasPosted}}">
 			<div class="repo-editor-header">
 				<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
-					{{.locale.Tr "repo.editor.patching"}}
+					{{ctx.Locale.Tr "repo.editor.patching"}}
 					<a class="section" href="{{$.RepoLink}}">{{.Repository.FullName}}</a>
 					<div class="breadcrumb-divider">:</div>
 					<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
-					<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
+					<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
 					<input type="hidden" id="tree_path" name="tree_path" value="" required>
 					<input id="file-name" type="hidden" value="diff.patch">
 				</div>
 			</div>
 			<div class="field">
 				<div class="ui top attached tabular menu" data-write="write">
-					<a class="active item" data-tab="write">{{svg "octicon-code" 16 "gt-mr-2"}}{{.locale.Tr "repo.editor.new_patch"}}</a>
+					<a class="active item" data-tab="write">{{svg "octicon-code" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a>
 				</div>
 				<div class="ui bottom attached active tab segment" data-tab="write">
 					<textarea id="edit_area" name="content" class="gt-hidden" data-id="repo-{{.Repository.Name}}-patch"
@@ -37,19 +37,19 @@
 	<div class="ui g-modal-confirm modal" id="edit-empty-content-modal">
 		<div class="header">
 			{{svg "octicon-file"}}
-			{{.locale.Tr "repo.editor.commit_empty_file_header"}}
+			{{ctx.Locale.Tr "repo.editor.commit_empty_file_header"}}
 		</div>
 		<div class="center content">
-			<p>{{.locale.Tr "repo.editor.commit_empty_file_text"}}</p>
+			<p>{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}</p>
 		</div>
 		<div class="actions">
 			<button class="ui cancel button">
 				{{svg "octicon-x"}}
-				{{.locale.Tr "repo.editor.cancel"}}
+				{{ctx.Locale.Tr "repo.editor.cancel"}}
 			</button>
 			<button class="ui primary ok button">
 				{{svg "fontawesome-save"}}
-				{{.locale.Tr "repo.editor.commit_changes"}}
+				{{ctx.Locale.Tr "repo.editor.commit_changes"}}
 			</button>
 		</div>
 	</div>
diff --git a/templates/repo/editor/upload.tmpl b/templates/repo/editor/upload.tmpl
index bfb6f150c1..d362a5602a 100644
--- a/templates/repo/editor/upload.tmpl
+++ b/templates/repo/editor/upload.tmpl
@@ -13,13 +13,13 @@
 					{{range $i, $v := .TreeNames}}
 						<div class="breadcrumb-divider">/</div>
 						{{if eq $i $l}}
-							<input type="text" id="file-name" value="{{$v}}" placeholder="{{$.locale.Tr "repo.editor.add_subdir"}}" autofocus>
-							<span data-tooltip-content="{{$.locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
+							<input type="text" id="file-name" value="{{$v}}" placeholder="{{ctx.Locale.Tr "repo.editor.add_subdir"}}" autofocus>
+							<span data-tooltip-content="{{ctx.Locale.Tr "repo.editor.filename_help"}}">{{svg "octicon-info"}}</span>
 						{{else}}
 							<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
 						{{end}}
 					{{end}}
-					<span>{{.locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.editor.cancel_lower"}}</a></span>
+					<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}{{if not .IsNewFile}}/{{.TreePath | PathEscapeSegments}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
 					<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
 				</div>
 			</div>
diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl
index b2476cfea8..c1ec483b77 100644
--- a/templates/repo/empty.tmpl
+++ b/templates/repo/empty.tmpl
@@ -8,32 +8,32 @@
 				{{if .Repository.IsArchived}}
 					<div class="ui warning message gt-text-center">
 						{{if .Repository.ArchivedUnix.IsZero}}
-							{{.locale.Tr "repo.archive.title"}}
+							{{ctx.Locale.Tr "repo.archive.title"}}
 						{{else}}
-							{{.locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}}
+							{{ctx.Locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}}
 						{{end}}
 					</div>
 				{{end}}
 				{{if .Repository.IsBroken}}
 						<div class="ui segment center">
-							{{.locale.Tr "repo.broken_message"}}
+							{{ctx.Locale.Tr "repo.broken_message"}}
 						</div>
 				{{else if .CanWriteCode}}
 					<h4 class="ui top attached header">
-						{{.locale.Tr "repo.quick_guide"}}
+						{{ctx.Locale.Tr "repo.quick_guide"}}
 					</h4>
 					<div class="ui attached guide table segment empty-repo-guide">
 						<div class="item">
-							<h3>{{.locale.Tr "repo.clone_this_repo"}} <small>{{.locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</small></h3>
+							<h3>{{ctx.Locale.Tr "repo.clone_this_repo"}} <small>{{ctx.Locale.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</small></h3>
 
 							<div class="repo-button-row">
 								{{if and .CanWriteCode (not .Repository.IsArchived)}}
 									<a class="ui small button" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/">
-										{{.locale.Tr "repo.editor.new_file"}}
+										{{ctx.Locale.Tr "repo.editor.new_file"}}
 									</a>
 									{{if .RepositoryUploadEnabled}}
 									<a class="ui small button" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/">
-										{{.locale.Tr "repo.editor.upload_file"}}
+										{{ctx.Locale.Tr "repo.editor.upload_file"}}
 									</a>
 									{{end}}
 								{{end}}
@@ -47,7 +47,7 @@
 							<div class="divider gt-my-0"></div>
 
 							<div class="item">
-								<h3>{{.locale.Tr "repo.create_new_repo_command"}}</h3>
+								<h3>{{ctx.Locale.Tr "repo.create_new_repo_command"}}</h3>
 								<div class="markup">
 									<pre><code>touch README.md
 git init
@@ -61,7 +61,7 @@ git push -u origin {{.Repository.DefaultBranch}}</code></pre>
 							<div class="divider"></div>
 
 							<div class="item">
-								<h3>{{.locale.Tr "repo.push_exist_repo"}}</h3>
+								<h3>{{ctx.Locale.Tr "repo.push_exist_repo"}}</h3>
 								<div class="markup">
 									<pre><code>git remote add origin <span class="js-clone-url">{{$.CloneButtonOriginLink.HTTPS}}</span>
 git push -u origin {{.Repository.DefaultBranch}}</code></pre>
@@ -70,7 +70,7 @@ git push -u origin {{.Repository.DefaultBranch}}</code></pre>
 						{{end}}
 					{{else}}
 						<div class="ui segment center">
-							{{.locale.Tr "repo.empty_message"}}
+							{{ctx.Locale.Tr "repo.empty_message"}}
 						</div>
 					{{end}}
 					{{template "repo/clone_script" .}}
diff --git a/templates/repo/file_info.tmpl b/templates/repo/file_info.tmpl
index 7323b30d77..3003fbbdb6 100644
--- a/templates/repo/file_info.tmpl
+++ b/templates/repo/file_info.tmpl
@@ -1,17 +1,17 @@
 <div class="file-info text grey normal gt-mono">
 	{{if .FileIsSymlink}}
 		<div class="file-info-entry">
-			{{.locale.Tr "repo.symbolic_link"}}
+			{{ctx.Locale.Tr "repo.symbolic_link"}}
 		</div>
 	{{end}}
 	{{if .NumLinesSet}}{{/* Explicit attribute needed to show 0 line changes */}}
 		<div class="file-info-entry">
-			{{.NumLines}} {{.locale.TrN .NumLines "repo.line" "repo.lines"}}
+			{{.NumLines}} {{ctx.Locale.TrN .NumLines "repo.line" "repo.lines"}}
 		</div>
 	{{end}}
 	{{if .FileSize}}
 		<div class="file-info-entry">
-			{{FileSize .FileSize}}{{if .IsLFSFile}} ({{.locale.Tr "repo.stored_lfs"}}){{end}}
+			{{FileSize .FileSize}}{{if .IsLFSFile}} ({{ctx.Locale.Tr "repo.stored_lfs"}}){{end}}
 		</div>
 	{{end}}
 	{{if .LFSLock}}
@@ -27,7 +27,7 @@
 	{{end}}
 	{{if .IsExecutable}}
 		<div class="file-info-entry">
-			{{.locale.Tr "repo.executable_file"}}
+			{{ctx.Locale.Tr "repo.executable_file"}}
 		</div>
 	{{end}}
 	{{if .ImageSize}}
diff --git a/templates/repo/find/files.tmpl b/templates/repo/find/files.tmpl
index dab46cf362..eac6ec2011 100644
--- a/templates/repo/find/files.tmpl
+++ b/templates/repo/find/files.tmpl
@@ -14,7 +14,7 @@
 			</tbody>
 		</table>
 		<div id="repo-find-file-no-result" class="ui row center gt-mt-5 gt-hidden">
-			<h3>{{.locale.Tr "repo.find_file.no_matching"}}</h3>
+			<h3>{{ctx.Locale.Tr "repo.find_file.no_matching"}}</h3>
 		</div>
 	</div>
 </div>
diff --git a/templates/repo/forks.tmpl b/templates/repo/forks.tmpl
index 481c0e67e0..b27b55c131 100644
--- a/templates/repo/forks.tmpl
+++ b/templates/repo/forks.tmpl
@@ -3,7 +3,7 @@
 	{{template "repo/header" .}}
 	<div class="ui container">
 		<h2 class="ui dividing header">
-			{{.locale.Tr "repo.forks"}}
+			{{ctx.Locale.Tr "repo.forks"}}
 		</h2>
 		{{range .Forks}}
 			<div class="gt-df gt-ac gt-py-3">
diff --git a/templates/repo/graph.tmpl b/templates/repo/graph.tmpl
index b4cfee84f7..37305d278a 100644
--- a/templates/repo/graph.tmpl
+++ b/templates/repo/graph.tmpl
@@ -4,15 +4,15 @@
 	<div class="ui container">
 		<div id="git-graph-container" class="ui segment{{if eq .Mode "monochrome"}} monochrome{{end}}">
 			<h2 class="ui header dividing">
-				{{.locale.Tr "repo.commit_graph"}}
+				{{ctx.Locale.Tr "repo.commit_graph"}}
 				<div class="ui icon buttons tiny color-buttons">
 					<div class="ui multiple selection search dropdown" id="flow-select-refs-dropdown">
 						<input type="hidden" name="flow">
-						<div class="default text">{{.locale.Tr "repo.commit_graph.select"}}</div>
+						<div class="default text">{{ctx.Locale.Tr "repo.commit_graph.select"}}</div>
 						<div class="menu">
 							<div class="item" data-value="...flow-hide-pr-refs">
 								<span class="truncate">
-									{{svg "octicon-eye-closed" 16 "gt-mr-2"}}<span title="{{.locale.Tr "repo.commit_graph.hide_pr_refs"}}">{{.locale.Tr "repo.commit_graph.hide_pr_refs"}}</span>
+									{{svg "octicon-eye-closed" 16 "gt-mr-2"}}<span title="{{ctx.Locale.Tr "repo.commit_graph.hide_pr_refs"}}">{{ctx.Locale.Tr "repo.commit_graph.hide_pr_refs"}}</span>
 								</span>
 							</div>
 							{{range .AllRefs}}
@@ -45,8 +45,8 @@
 							{{end}}
 						</div>
 					</div>
-					<button id="flow-color-monochrome" class="ui labelled icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{.locale.Tr "repo.commit_graph.monochrome"}}">{{svg "material-invert-colors" 16 "gt-mr-2"}}{{.locale.Tr "repo.commit_graph.monochrome"}}</button>
-					<button id="flow-color-colored" class="ui labelled icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{.locale.Tr "repo.commit_graph.color"}}">{{svg "material-palette" 16 "gt-mr-2"}}{{.locale.Tr "repo.commit_graph.color"}}</button>
+					<button id="flow-color-monochrome" class="ui labelled icon button{{if eq .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}">{{svg "material-invert-colors" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}</button>
+					<button id="flow-color-colored" class="ui labelled icon button{{if ne .Mode "monochrome"}} active{{end}}" title="{{ctx.Locale.Tr "repo.commit_graph.color"}}">{{svg "material-palette" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.commit_graph.color"}}</button>
 				</div>
 			</h2>
 			<div class="ui dividing"></div>
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index d0f24949c9..5d4bc64734 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -13,60 +13,60 @@
 					<div class="labels gt-df gt-ac gt-fw">
 						{{if .IsTemplate}}
 							{{if .IsPrivate}}
-								<span class="ui basic label">{{$.locale.Tr "repo.desc.private_template"}}</span>
+								<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span>
 							{{else}}
 								{{if .Owner.Visibility.IsPrivate}}
-									<span class="ui basic label">{{$.locale.Tr "repo.desc.internal_template"}}</span>
+									<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span>
 								{{end}}
 							{{end}}
 						{{else}}
 							{{if .IsPrivate}}
-								<span class="ui basic label">{{$.locale.Tr "repo.desc.private"}}</span>
+								<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
 							{{else}}
 								{{if .Owner.Visibility.IsPrivate}}
-									<span class="ui basic label">{{$.locale.Tr "repo.desc.internal"}}</span>
+									<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
 								{{end}}
 							{{end}}
 						{{end}}
 						{{if .IsArchived}}
-							<span class="ui basic label">{{$.locale.Tr "repo.desc.archived"}}</span>
+							<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
 						{{end}}
 					</div>
 					{{if $.EnableFeed}}
-						<a class="rss-icon gt-ml-3" href="{{$.RepoLink}}.rss" data-tooltip-content="{{$.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
+						<a class="rss-icon gt-ml-3" href="{{$.RepoLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
 					{{end}}
 				</div>
 				{{if $.PullMirror}}
-					<div class="fork-flag">{{$.locale.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a></div>
+					<div class="fork-flag">{{ctx.Locale.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a></div>
 				{{end}}
-				{{if .IsFork}}<div class="fork-flag">{{$.locale.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}}
-				{{if .IsGenerated}}<div class="fork-flag">{{$.locale.Tr "repo.generated_from"}} <a href="{{.TemplateRepo.Link}}">{{.TemplateRepo.FullName}}</a></div>{{end}}
+				{{if .IsFork}}<div class="fork-flag">{{ctx.Locale.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}}
+				{{if .IsGenerated}}<div class="fork-flag">{{ctx.Locale.Tr "repo.generated_from"}} <a href="{{.TemplateRepo.Link}}">{{.TemplateRepo.FullName}}</a></div>{{end}}
 			</div>
 			{{if not (or .IsBeingCreated .IsBroken)}}
 				<div class="repo-buttons">
 					{{if $.RepoTransfer}}
 						<form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}">
 							{{$.CsrfTokenHtml}}
-							<div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}">
+							<div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{ctx.Locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}">
 								<button type="submit" class="ui basic button {{if $.CanUserAcceptTransfer}}primary {{end}} ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}>
-									{{$.locale.Tr "repo.transfer.accept"}}
+									{{ctx.Locale.Tr "repo.transfer.accept"}}
 								</button>
 							</div>
 						</form>
 						<form method="post" action="{{$.RepoLink}}/action/reject_transfer?redirect_to={{$.RepoLink}}">
 							{{$.CsrfTokenHtml}}
-							<div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}">
+							<div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{ctx.Locale.Tr "repo.transfer.reject_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{ctx.Locale.Tr "repo.transfer.no_permission_to_reject"}}{{end}}">
 								<button type="submit" class="ui basic button {{if $.CanUserAcceptTransfer}}red {{end}}ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}>
-									{{$.locale.Tr "repo.transfer.reject"}}
+									{{ctx.Locale.Tr "repo.transfer.reject"}}
 								</button>
 							</div>
 						</form>
 					{{end}}
 					<form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
 						{{$.CsrfTokenHtml}}
-						<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{$.locale.Tr "repo.watch_guest_user"}}"{{end}}>
+						<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}"{{end}}>
 							<button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}}>
-								{{if $.IsWatchingRepo}}{{svg "octicon-eye-closed" 16}}{{$.locale.Tr "repo.unwatch"}}{{else}}{{svg "octicon-eye"}}{{$.locale.Tr "repo.watch"}}{{end}}
+								{{if $.IsWatchingRepo}}{{svg "octicon-eye-closed" 16}}{{ctx.Locale.Tr "repo.unwatch"}}{{else}}{{svg "octicon-eye"}}{{ctx.Locale.Tr "repo.watch"}}{{end}}
 							</button>
 							<a class="ui basic label" href="{{.Link}}/watchers">
 								{{CountFmt .NumWatches}}
@@ -76,9 +76,9 @@
 					{{if not $.DisableStars}}
 						<form method="post" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
 							{{$.CsrfTokenHtml}}
-							<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{$.locale.Tr "repo.star_guest_user"}}"{{end}}>
+							<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.star_guest_user"}}"{{end}}>
 								<button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}}>
-									{{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{$.locale.Tr "repo.unstar"}}{{else}}{{svg "octicon-star"}}{{$.locale.Tr "repo.star"}}{{end}}
+									{{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{ctx.Locale.Tr "repo.unstar"}}{{else}}{{svg "octicon-star"}}{{ctx.Locale.Tr "repo.star"}}{{end}}
 								</button>
 								<a class="ui basic label" href="{{.Link}}/stars">
 									{{CountFmt .NumStars}}
@@ -92,9 +92,9 @@
 								disabled
 							{{end}}"
 							{{if not $.IsSigned}}
-								data-tooltip-content="{{$.locale.Tr "repo.fork_guest_user"}}"
+								data-tooltip-content="{{ctx.Locale.Tr "repo.fork_guest_user"}}"
 							{{else if and (not $.CanSignedUserFork) (eq (len $.UserAndOrgForks) 0)}}
-								data-tooltip-content="{{$.locale.Tr "repo.fork_from_self"}}"
+								data-tooltip-content="{{ctx.Locale.Tr "repo.fork_from_self"}}"
 							{{end}}
 						>
 							<a class="ui compact{{if $.ShowForkModal}} show-modal{{end}} small basic button"
@@ -111,11 +111,11 @@
 									data-modal="#fork-repo-modal"
 								{{end}}
 							>
-								{{svg "octicon-repo-forked"}}{{$.locale.Tr "repo.fork"}}
+								{{svg "octicon-repo-forked"}}{{ctx.Locale.Tr "repo.fork"}}
 							</a>
 							<div class="ui small modal" id="fork-repo-modal">
 								<div class="header">
-									{{$.locale.Tr "repo.already_forked" .Name}}
+									{{ctx.Locale.Tr "repo.already_forked" .Name}}
 								</div>
 								<div class="content gt-text-left">
 									<div class="ui list">
@@ -130,7 +130,7 @@
 									{{if $.CanSignedUserFork}}
 									<div class="divider"></div>
 									<a href="{{AppSubUrl}}/repo/fork/{{.ID}}">
-										{{$.locale.Tr "repo.fork_to_different_account"}}
+										{{ctx.Locale.Tr "repo.fork_to_different_account"}}
 									</a>
 									{{end}}
 								</div>
@@ -150,13 +150,13 @@
 			<div class="ui tabular menu navbar gt-overflow-x-auto gt-overflow-y-hidden">
 				{{if .Permission.CanRead $.UnitTypeCode}}
 				<a class="{{if .PageIsViewCode}}active {{end}}item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL}}{{end}}">
-					{{svg "octicon-code"}} {{.locale.Tr "repo.code"}}
+					{{svg "octicon-code"}} {{ctx.Locale.Tr "repo.code"}}
 				</a>
 				{{end}}
 
 				{{if .Permission.CanRead $.UnitTypeIssues}}
 					<a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoLink}}/issues">
-						{{svg "octicon-issue-opened"}} {{.locale.Tr "repo.issues"}}
+						{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues"}}
 						{{if .Repository.NumOpenIssues}}
 							<span class="ui small label">{{CountFmt .Repository.NumOpenIssues}}</span>
 						{{end}}
@@ -165,13 +165,13 @@
 
 				{{if .Permission.CanRead $.UnitTypeExternalTracker}}
 					<a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer">
-						{{svg "octicon-link-external"}} {{.locale.Tr "repo.issues"}}
+						{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues"}}
 					</a>
 				{{end}}
 
 				{{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}}
 					<a class="{{if .PageIsPullList}}active {{end}}item" href="{{.RepoLink}}/pulls">
-						{{svg "octicon-git-pull-request"}} {{.locale.Tr "repo.pulls"}}
+						{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.pulls"}}
 						{{if .Repository.NumOpenPulls}}
 							<span class="ui small label">{{CountFmt .Repository.NumOpenPulls}}</span>
 						{{end}}
@@ -180,7 +180,7 @@
 
 				{{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}}
 					<a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions">
-						{{svg "octicon-play"}} {{.locale.Tr "actions.actions"}}
+						{{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}}
 						{{if .Repository.NumOpenActionRuns}}
 							<span class="ui small label">{{CountFmt .Repository.NumOpenActionRuns}}</span>
 						{{end}}
@@ -189,13 +189,13 @@
 
 				{{if .Permission.CanRead $.UnitTypePackages}}
 					<a href="{{.RepoLink}}/packages" class="{{if .IsPackagesPage}}active {{end}}item">
-						{{svg "octicon-package"}} {{.locale.Tr "packages.title"}}
+						{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
 					</a>
 				{{end}}
 
 				{{if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}}
 					<a href="{{.RepoLink}}/projects" class="{{if .IsProjectsPage}}active {{end}}item">
-						{{svg "octicon-project"}} {{.locale.Tr "repo.project_board"}}
+						{{svg "octicon-project"}} {{ctx.Locale.Tr "repo.project_board"}}
 						{{if .Repository.NumOpenProjects}}
 							<span class="ui small label">{{CountFmt .Repository.NumOpenProjects}}</span>
 						{{end}}
@@ -204,7 +204,7 @@
 
 				{{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo)}}
 				<a class="{{if or .PageIsReleaseList .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/releases">
-					{{svg "octicon-tag"}} {{.locale.Tr "repo.releases"}}
+					{{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.releases"}}
 					{{if .NumReleases}}
 						<span class="ui small label">{{CountFmt .NumReleases}}</span>
 					{{end}}
@@ -213,19 +213,19 @@
 
 				{{if .Permission.CanRead $.UnitTypeWiki}}
 					<a class="{{if .PageIsWiki}}active {{end}}item" href="{{.RepoLink}}/wiki">
-						{{svg "octicon-book"}} {{.locale.Tr "repo.wiki"}}
+						{{svg "octicon-book"}} {{ctx.Locale.Tr "repo.wiki"}}
 					</a>
 				{{end}}
 
 				{{if .Permission.CanRead $.UnitTypeExternalWiki}}
 					<a class="item" href="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}" target="_blank" rel="noopener noreferrer">
-						{{svg "octicon-link-external"}} {{.locale.Tr "repo.wiki"}}
+						{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.wiki"}}
 					</a>
 				{{end}}
 
 				{{if and (.Permission.CanReadAny $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsEmptyRepo)}}
 					<a class="{{if .PageIsActivity}}active {{end}}item" href="{{.RepoLink}}/activity">
-						{{svg "octicon-pulse"}} {{.locale.Tr "repo.activity"}}
+						{{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}}
 					</a>
 				{{end}}
 
@@ -233,14 +233,14 @@
 
 				{{if .Permission.IsAdmin}}
 					<a class="{{if .PageIsRepoSettings}}active {{end}}right item" href="{{.RepoLink}}/settings">
-						{{svg "octicon-tools"}} {{.locale.Tr "repo.settings"}}
+						{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
 					</a>
 				{{end}}
 			</div>
 		{{else if .Permission.IsAdmin}}
 			<div class="ui tabular menu navbar gt-overflow-x-auto gt-overflow-y-hidden">
 				<a class="{{if .PageIsRepoSettings}}active {{end}}right item" href="{{.RepoLink}}/settings">
-					{{svg "octicon-tools"}} {{.locale.Tr "repo.settings"}}
+					{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
 				</a>
 			</div>
 		{{end}}
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 616cb7a938..d3f0ead729 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -8,15 +8,15 @@
 		<div class="ui repo-description">
 			<div id="repo-desc" class="gt-font-16">
 				{{$description := .Repository.DescriptionHTML $.Context}}
-				{{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{.locale.Tr "repo.no_desc"}}</span>{{end}}
+				{{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>{{end}}
 				<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
 			</div>
 			{{if .RepoSearchEnabled}}
 				<div class="ui repo-search">
 					<form class="ui form ignore-dirty" action="{{.RepoLink}}/search" method="get">
 						<div class="field">
-							<div class="ui small action input{{if .CodeIndexerUnavailable}} disabled left icon{{end}}"{{if .CodeIndexerUnavailable}} data-tooltip-content="{{.locale.Tr "repo.search.code_search_unavailable"}}"{{end}}>
-								<input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{.locale.Tr "repo.search.search_repo"}}">
+							<div class="ui small action input{{if .CodeIndexerUnavailable}} disabled left icon{{end}}"{{if .CodeIndexerUnavailable}} data-tooltip-content="{{ctx.Locale.Tr "repo.search.code_search_unavailable"}}"{{end}}>
+								<input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{ctx.Locale.Tr "repo.search.search_repo"}}">
 								{{if .CodeIndexerUnavailable}}
 									<i class="icon">{{svg "octicon-alert"}}</i>
 								{{end}}
@@ -31,13 +31,13 @@
 		</div>
 		<div class="gt-df gt-ac gt-fw gt-gap-2" id="repo-topics">
 			{{range .Topics}}<a class="ui repo-topic large label topic gt-m-0" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
-			{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<button id="manage_topic" class="btn interact-fg gt-font-12">{{.locale.Tr "repo.topic.manage_topics"}}</button>{{end}}
+			{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<button id="manage_topic" class="btn interact-fg gt-font-12">{{ctx.Locale.Tr "repo.topic.manage_topics"}}</button>{{end}}
 		</div>
 		{{end}}
 		{{if and .Permission.IsAdmin (not .Repository.IsArchived)}}
 		<div class="ui form gt-hidden gt-df gt-mt-4" id="topic_edit">
 			<div class="field gt-f1 gt-mr-3">
-				<div class="ui fluid multiple search selection dropdown" data-text-count-prompt="{{.locale.Tr "repo.topic.count_prompt"}}" data-text-format-prompt="{{.locale.Tr "repo.topic.format_prompt"}}">
+				<div class="ui fluid multiple search selection dropdown" data-text-count-prompt="{{ctx.Locale.Tr "repo.topic.count_prompt"}}" data-text-format-prompt="{{ctx.Locale.Tr "repo.topic.format_prompt"}}">
 					<input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if Eval $i "+" 1 "<" (len $.Topics)}},{{end}}{{end}}">
 					{{range .Topics}}
 						{{/* keey the same layout as Fomantic UI generated labels */}}
@@ -47,17 +47,17 @@
 				</div>
 			</div>
 			<div>
-				<button class="ui basic button" id="cancel_topic_edit">{{.locale.Tr "cancel"}}</button>
-				<button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{.locale.Tr "save"}}</button>
+				<button class="ui basic button" id="cancel_topic_edit">{{ctx.Locale.Tr "cancel"}}</button>
+				<button class="ui primary button" id="save_topic" data-link="{{.RepoLink}}/topics">{{ctx.Locale.Tr "save"}}</button>
 			</div>
 		</div>
 		{{end}}
 		{{if .Repository.IsArchived}}
 			<div class="ui warning message gt-text-center">
 				{{if .Repository.ArchivedUnix.IsZero}}
-					{{.locale.Tr "repo.archive.title"}}
+					{{ctx.Locale.Tr "repo.archive.title"}}
 				{{else}}
-					{{.locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}}
+					{{ctx.Locale.Tr "repo.archive.title_date" (DateTime "long" .Repository.ArchivedUnix) | Safe}}
 				{{end}}
 			</div>
 		{{end}}
@@ -73,7 +73,7 @@
 					{{$cmpBranch = print $cmpBranch (.BranchName|PathEscapeSegments)}}
 					{{$compareLink := printf "%s/compare/%s...%s" .BaseRepo.Link (.BaseRepo.DefaultBranch|PathEscapeSegments) $cmpBranch}}
 					<a id="new-pull-request" role="button" class="ui compact basic button" href="{{$compareLink}}"
-						data-tooltip-content="{{if .PullRequestCtx.Allowed}}{{.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{.locale.Tr "action.compare_branch"}}{{end}}">
+						data-tooltip-content="{{if .PullRequestCtx.Allowed}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}">
 						{{svg "octicon-git-pull-request"}}
 					</a>
 				{{end}}
@@ -81,24 +81,24 @@
 				{{$n := len .TreeNames}}
 				{{$l := Eval $n "-" 1}}
 				{{if eq $n 0}}
-					<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
+					<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{ctx.Locale.Tr "repo.find_file.go_to_file"}}</a>
 				{{end}}
 
 				{{if and .CanWriteCode .IsViewBranch (not .Repository.IsMirror) (not .Repository.IsArchived) (not .IsViewFile)}}
 					<button class="ui dropdown basic compact jump button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
-						{{.locale.Tr "repo.editor.add_file"}}
+						{{ctx.Locale.Tr "repo.editor.add_file"}}
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
 							<a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
-								{{.locale.Tr "repo.editor.new_file"}}
+								{{ctx.Locale.Tr "repo.editor.new_file"}}
 							</a>
 							{{if .RepositoryUploadEnabled}}
 							<a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
-								{{.locale.Tr "repo.editor.upload_file"}}
+								{{ctx.Locale.Tr "repo.editor.upload_file"}}
 							</a>
 							{{end}}
 							<a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
-								{{.locale.Tr "repo.editor.patch"}}
+								{{ctx.Locale.Tr "repo.editor.patch"}}
 							</a>
 						</div>
 					</button>
@@ -106,7 +106,7 @@
 
 				{{if and (eq $n 0) (.Repository.IsTemplate)}}
 					<a role="button" class="ui primary compact button" href="{{AppSubUrl}}/repo/create?template_id={{.Repository.ID}}">
-						{{.locale.Tr "repo.use_template"}}
+						{{ctx.Locale.Tr "repo.use_template"}}
 					</a>
 				{{end}}
 				{{if ne $n 0}}
@@ -128,18 +128,18 @@
 				{{if eq $n 0}}
 					<div class="ui action tiny input" id="clone-panel">
 						{{template "repo/clone_buttons" .}}
-						<button id="more-btn" class="ui basic small compact jump dropdown icon button" data-tooltip-content="{{.locale.Tr "repo.more_operations"}}">
+						<button id="more-btn" class="ui basic small compact jump dropdown icon button" data-tooltip-content="{{ctx.Locale.Tr "repo.more_operations"}}">
 							{{svg "octicon-kebab-horizontal"}}
 							<div class="menu">
 								{{if not $.DisableDownloadSourceArchives}}
-									<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{.locale.Tr "repo.download_zip"}}</a>
-									<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{.locale.Tr "repo.download_tar"}}</a>
-									<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "gt-mr-3"}}{{.locale.Tr "repo.download_bundle"}}</a>
+									<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_zip"}}</a>
+									<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_tar"}}</a>
+									<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.download_bundle"}}</a>
 									{{if .CitiationExist}}
-										<a class="item" id="cite-repo-button">{{svg "octicon-cross-reference" 16 "gt-mr-3"}}{{.locale.Tr "repo.cite_this_repo"}}</a>
+										<a class="item" id="cite-repo-button">{{svg "octicon-cross-reference" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.cite_this_repo"}}</a>
 									{{end}}
 								{{end}}
-								<a class="item js-clone-url-vsc" href="vscode://vscode.git/clone?url={{.CloneButtonOriginLink.HTTPS}}">{{svg "gitea-vscode" 16 "gt-mr-3"}}{{.locale.Tr "repo.clone_in_vsc"}}</a>
+								<a class="item js-clone-url-vsc" href="vscode://vscode.git/clone?url={{.CloneButtonOriginLink.HTTPS}}">{{svg "gitea-vscode" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.clone_in_vsc"}}</a>
 							</div>
 						</button>
 						{{template "repo/clone_script" .}}{{/* the script will update `.js-clone-url` and related elements */}}
@@ -148,7 +148,7 @@
 				{{end}}
 				{{if and (ne $n 0) (not .IsViewFile) (not .IsBlame)}}
 					<a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">
-						{{svg "octicon-history" 16 "gt-mr-3"}}{{.locale.Tr "repo.file_history"}}
+						{{svg "octicon-history" 16 "gt-mr-3"}}{{ctx.Locale.Tr "repo.file_history"}}
 					</a>
 				{{end}}
 			</div>
diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl
index 33b2af9c40..9b7a05ce35 100644
--- a/templates/repo/issue/branch_selector_field.tmpl
+++ b/templates/repo/issue/branch_selector_field.tmpl
@@ -5,27 +5,27 @@
 	{{$.CsrfTokenHtml}}
 </form>
 
-<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}">
+<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}">
 	<div class="ui basic small button">
-		<span class="text branch-name">{{if .Reference}}{{$.RefEndName}}{{else}}{{.locale.Tr "repo.issues.no_ref"}}{{end}}</span>
+		<span class="text branch-name">{{if .Reference}}{{$.RefEndName}}{{else}}{{ctx.Locale.Tr "repo.issues.no_ref"}}{{end}}</span>
 		{{if .HasIssuesOrPullsWritePermission}}{{svg "octicon-triangle-down" 14 "dropdown icon"}}{{end}}
 	</div>
 	<div class="menu">
 		<div class="ui icon search input">
 			<i class="icon">{{svg "octicon-filter" 16}}</i>
-			<input name="search" placeholder="{{.locale.Tr "repo.filter_branch_and_tag"}}...">
+			<input name="search" placeholder="{{ctx.Locale.Tr "repo.filter_branch_and_tag"}}...">
 		</div>
 		<div class="header">
 			<div class="ui grid">
 				<div class="two column row">
 					<a class="reference column" href="#" data-target="#branch-list">
 						<span class="text black">
-							{{svg "octicon-git-branch" 16 "gt-mr-2"}}{{.locale.Tr "repo.branches"}}
+							{{svg "octicon-git-branch" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.branches"}}
 						</span>
 					</a>
 					<a class="reference column" href="#" data-target="#tag-list">
 						<span class="text">
-							{{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.tags"}}
+							{{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.tags"}}
 						</span>
 					</a>
 				</div>
@@ -33,7 +33,7 @@
 		</div>
 		<div id="branch-list" class="scrolling menu reference-list-menu {{if not .Issue}}new-issue{{end}}">
 			{{if .Reference}}
-				<div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{$.locale.Tr "repo.clear_ref"}}</a></strong></div>
+				<div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{ctx.Locale.Tr "repo.clear_ref"}}</a></strong></div>
 			{{end}}
 			{{range .Branches}}
 				<div class="item" data-id="refs/heads/{{.}}" data-name="{{.}}" data-id-selector="#ref_selector">{{.}}</div>
@@ -41,7 +41,7 @@
 		</div>
 		<div id="tag-list" class="scrolling menu reference-list-menu {{if not .Issue}}new-issue{{end}} gt-hidden">
 			{{if .Reference}}
-				<div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{.locale.Tr "repo.clear_ref"}}</a></strong></div>
+				<div class="item text small" data-id="" data-id-selector="#ref_selector"><strong><a href="#">{{ctx.Locale.Tr "repo.clear_ref"}}</a></strong></div>
 			{{end}}
 			{{range .Tags}}
 				<div class="item" data-id="refs/tags/{{.}}" data-name="tags/{{.}}" data-id-selector="#ref_selector">{{.}}</div>
diff --git a/templates/repo/issue/choose.tmpl b/templates/repo/issue/choose.tmpl
index 9cc666a4bd..127b9d7d87 100644
--- a/templates/repo/issue/choose.tmpl
+++ b/templates/repo/issue/choose.tmpl
@@ -15,7 +15,7 @@
 						<br>{{.About | RenderEmojiPlain}}
 					</div>
 					<div class="column right aligned">
-						<a href="{{$.RepoLink}}/issues/new?template={{.FileName}}{{if $.milestone}}&milestone={{$.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a>
+						<a href="{{$.RepoLink}}/issues/new?template={{.FileName}}{{if $.milestone}}&milestone={{$.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{ctx.Locale.Tr "repo.issues.choose.get_started"}}</a>
 					</div>
 				</div>
 			</div>
@@ -28,7 +28,7 @@
 						<br>{{.About | RenderEmojiPlain}}
 					</div>
 					<div class="column right aligned">
-						<a href="{{.URL}}" class="ui primary button">{{svg "octicon-link-external"}} {{$.locale.Tr "repo.issues.choose.open_external_link"}}</a>
+						<a href="{{.URL}}" class="ui primary button">{{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues.choose.open_external_link"}}</a>
 					</div>
 				</div>
 			</div>
@@ -37,11 +37,11 @@
 			<div class="ui attached segment">
 				<div class="ui two column grid">
 					<div class="column left aligned">
-						<strong>{{.locale.Tr "repo.issues.choose.blank"}}</strong>
-						<br/>{{.locale.Tr "repo.issues.choose.blank_about"}}
+						<strong>{{ctx.Locale.Tr "repo.issues.choose.blank"}}</strong>
+						<br/>{{ctx.Locale.Tr "repo.issues.choose.blank_about"}}
 					</div>
 					<div class="column right aligned">
-						<a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a>
+						<a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{ctx.Locale.Tr "repo.issues.choose.get_started"}}</a>
 					</div>
 				</div>
 			</div>
@@ -49,7 +49,7 @@
 		{{- if .IssueConfigError}}{{/* normal warning flash makes problems here*/}}
 			<div class="ui warning message">
 				<div class="text left">
-					<div>{{.locale.Tr "repo.issues.choose.invalid_config"}}</div>
+					<div>{{ctx.Locale.Tr "repo.issues.choose.invalid_config"}}</div>
 					<div>{{.IssueConfigError}}</div>
 				</div>
 			</div>
diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl
index d167055ca5..4197ea4f65 100644
--- a/templates/repo/issue/comment_tab.tmpl
+++ b/templates/repo/issue/comment_tab.tmpl
@@ -9,7 +9,7 @@
 		"MarkdownPreviewContext" .RepoLink
 		"TextareaName" "content"
 		"TextareaContent" $textareaContent
-		"TextareaPlaceholder"  ($.locale.Tr "repo.diff.comment.placeholder")
+		"TextareaPlaceholder"  (ctx.Locale.Tr "repo.diff.comment.placeholder")
 		"DropzoneParentContainer" "form, .ui.form"
 	)}}
 </div>
diff --git a/templates/repo/issue/filters.tmpl b/templates/repo/issue/filters.tmpl
index 1805a23e37..dca2fb0dba 100644
--- a/templates/repo/issue/filters.tmpl
+++ b/templates/repo/issue/filters.tmpl
@@ -1,7 +1,7 @@
 <div id="issue-filters" class="issue-list-toolbar">
 	<div class="issue-list-toolbar-left">
 		{{if and ($.CanWriteIssuesOrPulls) (gt (len .Issues) 0)}}
-			<input type="checkbox" autocomplete="off" class="issue-checkbox-all gt-mr-4" title="{{.locale.Tr "repo.issues.action_check_all"}}">
+			<input type="checkbox" autocomplete="off" class="issue-checkbox-all gt-mr-4" title="{{ctx.Locale.Tr "repo.issues.action_check_all"}}">
 		{{end}}
 		{{template "repo/issue/openclose" .}}
 	</div>
@@ -10,18 +10,18 @@
 			<!-- Label -->
 			<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item label-filter">
 				<span class="text">
-					{{.locale.Tr "repo.issues.filter_label"}}
+					{{ctx.Locale.Tr "repo.issues.filter_label"}}
 				</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				<div class="menu">
 					<div class="ui icon search input">
 						<i class="icon">{{svg "octicon-search" 16}}</i>
-						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_label"}}">
+						<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_label"}}">
 					</div>
-					<span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span>
+					<span class="info">{{ctx.Locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span>
 					<div class="divider"></div>
-					<a class="{{if .AllLabels}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a>
-					<a class="{{if .NoLabel}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
+					<a class="{{if .AllLabels}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}</a>
+					<a class="{{if .NoLabel}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
 					{{$previousExclusiveScope := "_no_scope"}}
 					{{range .Labels}}
 						{{$exclusiveScope := .ExclusiveScope}}
@@ -41,20 +41,20 @@
 			<!-- Milestone -->
 			<div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item">
 				<span class="text">
-					{{.locale.Tr "repo.issues.filter_milestone"}}
+					{{ctx.Locale.Tr "repo.issues.filter_milestone"}}
 				</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				<div class="menu">
 					<div class="ui icon search input">
 						<i class="icon">{{svg "octicon-search" 16}}</i>
-						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_milestone"}}">
+						<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestone"}}">
 					</div>
 					<div class="divider"></div>
-					<a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=0&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_milestone_all"}}</a>
-					<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=-1&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_milestone_none"}}</a>
+					<a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=0&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a>
+					<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=-1&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}</a>
 					{{if .OpenMilestones}}
 						<div class="divider"></div>
-						<div class="header">{{.locale.Tr "repo.issues.filter_milestone_open"}}</div>
+						<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
 						{{range .OpenMilestones}}
 						<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">
 							{{svg "octicon-milestone" 16 "mr-2"}}
@@ -64,7 +64,7 @@
 					{{end}}
 					{{if .ClosedMilestones}}
 						<div class="divider"></div>
-						<div class="header">{{.locale.Tr "repo.issues.filter_milestone_closed"}}</div>
+						<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_closed"}}</div>
 						{{range .ClosedMilestones}}
 						<a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">
 							{{svg "octicon-milestone" 16 "mr-2"}}
@@ -79,20 +79,20 @@
 			<!-- Project -->
 			<div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item">
 				<span class="text">
-					{{.locale.Tr "repo.issues.filter_project"}}
+					{{ctx.Locale.Tr "repo.issues.filter_project"}}
 				</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				<div class="menu">
 					<div class="ui icon search input">
 						<i class="icon">{{svg "octicon-search" 16}}</i>
-						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_project"}}">
+						<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_project"}}">
 					</div>
-					<a class="{{if not .ProjectID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_all"}}</a>
-					<a class="{{if eq .ProjectID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_none"}}</a>
+					<a class="{{if not .ProjectID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_project_all"}}</a>
+					<a class="{{if eq .ProjectID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_project_none"}}</a>
 					{{if .OpenProjects}}
 						<div class="divider"></div>
 						<div class="header">
-							{{.locale.Tr "repo.issues.new.open_projects"}}
+							{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
 						</div>
 						{{range .OpenProjects}}
 							<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">
@@ -103,7 +103,7 @@
 					{{if .ClosedProjects}}
 						<div class="divider"></div>
 						<div class="header">
-							{{.locale.Tr "repo.issues.new.closed_projects"}}
+							{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
 						</div>
 						{{range .ClosedProjects}}
 							<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">
@@ -115,37 +115,37 @@
 			</div>
 
 			<!-- Author -->
-			<div class="ui dropdown jump item user-remote-search" data-tooltip-content="{{.locale.Tr "repo.author_search_tooltip"}}"
+			<div class="ui dropdown jump item user-remote-search" data-tooltip-content="{{ctx.Locale.Tr "repo.author_search_tooltip"}}"
 				data-search-url="{{if .Milestone}}{{$.RepoLink}}/issues/posters{{else}}{{$.Link}}/posters{{end}}"
 				data-selected-user-id="{{$.PosterID}}"
 				data-action-jump-url="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={user_id}"
 			>
 				<span class="text">
-					{{.locale.Tr "repo.issues.filter_poster"}}
+					{{ctx.Locale.Tr "repo.issues.filter_poster"}}
 				</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				<div class="menu">
 					<div class="ui icon search input">
 						<i class="icon">{{svg "octicon-search" 16}}</i>
-						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_poster"}}">
+						<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_poster"}}">
 					</div>
-					<a class="item" data-value="0">{{.locale.Tr "repo.issues.filter_poster_no_select"}}</a>
+					<a class="item" data-value="0">{{ctx.Locale.Tr "repo.issues.filter_poster_no_select"}}</a>
 				</div>
 			</div>
 
 			<!-- Assignee -->
 			<div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
 				<span class="text">
-					{{.locale.Tr "repo.issues.filter_assignee"}}
+					{{ctx.Locale.Tr "repo.issues.filter_assignee"}}
 				</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				<div class="menu">
 					<div class="ui icon search input">
 						<i class="icon">{{svg "octicon-search" 16}}</i>
-						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignee"}}">
+						<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignee"}}">
 					</div>
-					<a class="{{if not .AssigneeID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a>
-					<a class="{{if eq .AssigneeID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a>
+					<a class="{{if not .AssigneeID}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_select"}}</a>
+					<a class="{{if eq .AssigneeID -1}}active selected {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a>
 					<div class="divider"></div>
 					{{range .Assignees}}
 						<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}">
@@ -159,18 +159,18 @@
 				<!-- Type -->
 				<div class="ui dropdown type jump item">
 					<span class="text">
-						{{.locale.Tr "repo.issues.filter_type"}}
+						{{ctx.Locale.Tr "repo.issues.filter_type"}}
 					</span>
 					{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 					<div class="menu">
-						<a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.all_issues"}}</a>
-						<a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
-						<a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.created_by_you"}}</a>
+						<a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}</a>
+						<a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
+						<a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}</a>
 						{{if .PageIsPullList}}
-							<a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.review_requested"}}</a>
-							<a class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a>
+							<a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.review_requested"}}</a>
+							<a class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a>
 						{{end}}
-						<a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}</a>
+						<a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_type.mentioning_you"}}</a>
 					</div>
 				</div>
 			{{end}}
@@ -178,18 +178,18 @@
 			<!-- Sort -->
 			<div class="list-header-sort ui small dropdown downward type jump item">
 				<span class="text">
-					{{.locale.Tr "repo.issues.filter_sort"}}
+					{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 				</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				<div class="menu">
-					<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a>
-					<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a>
-					<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
-					<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
-					<a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
-					<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
-					<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
-					<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
+					<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
+					<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+					<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+					<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+					<a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
+					<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
+					<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
+					<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
 				</div>
 			</div>
 		</div>
diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl
index 7de1b0f0ba..86e4bae0f7 100644
--- a/templates/repo/issue/labels.tmpl
+++ b/templates/repo/issue/labels.tmpl
@@ -5,7 +5,7 @@
 		<div class="navbar gt-mb-4">
 			{{template "repo/issue/navbar" .}}
 			{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
-				<button class="ui small primary new-label button">{{.locale.Tr "repo.issues.new_label"}}</button>
+				<button class="ui small primary new-label button">{{ctx.Locale.Tr "repo.issues.new_label"}}</button>
 			{{end}}
 		</div>
 		{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
diff --git a/templates/repo/issue/labels/edit_delete_label.tmpl b/templates/repo/issue/labels/edit_delete_label.tmpl
index 98efc6aa94..f41b4ee2c6 100644
--- a/templates/repo/issue/labels/edit_delete_label.tmpl
+++ b/templates/repo/issue/labels/edit_delete_label.tmpl
@@ -1,57 +1,57 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.issues.label_deletion"}}
+		{{ctx.Locale.Tr "repo.issues.label_deletion"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.issues.label_deletion_desc"}}</p>
+		<p>{{ctx.Locale.Tr "repo.issues.label_deletion_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
 
 <div class="ui small edit-label modal">
 	<div class="header">
-		{{.locale.Tr "repo.issues.label_modify"}}
+		{{ctx.Locale.Tr "repo.issues.label_modify"}}
 	</div>
 	<div class="content">
 		<form class="ui edit-label form ignore-dirty" action="{{$.Link}}/edit" method="post">
 			{{.CsrfTokenHtml}}
 			<input id="label-modal-id" name="id" type="hidden">
 			<div class="required field">
-				<label for="name">{{.locale.Tr "repo.issues.label_title"}}</label>
+				<label for="name">{{ctx.Locale.Tr "repo.issues.label_title"}}</label>
 				<div class="ui small input">
-					<input class="label-name-input" name="title" placeholder="{{.locale.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50">
+					<input class="label-name-input" name="title" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50">
 				</div>
 			</div>
 			<div class="field label-exclusive-input-field">
 				<div class="ui checkbox">
 					<input class="label-exclusive-input" name="exclusive" type="checkbox">
-					<label>{{.locale.Tr "repo.issues.label_exclusive"}}</label>
+					<label>{{ctx.Locale.Tr "repo.issues.label_exclusive"}}</label>
 				</div>
 				<br>
-				<small class="desc">{{.locale.Tr "repo.issues.label_exclusive_desc" | Safe}}</small>
+				<small class="desc">{{ctx.Locale.Tr "repo.issues.label_exclusive_desc" | Safe}}</small>
 				<div class="desc gt-ml-2 gt-mt-3 gt-hidden label-exclusive-warning">
-					{{svg "octicon-alert"}} {{.locale.Tr "repo.issues.label_exclusive_warning" | Safe}}
+					{{svg "octicon-alert"}} {{ctx.Locale.Tr "repo.issues.label_exclusive_warning" | Safe}}
 				</div>
 				<br>
 			</div>
 			<div class="field label-is-archived-input-field">
 				<div class="ui checkbox">
 					<input class="label-is-archived-input" name="is_archived" type="checkbox">
-					<label>{{.locale.Tr "repo.issues.label_archive"}}</label>
+					<label>{{ctx.Locale.Tr "repo.issues.label_archive"}}</label>
 				</div>
-				<i class="gt-ml-2" data-tooltip-content={{.locale.Tr "repo.issues.label_archive_tooltip"}}>
+				<i class="gt-ml-2" data-tooltip-content={{ctx.Locale.Tr "repo.issues.label_archive_tooltip"}}>
 					{{svg "octicon-info"}}
 				</i>
 			</div>
 			<div class="field">
-				<label for="description">{{.locale.Tr "repo.issues.label_description"}}</label>
+				<label for="description">{{ctx.Locale.Tr "repo.issues.label_description"}}</label>
 				<div class="ui small fluid input">
-					<input class="label-desc-input" name="description" placeholder="{{.locale.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200">
+					<input class="label-desc-input" name="description" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200">
 				</div>
 			</div>
 			<div class="field color-field">
-				<label for="color">{{$.locale.Tr "repo.issues.label_color"}}</label>
+				<label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label>
 				<div class="color picker column">
 					<input class="color-picker" name="color" value="#70c24a" required maxlength="7">
 					{{template "repo/issue/label_precolors"}}
@@ -62,11 +62,11 @@
 	<div class="actions">
 		<button class="ui small basic cancel button">
 			{{svg "octicon-x"}}
-			{{.locale.Tr "cancel"}}
+			{{ctx.Locale.Tr "cancel"}}
 		</button>
 		<button class="ui primary small approve button">
 			{{svg "fontawesome-save"}}
-			{{.locale.Tr "save"}}
+			{{ctx.Locale.Tr "save"}}
 		</button>
 	</div>
 </div>
diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl
index b9d349cb2b..9a6065a407 100644
--- a/templates/repo/issue/labels/label_list.tmpl
+++ b/templates/repo/issue/labels/label_list.tmpl
@@ -1,18 +1,18 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "repo.issues.label_count" .NumLabels}}
+	{{ctx.Locale.Tr "repo.issues.label_count" .NumLabels}}
 	<div class="ui right">
 		<div class="ui secondary menu">
 			<!-- Sort -->
 			<div class="item ui jump dropdown gt-py-3">
 				<span class="text">
-					{{.locale.Tr "repo.issues.filter_sort"}}
+					{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 				</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				<div class="left menu">
-					<a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&state={{$.State}}">{{.locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
-					<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&state={{$.State}}">{{.locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
-					<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}">{{.locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
-					<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}">{{.locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
+					<a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
+					<a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
+					<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
+					<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
 				</div>
 			</div>
 		</div>
@@ -37,20 +37,20 @@
 			</div>
 			<div class="label-issues">
 				{{if $.PageIsOrgSettingsLabels}}
-					<a class="open-issues" href="{{AppSubUrl}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
+					<a class="open-issues" href="{{AppSubUrl}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
 				{{else}}
-					<a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
+					<a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
 				{{end}}
 			</div>
 			<div class="label-operation gt-df">
 				{{template "repo/issue/labels/label_archived" .}}
 				<div class="gt-df gt-ml-auto">
 					{{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}}
-						<a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
-						<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
+						<a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
+						<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
 					{{else if $.PageIsOrgSettingsLabels}}
-						<a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
-						<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
+						<a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
+						<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
 					{{end}}
 				</div>
 			</div>
@@ -61,9 +61,9 @@
 			<li class="item">
 				<div class="ui grid middle aligned">
 					<div class="ten wide column">
-						{{$.locale.Tr "repo.org_labels_desc" | Str2html}}
+						{{ctx.Locale.Tr "repo.org_labels_desc" | Str2html}}
 						{{if .IsOrganizationOwner}}
-							<a href="{{.OrganizationLink}}/settings/labels">({{$.locale.Tr "repo.org_labels_desc_manage"}})</a>:
+							<a href="{{.OrganizationLink}}/settings/labels">({{ctx.Locale.Tr "repo.org_labels_desc_manage"}})</a>:
 						{{end}}
 					</div>
 				</div>
@@ -76,7 +76,7 @@
 					{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}
 				</div>
 				<div class="label-issues">
-					<a class="open-issues" {{if .IsArchived}}data-is-archived{{end}} href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a>
+					<a class="open-issues" {{if .IsArchived}}data-is-archived{{end}} href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a>
 				</div>
 				<div class="label-operation">
 					{{template "repo/issue/labels/label_archived" .}}
diff --git a/templates/repo/issue/labels/label_load_template.tmpl b/templates/repo/issue/labels/label_load_template.tmpl
index d883953bf6..0499afea19 100644
--- a/templates/repo/issue/labels/label_load_template.tmpl
+++ b/templates/repo/issue/labels/label_load_template.tmpl
@@ -1,14 +1,14 @@
 <div class="ui centered grid">
 	<div class="twelve wide computer column">
 		<div class="ui attached left aligned segment">
-			<p>{{.locale.Tr "repo.issues.label_templates.info"}}</p>
+			<p>{{ctx.Locale.Tr "repo.issues.label_templates.info"}}</p>
 			<br>
 			<form class="ui form center" action="{{.Link}}/initialize" method="post">
 				{{.CsrfTokenHtml}}
 				<div class="field">
 					<div class="ui selection dropdown">
 						<input type="hidden" name="template_name" value="Default">
-						<div class="default text">{{.locale.Tr "repo.issues.label_templates.helper"}}</div>
+						<div class="default text">{{ctx.Locale.Tr "repo.issues.label_templates.helper"}}</div>
 						<div class="menu">
 							{{range .LabelTemplateFiles}}
 								<div class="item" data-value="{{.DisplayName}}">{{.DisplayName}}<br><i>({{.Description}})</i></div>
@@ -17,7 +17,7 @@
 						{{svg "octicon-triangle-down" 18 "dropdown icon"}}
 					</div>
 				</div>
-				<button type="submit" class="ui primary button">{{.locale.Tr "repo.issues.label_templates.use"}}</button>
+				<button type="submit" class="ui primary button">{{ctx.Locale.Tr "repo.issues.label_templates.use"}}</button>
 			</form>
 		</div>
 	</div>
diff --git a/templates/repo/issue/labels/label_new.tmpl b/templates/repo/issue/labels/label_new.tmpl
index 8edd6d4e8a..e7fb1e5ff6 100644
--- a/templates/repo/issue/labels/label_new.tmpl
+++ b/templates/repo/issue/labels/label_new.tmpl
@@ -1,32 +1,32 @@
 <div class="ui small new-label modal">
 	<div class="header">
-		{{.locale.Tr "repo.issues.new_label"}}
+		{{ctx.Locale.Tr "repo.issues.new_label"}}
 	</div>
 	<div class="content">
 		<form class="ui new-label form ignore-dirty" action="{{$.Link}}/new" method="post">
 			{{.CsrfTokenHtml}}
 			<div class="required field">
-				<label for="name">{{.locale.Tr "repo.issues.label_title"}}</label>
+				<label for="name">{{ctx.Locale.Tr "repo.issues.label_title"}}</label>
 				<div class="ui small input">
-					<input class="label-name-input" name="title" placeholder="{{.locale.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50">
+					<input class="label-name-input" name="title" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50">
 				</div>
 			</div>
 			<div class="field label-exclusive-input-field">
 				<div class="ui checkbox">
 					<input class="label-exclusive-input" name="exclusive" type="checkbox">
-					<label>{{.locale.Tr "repo.issues.label_exclusive"}}</label>
+					<label>{{ctx.Locale.Tr "repo.issues.label_exclusive"}}</label>
 				</div>
 				<br>
-				<small class="desc">{{.locale.Tr "repo.issues.label_exclusive_desc" | Safe}}</small>
+				<small class="desc">{{ctx.Locale.Tr "repo.issues.label_exclusive_desc" | Safe}}</small>
 			</div>
 			<div class="field">
-				<label for="description">{{.locale.Tr "repo.issues.label_description"}}</label>
+				<label for="description">{{ctx.Locale.Tr "repo.issues.label_description"}}</label>
 				<div class="ui small fluid input">
-					<input class="label-desc-input" name="description" placeholder="{{.locale.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200">
+					<input class="label-desc-input" name="description" placeholder="{{ctx.Locale.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200">
 				</div>
 			</div>
 			<div class="field color-field">
-				<label for="color">{{$.locale.Tr "repo.issues.label_color"}}</label>
+				<label for="color">{{ctx.Locale.Tr "repo.issues.label_color"}}</label>
 				<div class="color picker column">
 					<input class="color-picker" name="color" value="#70c24a" required maxlength="7">
 					{{template "repo/issue/label_precolors"}}
@@ -38,11 +38,11 @@
 	<div class="actions">
 		<button class="ui cancel button">
 			{{svg "octicon-x"}}
-			{{.locale.Tr "cancel"}}
+			{{ctx.Locale.Tr "cancel"}}
 		</button>
 		<button class="ui primary ok button">
 			{{svg "octicon-check"}}
-			{{.locale.Tr "repo.issues.create_label"}}
+			{{ctx.Locale.Tr "repo.issues.create_label"}}
 		</button>
 	</div>
 </div>
diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl
index f8d38d035f..1599f2deb6 100644
--- a/templates/repo/issue/labels/labels_selector_field.tmpl
+++ b/templates/repo/issue/labels/labels_selector_field.tmpl
@@ -1,6 +1,6 @@
 <div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-label dropdown">
 	<span class="text muted flex-text-block">
-		<strong>{{.locale.Tr "repo.issues.new.labels"}}</strong>
+		<strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong>
 		{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
 			{{svg "octicon-gear" 16 "gt-ml-2"}}
 		{{end}}
@@ -9,10 +9,10 @@
 		{{if or .Labels .OrgLabels}}
 			<div class="ui icon search input">
 				<i class="icon">{{svg "octicon-search" 16}}</i>
-				<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_labels"}}">
+				<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}">
 			</div>
 		{{end}}
-		<a class="no-select item" href="#">{{.locale.Tr "repo.issues.new.clear_labels"}}</a>
+		<a class="no-select item" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
 		{{if or .Labels .OrgLabels}}
 			{{$previousExclusiveScope := "_no_scope"}}
 			{{range .Labels}}
@@ -36,7 +36,7 @@
 				{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}</a>
 			{{end}}
 		{{else}}
-			<div class="disabled item">{{.locale.Tr "repo.issues.new.no_items"}}</div>
+			<div class="disabled item">{{ctx.Locale.Tr "repo.issues.new.no_items"}}</div>
 		{{end}}
 	</div>
 </div>
diff --git a/templates/repo/issue/labels/labels_sidebar.tmpl b/templates/repo/issue/labels/labels_sidebar.tmpl
index 89fe26b755..4f41054a91 100644
--- a/templates/repo/issue/labels/labels_sidebar.tmpl
+++ b/templates/repo/issue/labels/labels_sidebar.tmpl
@@ -1,5 +1,5 @@
 <div class="ui labels list">
-	<span class="no-select item {{if .root.HasSelectedLabel}}gt-hidden{{end}}">{{.root.locale.Tr "repo.issues.new.no_label"}}</span>
+	<span class="no-select item {{if .root.HasSelectedLabel}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_label"}}</span>
 	<span class="labels-list">
 		{{range .root.Labels}}
 			{{template "repo/issue/labels/label" dict "root" $.root "label" .}}
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index cc8c647c1e..75d4234324 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -18,13 +18,13 @@
 			{{template "repo/issue/search" .}}
 			{{if not .Repository.IsArchived}}
 				{{if .PageIsIssueList}}
-					<a class="ui small primary button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
+					<a class="ui small primary button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
 				{{else}}
-					<a class="ui small primary button new-pr-button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.pulls.new"}}</a>
+					<a class="ui small primary button new-pr-button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{ctx.Locale.Tr "repo.pulls.new"}}</a>
 				{{end}}
 			{{else}}
 				{{if not .PageIsIssueList}}
-					<a class="ui small primary small button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{$.locale.Tr "action.compare_commits_general"}}</a>
+					<a class="ui small primary small button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{ctx.Locale.Tr "action.compare_commits_general"}}</a>
 				{{end}}
 			{{end}}
 		</div>
@@ -40,25 +40,25 @@
 					{{if not .Repository.IsArchived}}
 					<!-- Action Button -->
 					{{if .IsShowClosed}}
-						<button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{.locale.Tr "repo.issues.action_open"}}</button>
+						<button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_open"}}</button>
 					{{else}}
-						<button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{.locale.Tr "repo.issues.action_close"}}</button>
+						<button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{ctx.Locale.Tr "repo.issues.action_close"}}</button>
 					{{end}}
 					{{if $.IsRepoAdmin}}
 						<button class="ui red button issue-action"
 							data-action="delete" data-url="{{$.RepoLink}}/issues/delete"
-							data-action-delete-confirm="{{.locale.Tr "confirm_delete_selected"}}"
-						>{{.locale.Tr "repo.issues.delete"}}</button>
+							data-action-delete-confirm="{{ctx.Locale.Tr "confirm_delete_selected"}}"
+						>{{ctx.Locale.Tr "repo.issues.delete"}}</button>
 					{{end}}
 					<!-- Labels -->
 					<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
 						<span class="text">
-							{{.locale.Tr "repo.issues.action_label"}}
+							{{ctx.Locale.Tr "repo.issues.action_label"}}
 						</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
 							<div class="item issue-action" data-action="clear" data-url="{{$.RepoLink}}/issues/labels">
-								{{.locale.Tr "repo.issues.new.clear_labels"}}
+								{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}
 							</div>
 							{{$previousExclusiveScope := "_no_scope"}}
 							{{range .Labels}}
@@ -77,16 +77,16 @@
 					<!-- Milestone -->
 					<div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item">
 						<span class="text">
-							{{.locale.Tr "repo.issues.action_milestone"}}
+							{{ctx.Locale.Tr "repo.issues.action_milestone"}}
 						</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
 							<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/milestone">
-							{{.locale.Tr "repo.issues.action_milestone_no_select"}}
+							{{ctx.Locale.Tr "repo.issues.action_milestone_no_select"}}
 							</div>
 							{{if .OpenMilestones}}
 								<div class="divider"></div>
-								<div class="header">{{.locale.Tr "repo.issues.filter_milestone_open"}}</div>
+								<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
 								{{range .OpenMilestones}}
 									<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
 										{{.Name}}
@@ -95,7 +95,7 @@
 							{{end}}
 							{{if .ClosedMilestones}}
 								<div class="divider"></div>
-								<div class="header">{{.locale.Tr "repo.issues.filter_milestone_open"}}</div>
+								<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
 								{{range .ClosedMilestones}}
 									<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
 										{{.Name}}
@@ -108,17 +108,17 @@
 					<!-- Projects -->
 					<div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item">
 						<span class="text">
-							{{.locale.Tr "repo.project_board"}}
+							{{ctx.Locale.Tr "repo.project_board"}}
 						</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
 							<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/projects">
-							{{.locale.Tr "repo.issues.new.clear_projects"}}
+							{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}
 							</div>
 							{{if .OpenProjects}}
 								<div class="divider"></div>
 								<div class="header">
-									{{.locale.Tr "repo.issues.new.open_projects"}}
+									{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
 								</div>
 								{{range .OpenProjects}}
 									<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
@@ -129,7 +129,7 @@
 							{{if .ClosedProjects}}
 								<div class="divider"></div>
 								<div class="header">
-									{{.locale.Tr "repo.issues.new.closed_projects"}}
+									{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
 								</div>
 								{{range .ClosedProjects}}
 									<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
@@ -143,15 +143,15 @@
 					<!-- Assignees -->
 					<div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
 						<span class="text">
-							{{.locale.Tr "repo.issues.action_assignee"}}
+							{{ctx.Locale.Tr "repo.issues.action_assignee"}}
 						</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
 							<div class="item issue-action" data-action="clear" data-url="{{$.Link}}/assignee">
-								{{.locale.Tr "repo.issues.new.clear_assignees"}}
+								{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}
 							</div>
 							<div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/assignee">
-								{{.locale.Tr "repo.issues.action_assignee_no_select"}}
+								{{ctx.Locale.Tr "repo.issues.action_assignee_no_select"}}
 							</div>
 							{{range .Assignees}}
 								<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
diff --git a/templates/repo/issue/milestone/select_menu.tmpl b/templates/repo/issue/milestone/select_menu.tmpl
index df9b324465..6f8c6c85c2 100644
--- a/templates/repo/issue/milestone/select_menu.tmpl
+++ b/templates/repo/issue/milestone/select_menu.tmpl
@@ -1,20 +1,20 @@
 {{if or .OpenMilestones .ClosedMilestones}}
 	<div class="ui icon search input">
 		<i class="icon">{{svg "octicon-search" 16}}</i>
-		<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_milestones"}}">
+		<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}">
 	</div>
 	<div class="divider"></div>
 {{end}}
-<div class="no-select item">{{.locale.Tr "repo.issues.new.clear_milestone"}}</div>
+<div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
 {{if and (not .OpenMilestones) (not .ClosedMilestones)}}
 	<div class="disabled item">
-		{{.locale.Tr "repo.issues.new.no_items"}}
+		{{ctx.Locale.Tr "repo.issues.new.no_items"}}
 	</div>
 {{else}}
 	{{if .OpenMilestones}}
 		<div class="divider"></div>
 		<div class="header">
-			{{.locale.Tr "repo.issues.new.open_milestone"}}
+			{{ctx.Locale.Tr "repo.issues.new.open_milestone"}}
 		</div>
 		{{range .OpenMilestones}}
 			<a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}">
@@ -26,7 +26,7 @@
 	{{if .ClosedMilestones}}
 		<div class="divider"></div>
 		<div class="header">
-			{{.locale.Tr "repo.issues.new.closed_milestone"}}
+			{{ctx.Locale.Tr "repo.issues.new.closed_milestone"}}
 		</div>
 		{{range .ClosedMilestones}}
 			<a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}">
diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl
index aa3d9b94cd..9d5da13b5d 100644
--- a/templates/repo/issue/milestone_issues.tmpl
+++ b/templates/repo/issue/milestone_issues.tmpl
@@ -8,15 +8,15 @@
 				<div class="text right gt-f1">
 					{{if or .CanWriteIssues .CanWritePulls}}
 						{{if .Milestone.IsClosed}}
-							<a class="ui primary basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{$.locale.Tr "repo.milestones.open"}}
+							<a class="ui primary basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{ctx.Locale.Tr "repo.milestones.open"}}
 							</a>
 						{{else}}
-							<a class="ui red basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/close">{{$.locale.Tr "repo.milestones.close"}}
+							<a class="ui red basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/close">{{ctx.Locale.Tr "repo.milestones.close"}}
 							</a>
 						{{end}}
-						<a class="ui button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{.locale.Tr "repo.milestones.edit"}}</a>
+						<a class="ui button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{ctx.Locale.Tr "repo.milestones.edit"}}</a>
 					{{end}}
-					<a class="ui primary button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}?milestone={{.MilestoneID}}">{{.locale.Tr "repo.issues.new"}}</a>
+					<a class="ui primary button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}?milestone={{.MilestoneID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
 				</div>
 			{{end}}
 		</div>
@@ -29,9 +29,9 @@
 			<progress class="milestone-progress-big" value="{{.Milestone.Completeness}}" max="100"></progress>
 			<div class="gt-df gt-gap-4">
 				<div classs="gt-df gt-ac">
-					{{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.locale}}
+					{{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix ctx.Locale}}
 					{{if .IsClosed}}
-						{{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
+						{{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.milestones.closed" $closedDate | Safe}}
 					{{else}}
 
 						{{if .Milestone.DeadlineString}}
@@ -41,11 +41,11 @@
 							</span>
 						{{else}}
 							{{svg "octicon-calendar"}}
-							{{$.locale.Tr "repo.milestones.no_due_date"}}
+							{{ctx.Locale.Tr "repo.milestones.no_due_date"}}
 						{{end}}
 					{{end}}
 				</div>
-				<div class="gt-mr-3">{{.locale.Tr "repo.milestones.completeness" .Milestone.Completeness | Safe}}</div>
+				<div class="gt-mr-3">{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness | Safe}}</div>
 			</div>
 		</div>
 		<div class="divider"></div>
diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl
index 47a3d93d2b..3e79ee7ee9 100644
--- a/templates/repo/issue/milestone_new.tmpl
+++ b/templates/repo/issue/milestone_new.tmpl
@@ -6,50 +6,50 @@
 			{{template "repo/issue/navbar" .}}
 			{{if and (or .CanWriteIssues .CanWritePulls) .PageIsEditMilestone}}
 				<div class="ui right floated secondary menu">
-					<a class="ui primary button" href="{{$.RepoLink}}/milestones/new">{{.locale.Tr "repo.milestones.new"}}</a>
+					<a class="ui primary button" href="{{$.RepoLink}}/milestones/new">{{ctx.Locale.Tr "repo.milestones.new"}}</a>
 				</div>
 			{{end}}
 		</div>
 		<div class="divider"></div>
 		<h2 class="ui dividing header">
 			{{if .PageIsEditMilestone}}
-				{{.locale.Tr "repo.milestones.edit"}}
-				<div class="sub header">{{.locale.Tr "repo.milestones.edit_subheader"}}</div>
+				{{ctx.Locale.Tr "repo.milestones.edit"}}
+				<div class="sub header">{{ctx.Locale.Tr "repo.milestones.edit_subheader"}}</div>
 			{{else}}
-				{{.locale.Tr "repo.milestones.new"}}
-				<div class="sub header">{{.locale.Tr "repo.milestones.new_subheader"}}</div>
+				{{ctx.Locale.Tr "repo.milestones.new"}}
+				<div class="sub header">{{ctx.Locale.Tr "repo.milestones.new_subheader"}}</div>
 			{{end}}
 		</h2>
 		{{template "base/alert" .}}
 		<form class="ui form" action="{{.Link}}" method="post">
 			{{.CsrfTokenHtml}}
 				<div class="field {{if .Err_Title}}error{{end}}">
-					<label>{{.locale.Tr "repo.milestones.title"}}</label>
-					<input name="title" placeholder="{{.locale.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required maxlength="50">
+					<label>{{ctx.Locale.Tr "repo.milestones.title"}}</label>
+					<input name="title" placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required maxlength="50">
 				</div>
 				<div class="field {{if .Err_Deadline}}error{{end}}">
 					<label>
-						{{.locale.Tr "repo.milestones.due_date"}}
-						<a id="clear-date">{{.locale.Tr "repo.milestones.clear"}}</a>
+						{{ctx.Locale.Tr "repo.milestones.due_date"}}
+						<a id="clear-date">{{ctx.Locale.Tr "repo.milestones.clear"}}</a>
 					</label>
-					<input type="date" id="deadline" name="deadline" value="{{.deadline}}" placeholder="{{.locale.Tr "repo.issues.due_date_form"}}">
+					<input type="date" id="deadline" name="deadline" value="{{.deadline}}" placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}">
 				</div>
 				<div class="field">
-					<label>{{.locale.Tr "repo.milestones.desc"}}</label>
+					<label>{{ctx.Locale.Tr "repo.milestones.desc"}}</label>
 					<textarea name="content">{{.content}}</textarea>
 				</div>
 				<div class="divider"></div>
 				<div class="gt-text-right">
 					{{if .PageIsEditMilestone}}
 						<a class="ui primary basic button" href="{{.RepoLink}}/milestones">
-							{{.locale.Tr "repo.milestones.cancel"}}
+							{{ctx.Locale.Tr "repo.milestones.cancel"}}
 						</a>
 						<button class="ui primary button">
-							{{.locale.Tr "repo.milestones.modify"}}
+							{{ctx.Locale.Tr "repo.milestones.modify"}}
 						</button>
 					{{else}}
 						<button class="ui primary button">
-							{{.locale.Tr "repo.milestones.create"}}
+							{{ctx.Locale.Tr "repo.milestones.create"}}
 						</button>
 					{{end}}
 			</div>
diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl
index a6cb11dde6..ff89d40734 100644
--- a/templates/repo/issue/milestones.tmpl
+++ b/templates/repo/issue/milestones.tmpl
@@ -5,7 +5,7 @@
 		<div class="navbar gt-mb-4">
 			{{template "repo/issue/navbar" .}}
 			{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
-				<a class="ui small primary button" href="{{$.Link}}/new">{{.locale.Tr "repo.milestones.new"}}</a>
+				<a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.milestones.new"}}</a>
 			{{end}}
 		</div>
 		{{template "base/alert" .}}
@@ -14,11 +14,11 @@
 			<div class="small-menu-items ui compact tiny menu list-header-toggle">
 				<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/milestones?state=open&q={{$.Keyword}}">
 					{{svg "octicon-milestone" 16 "gt-mr-3"}}
-					{{.locale.PrettyNumber .OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}
+					{{ctx.Locale.PrettyNumber .OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
 				</a>
 				<a class="item{{if .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/milestones?state=closed&q={{$.Keyword}}">
 					{{svg "octicon-check" 16 "gt-mr-3"}}
-					{{.locale.PrettyNumber .ClosedCount}}&nbsp;{{.locale.Tr "repo.issues.closed_title"}}
+					{{ctx.Locale.PrettyNumber .ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
 				</a>
 			</div>
 
@@ -27,7 +27,7 @@
 				<div class="ui small search fluid action input">
 					<input type="hidden" name="state" value="{{$.State}}">
 					{{template "shared/searchinput" dict "Value" .Keyword}}
-					<button class="ui small icon button" type="submit" aria-label="{{.locale.Tr "explore.search"}}">
+					<button class="ui small icon button" type="submit" aria-label="{{ctx.Locale.Tr "explore.search"}}">
 						{{svg "octicon-search"}}
 					</button>
 				</div>
@@ -36,16 +36,16 @@
 			<!-- Sort -->
 			<div class="list-header-sort ui small dropdown type jump item">
 				<span class="text">
-					{{.locale.Tr "repo.issues.filter_sort"}}
+					{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 				</span>
 				{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				<div class="menu">
-					<a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=closestduedate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.earliest_due_data"}}</a>
-					<a class="{{if eq .SortType "furthestduedate"}}active {{end}}item" href="{{$.Link}}?sort=furthestduedate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.latest_due_date"}}</a>
-					<a class="{{if eq .SortType "leastcomplete"}}active {{end}}item" href="{{$.Link}}?sort=leastcomplete&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.least_complete"}}</a>
-					<a class="{{if eq .SortType "mostcomplete"}}active {{end}}item" href="{{$.Link}}?sort=mostcomplete&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.most_complete"}}</a>
-					<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
-					<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
+					<a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=closestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.earliest_due_data"}}</a>
+					<a class="{{if eq .SortType "furthestduedate"}}active {{end}}item" href="{{$.Link}}?sort=furthestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.latest_due_date"}}</a>
+					<a class="{{if eq .SortType "leastcomplete"}}active {{end}}item" href="{{$.Link}}?sort=leastcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_complete"}}</a>
+					<a class="{{if eq .SortType "mostcomplete"}}active {{end}}item" href="{{$.Link}}?sort=mostcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_complete"}}</a>
+					<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?sort=mostissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
+					<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?sort=leastissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
 				</div>
 			</div>
 		</div>
@@ -68,11 +68,11 @@
 						<div class="group">
 							<div class="flex-text-block">
 								{{svg "octicon-issue-opened" 14}}
-								{{$.locale.PrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
+								{{ctx.Locale.PrettyNumber .NumOpenIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
 							</div>
 							<div class="flex-text-block">
 								{{svg "octicon-check" 14}}
-								{{$.locale.PrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
+								{{ctx.Locale.PrettyNumber .NumClosedIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
 							</div>
 							{{if .TotalTrackedTime}}
 								<div class="flex-text-block">
@@ -83,14 +83,14 @@
 							{{if .UpdatedUnix}}
 								<div class="flex-text-block">
 									{{svg "octicon-clock"}}
-									{{$.locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix $.locale) | Safe}}
+									{{ctx.Locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix ctx.Locale) | Safe}}
 								</div>
 							{{end}}
 							<div class="flex-text-block">
 								{{if .IsClosed}}
-									{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
+									{{$closedDate:= TimeSinceUnix .ClosedDateUnix ctx.Locale}}
 									{{svg "octicon-clock" 14}}
-									{{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
+									{{ctx.Locale.Tr "repo.milestones.closed" $closedDate | Safe}}
 								{{else}}
 									{{if .DeadlineString}}
 										<span class="flex-text-inline {{if .IsOverdue}}text red{{end}}">
@@ -99,20 +99,20 @@
 										</span>
 									{{else}}
 										{{svg "octicon-calendar" 14}}
-										{{$.locale.Tr "repo.milestones.no_due_date"}}
+										{{ctx.Locale.Tr "repo.milestones.no_due_date"}}
 									{{end}}
 								{{end}}
 							</div>
 						</div>
 						{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
 							<div class="group">
-								<a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{$.locale.Tr "repo.issues.label_edit"}}</a>
+								<a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
 								{{if .IsClosed}}
-									<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{$.locale.Tr "repo.milestones.open"}}</a>
+									<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{ctx.Locale.Tr "repo.milestones.open"}}</a>
 								{{else}}
-									<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{$.locale.Tr "repo.milestones.close"}}</a>
+									<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{ctx.Locale.Tr "repo.milestones.close"}}</a>
 								{{end}}
-								<a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a>
+								<a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
 							</div>
 						{{end}}
 					</div>
@@ -133,10 +133,10 @@
 	<div class="ui g-modal-confirm delete modal">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "repo.milestones.deletion"}}
+			{{ctx.Locale.Tr "repo.milestones.deletion"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "repo.milestones.deletion_desc"}}</p>
+			<p>{{ctx.Locale.Tr "repo.milestones.deletion_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/repo/issue/navbar.tmpl b/templates/repo/issue/navbar.tmpl
index 2f1ea7a659..16110597ed 100644
--- a/templates/repo/issue/navbar.tmpl
+++ b/templates/repo/issue/navbar.tmpl
@@ -1,4 +1,4 @@
 <h2 class="ui compact small menu header small-menu-items issue-list-navbar">
-	<a class="{{if .PageIsLabels}}active {{end}}item" href="{{.RepoLink}}/labels">{{.locale.Tr "repo.labels"}}</a>
-	<a class="{{if .PageIsMilestones}}active {{end}}item" href="{{.RepoLink}}/milestones">{{.locale.Tr "repo.milestones"}}</a>
+	<a class="{{if .PageIsLabels}}active {{end}}item" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a>
+	<a class="{{if .PageIsMilestones}}active {{end}}item" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a>
 </h2>
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl
index 9d0b666375..6502a8d889 100644
--- a/templates/repo/issue/new_form.tmpl
+++ b/templates/repo/issue/new_form.tmpl
@@ -11,9 +11,9 @@
 				{{ctx.AvatarUtils.Avatar .SignedUser 40}}
 				<div class="ui segment content gt-my-0">
 					<div class="field">
-						<input name="title" id="issue_title" placeholder="{{.locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" autofocus required maxlength="255" autocomplete="off">
+						<input name="title" id="issue_title" placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" autofocus required maxlength="255" autocomplete="off">
 						{{if .PageIsComparePull}}
-							<div class="title_wip_desc" data-wip-prefixes="{{JsonUtils.EncodeToString .PullRequestWorkInProgressPrefixes}}">{{.locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}</div>
+							<div class="title_wip_desc" data-wip-prefixes="{{JsonUtils.EncodeToString .PullRequestWorkInProgressPrefixes}}">{{ctx.Locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}</div>
 						{{end}}
 					</div>
 					{{if .Fields}}
@@ -37,9 +37,9 @@
 					<div class="text right">
 						<button class="ui primary button">
 							{{if .PageIsComparePull}}
-								{{.locale.Tr "repo.pulls.create"}}
+								{{ctx.Locale.Tr "repo.pulls.create"}}
 							{{else}}
-								{{.locale.Tr "repo.issues.create"}}
+								{{ctx.Locale.Tr "repo.issues.create"}}
 							{{end}}
 						</button>
 					</div>
@@ -60,7 +60,7 @@
 		<input id="milestone_id" name="milestone_id" type="hidden" value="{{.milestone_id}}">
 		<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating jump select-milestone dropdown">
 			<span class="text flex-text-block">
-				<strong>{{.locale.Tr "repo.issues.new.milestone"}}</strong>
+				<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong>
 				{{if .HasIssuesOrPullsWritePermission}}
 					{{svg "octicon-gear" 16 "gt-ml-2"}}
 				{{end}}
@@ -70,7 +70,7 @@
 			</div>
 		</div>
 		<div class="ui select-milestone list">
-			<span class="no-select item {{if .Milestone}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_milestone"}}</span>
+			<span class="no-select item {{if .Milestone}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_milestone"}}</span>
 			<div class="selected">
 				{{if .Milestone}}
 					<a class="item muted sidebar-item-link" href="{{.RepoLink}}/issues?milestone={{.Milestone.ID}}">
@@ -87,7 +87,7 @@
 		<input id="project_id" name="project_id" type="hidden" value="{{.project_id}}">
 		<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating jump select-project dropdown">
 			<span class="text flex-text-block">
-				<strong>{{.locale.Tr "repo.issues.new.projects"}}</strong>
+				<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong>
 				{{if .HasIssuesOrPullsWritePermission}}
 					{{svg "octicon-gear" 16 "gt-ml-2"}}
 				{{end}}
@@ -96,19 +96,19 @@
 				{{if or .OpenProjects .ClosedProjects}}
 				<div class="ui icon search input">
 					<i class="icon">{{svg "octicon-search" 16}}</i>
-					<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_projects"}}">
+					<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}">
 				</div>
 				{{end}}
-				<div class="no-select item">{{.locale.Tr "repo.issues.new.clear_projects"}}</div>
+				<div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
 				{{if and (not .OpenProjects) (not .ClosedProjects)}}
 					<div class="disabled item">
-						{{.locale.Tr "repo.issues.new.no_items"}}
+						{{ctx.Locale.Tr "repo.issues.new.no_items"}}
 					</div>
 				{{else}}
 					{{if .OpenProjects}}
 						<div class="divider"></div>
 						<div class="header">
-							{{.locale.Tr "repo.issues.new.open_projects"}}
+							{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
 						</div>
 						{{range .OpenProjects}}
 							<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
@@ -119,7 +119,7 @@
 					{{if .ClosedProjects}}
 						<div class="divider"></div>
 						<div class="header">
-							{{.locale.Tr "repo.issues.new.closed_projects"}}
+							{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
 						</div>
 						{{range .ClosedProjects}}
 							<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
@@ -131,7 +131,7 @@
 			</div>
 		</div>
 		<div class="ui select-project list">
-			<span class="no-select item {{if .Project}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span>
+			<span class="no-select item {{if .Project}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span>
 			<div class="selected">
 				{{if .Project}}
 					<a class="item muted sidebar-item-link" href="{{.Project.Link}}">
@@ -145,7 +145,7 @@
 			<input id="assignee_ids" name="assignee_ids" type="hidden" value="{{.assignee_ids}}">
 			<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating jump select-assignees dropdown">
 				<span class="text flex-text-block">
-					<strong>{{.locale.Tr "repo.issues.new.assignees"}}</strong>
+					<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong>
 					{{if .HasIssuesOrPullsWritePermission}}
 						{{svg "octicon-gear" 16 "gt-ml-2"}}
 					{{end}}
@@ -153,9 +153,9 @@
 				<div class="filter menu" data-id="#assignee_ids">
 					<div class="ui icon search input">
 						<i class="icon">{{svg "octicon-search" 16}}</i>
-						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignees"}}">
+						<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
 					</div>
-					<div class="no-select item">{{.locale.Tr "repo.issues.new.clear_assignees"}}</div>
+					<div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
 					{{range .Assignees}}
 						<a class="item muted" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}">
 							<span class="octicon-check gt-invisible">{{svg "octicon-check"}}</span>
@@ -168,7 +168,7 @@
 			</div>
 			<div class="ui assignees list">
 				<span class="no-select item {{if .HasSelectedLabel}}gt-hidden{{end}}">
-					{{.locale.Tr "repo.issues.new.no_assignees"}}
+					{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}
 				</span>
 				<div class="selected">
 				{{range .Assignees}}
@@ -182,7 +182,7 @@
 			<div class="divider"></div>
 			<div class="inline field">
 				<div class="ui checkbox">
-					<label data-tooltip-content="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"><strong>{{.locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
+					<label data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"><strong>{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
 					<input name="allow_maintainer_edit" type="checkbox" {{if .AllowMaintainerEdit}}checked{{end}}>
 				</div>
 			</div>
diff --git a/templates/repo/issue/openclose.tmpl b/templates/repo/issue/openclose.tmpl
index a5916ed793..a215922afc 100644
--- a/templates/repo/issue/openclose.tmpl
+++ b/templates/repo/issue/openclose.tmpl
@@ -5,10 +5,10 @@
 		{{else}}
 			{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
 		{{end}}
-		{{.locale.PrettyNumber .IssueStats.OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}
+		{{ctx.Locale.PrettyNumber .IssueStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
 	</a>
 	<a class="{{if .IsShowClosed}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&project={{.ProjectID}}&assignee={{.AssigneeID}}&poster={{.PosterID}}">
 		{{svg "octicon-check" 16 "gt-mr-3"}}
-		{{.locale.PrettyNumber .IssueStats.ClosedCount}}&nbsp;{{.locale.Tr "repo.issues.closed_title"}}
+		{{ctx.Locale.PrettyNumber .IssueStats.ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
 	</a>
 </div>
diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl
index fc9797c781..822700c652 100644
--- a/templates/repo/issue/search.tmpl
+++ b/templates/repo/issue/search.tmpl
@@ -9,8 +9,8 @@
 		<input type="hidden" name="poster" value="{{$.PosterID}}">
 		{{template "shared/searchinput" dict "Value" .Keyword}}
 		{{if .PageIsIssueList}}
-			<button id="issue-list-quick-goto" class="ui small icon button gt-hidden" data-tooltip-content="{{.locale.Tr "explore.go_to"}}" data-repo-link="{{.RepoLink}}">{{svg "octicon-hash"}}</button>
+			<button id="issue-list-quick-goto" class="ui small icon button gt-hidden" data-tooltip-content="{{ctx.Locale.Tr "explore.go_to"}}" data-repo-link="{{.RepoLink}}">{{svg "octicon-hash"}}</button>
 		{{end}}
-		<button class="ui small icon button" aria-label="{{.locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button>
+		<button class="ui small icon button" aria-label="{{ctx.Locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button>
 	</div>
 </form>
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index 5450df0a7a..c17919f5bf 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -6,7 +6,7 @@
 	<input type="hidden" id="issueIndex" value="{{.Issue.Index}}">
 	<input type="hidden" id="type" value="{{.IssueType}}">
 
-	{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
+	{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}}
 	<div class="issue-content-left comment-list prevent-before-timeline">
 		<div class="ui timeline">
 			<div id="{{.Issue.HashTag}}" class="timeline-item comment first">
@@ -28,10 +28,10 @@
 									{{.Issue.OriginalAuthor}}
 								</span>
 								<span class="text grey muted-links">
-									{{.locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}}
+									{{ctx.Locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}}
 								</span>
 								<span class="text migrate">
-									{{if .Repository.OriginalURL}} ({{$.locale.Tr "repo.migrated_from" (.Repository.OriginalURL|Escape) (.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}
+									{{if .Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" (.Repository.OriginalURL|Escape) (.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}
 								</span>
 							{{else}}
 								<a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}">
@@ -39,7 +39,7 @@
 								</a>
 								<span class="text grey muted-links">
 									{{template "shared/user/authorlink" .Issue.Poster}}
-									{{.locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}}
+									{{ctx.Locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}}
 								</span>
 							{{end}}
 						</div>
@@ -56,7 +56,7 @@
 							{{if .Issue.RenderedContent}}
 								{{.Issue.RenderedContent|Str2html}}
 							{{else}}
-								<span class="no-content">{{.locale.Tr "repo.issues.no_content"}}</span>
+								<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
 							{{end}}
 						</div>
 						<div id="issue-{{.Issue.ID}}-raw" class="raw-content gt-hidden">{{.Issue.Content}}</div>
@@ -92,21 +92,21 @@
 								<div class="text right">
 									{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}}
 										{{if .Issue.IsClosed}}
-											<button id="status-button" class="ui primary basic button" tabindex="6" data-status="{{.locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen">
-												{{.locale.Tr "repo.issues.reopen_issue"}}
+											<button id="status-button" class="ui primary basic button" tabindex="6" data-status="{{ctx.Locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{ctx.Locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen">
+												{{ctx.Locale.Tr "repo.issues.reopen_issue"}}
 											</button>
 										{{else}}
 											{{$closeTranslationKey := "repo.issues.close"}}
 											{{if .Issue.IsPull}}
 												{{$closeTranslationKey = "repo.pulls.close"}}
 											{{end}}
-											<button id="status-button" class="ui red basic button" tabindex="6" data-status="{{.locale.Tr $closeTranslationKey}}" data-status-and-comment="{{.locale.Tr "repo.issues.close_comment_issue"}}" name="status" value="close">
-												{{.locale.Tr $closeTranslationKey}}
+											<button id="status-button" class="ui red basic button" tabindex="6" data-status="{{ctx.Locale.Tr $closeTranslationKey}}" data-status-and-comment="{{ctx.Locale.Tr "repo.issues.close_comment_issue"}}" name="status" value="close">
+												{{ctx.Locale.Tr $closeTranslationKey}}
 											</button>
 										{{end}}
 									{{end}}
 									<button class="ui primary button" tabindex="5">
-										{{.locale.Tr "repo.issues.create_comment"}}
+										{{ctx.Locale.Tr "repo.issues.create_comment"}}
 									</button>
 								</div>
 							</div>
@@ -116,9 +116,9 @@
 				{{else if .Repository.IsArchived}}
 					<div class="ui warning message gt-text-center">
 						{{if .Issue.IsPull}}
-							{{.locale.Tr "repo.archive.pull.nocomment"}}
+							{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}
 						{{else}}
-							{{.locale.Tr "repo.archive.issue.nocomment"}}
+							{{ctx.Locale.Tr "repo.archive.issue.nocomment"}}
 						{{end}}
 					</div>
 				{{end}}
@@ -126,14 +126,14 @@
 				{{if .Repository.IsArchived}}
 					<div class="ui warning message gt-text-center">
 						{{if .Issue.IsPull}}
-							{{.locale.Tr "repo.archive.pull.nocomment"}}
+							{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}
 						{{else}}
-							{{.locale.Tr "repo.archive.issue.nocomment"}}
+							{{ctx.Locale.Tr "repo.archive.issue.nocomment"}}
 						{{end}}
 					</div>
 				{{else}}
 					<div class="ui warning message">
-						{{.locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape) | Safe}}
+						{{ctx.Locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape) | Safe}}
 					</div>
 				{{end}}
 			{{end}}{{/* end if: .IsSigned */}}
@@ -162,8 +162,8 @@
 
 		<div class="field">
 			<div class="text right edit">
-				<button class="ui basic cancel button" tabindex="3">{{.locale.Tr "repo.issues.cancel"}}</button>
-				<button class="ui primary save button" tabindex="2">{{.locale.Tr "repo.issues.save"}}</button>
+				<button class="ui basic cancel button" tabindex="3">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
+				<button class="ui primary save button" tabindex="2">{{ctx.Locale.Tr "repo.issues.save"}}</button>
 			</div>
 		</div>
 	</div>
@@ -172,16 +172,16 @@
 {{template "repo/issue/view_content/reference_issue_dialog" .}}
 
 <div class="gt-hidden" id="no-content">
-	<span class="no-content">{{.locale.Tr "repo.issues.no_content"}}</span>
+	<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
 </div>
 
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.branch.delete" .HeadTarget}}
+		{{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p>
+		<p>{{ctx.Locale.Tr "repo.branch.delete_desc" | Str2html}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/repo/issue/view_content/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl
index b74b6ce918..1fb6f2f2c2 100644
--- a/templates/repo/issue/view_content/attachments.tmpl
+++ b/templates/repo/issue/view_content/attachments.tmpl
@@ -6,7 +6,7 @@
 	{{- range .Attachments -}}
 		<div class="gt-df">
 			<div class="gt-f1 gt-p-3">
-				<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title="{{$.ctxData.locale.Tr "repo.issues.attachment.open_tab" .Name}}">
+				<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
 					{{if FilenameIsImage .Name}}
 						{{if not (StringUtils.Contains $.Content .UUID)}}
 							{{$hasThumbnails = true}}
@@ -31,7 +31,7 @@
 				{{if FilenameIsImage .Name}}
 					{{if not (StringUtils.Contains $.Content .UUID)}}
 					<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
-						<img alt="{{.Name}}" src="{{.DownloadURL}}" title="{{$.ctxData.locale.Tr "repo.issues.attachment.open_tab" .Name}}">
+						<img alt="{{.Name}}" src="{{.DownloadURL}}" title="{{ctx.Locale.Tr "repo.issues.attachment.open_tab" .Name}}">
 					</a>
 					{{end}}
 				{{end}}
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 6b75f9f9e3..d417371272 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -1,7 +1,7 @@
 {{template "base/alert"}}
 {{range .Issue.Comments}}
 	{{if call $.ShouldShowCommentType .Type}}
-		{{$createdStr:= TimeSinceUnix .CreatedUnix $.locale}}
+		{{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
 
 		<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF,
 		5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING,
@@ -32,10 +32,10 @@
 									{{.OriginalAuthor}}
 								</span>
 								<span class="text grey muted-links">
-									{{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}}
+									{{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}}
 								</span>
 								<span class="text migrate">
-									({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}
+									({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}
 								</span>
 							{{else}}
 								{{if gt .Poster.ID 0}}
@@ -45,7 +45,7 @@
 								{{end}}
 								<span class="text grey muted-links">
 									{{template "shared/user/authorlink" .Poster}}
-									{{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
+									{{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
 								</span>
 							{{end}}
 						</div>
@@ -62,7 +62,7 @@
 							{{if .RenderedContent}}
 								{{.RenderedContent|Str2html}}
 							{{else}}
-								<span class="no-content">{{$.locale.Tr "repo.issues.no_content"}}</span>
+								<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
 							{{end}}
 						</div>
 						<div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div>
@@ -84,9 +84,9 @@
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
 					{{if .Issue.IsPull}}
-						{{$.locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}}
 					{{else}}
-						{{$.locale.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}
 					{{end}}
 				</span>
 			</div>
@@ -97,9 +97,9 @@
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
 					{{if .Issue.IsPull}}
-						{{$.locale.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}}
 					{{else}}
-						{{$.locale.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}
 					{{end}}
 				</span>
 			</div>
@@ -111,16 +111,16 @@
 					{{template "shared/user/authorlink" .Poster}}
 					{{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}}
 					{{if eq $.Issue.PullRequest.Status 3}}
-						{{$.locale.Tr "repo.issues.comment_manually_pull_merged_at" (printf `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID)) (printf "<b>%[1]s</b>" ($.BaseTarget|Escape)) $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.comment_manually_pull_merged_at" (printf `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID)) (printf "<b>%[1]s</b>" ($.BaseTarget|Escape)) $createdStr | Safe}}
 					{{else}}
-						{{$.locale.Tr "repo.issues.comment_pull_merged_at" (printf `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID)) (printf "<b>%[1]s</b>" ($.BaseTarget|Escape)) $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.comment_pull_merged_at" (printf `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID)) (printf "<b>%[1]s</b>" ($.BaseTarget|Escape)) $createdStr | Safe}}
 					{{end}}
 				</span>
 			</div>
 		{{else if eq .Type 3 5 6}}
 			{{$refFrom:= ""}}
 			{{if ne .RefRepoID .Issue.RepoID}}
-				{{$refFrom = $.locale.Tr "repo.issues.ref_from" (.RefRepo.FullName|Escape)}}
+				{{$refFrom = ctx.Locale.Tr "repo.issues.ref_from" (.RefRepo.FullName|Escape)}}
 			{{end}}
 			{{$refTr := "repo.issues.ref_issue_from"}}
 			{{if .Issue.IsPull}}
@@ -130,14 +130,14 @@
 			{{else if eq .RefAction 2}}
 				{{$refTr = "repo.issues.ref_reopening_from"}}
 			{{end}}
-			{{$createdStr:= TimeSinceUnix .CreatedUnix $.locale}}
+			{{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
 			<div class="timeline-item event" id="{{.HashTag}}">
 				<span class="badge">{{svg "octicon-bookmark"}}</span>
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				{{if eq .RefAction 3}}<del>{{end}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentLink|Escape) $refFrom | Safe}}
+					{{ctx.Locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentLink|Escape) $refFrom | Safe}}
 				</span>
 				{{if eq .RefAction 3}}</del>{{end}}
 
@@ -151,7 +151,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}
 				</span>
 				<div class="detail">
 					{{svg "octicon-git-commit"}}
@@ -166,11 +166,11 @@
 					<span class="text grey muted-links">
 						{{template "shared/user/authorlink" .Poster}}
 						{{if and .AddedLabels (not .RemovedLabels)}}
-							{{$.locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels $.Context .AddedLabels $.RepoLink) $createdStr | Safe}}
+							{{ctx.Locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels $.Context .AddedLabels $.RepoLink) $createdStr | Safe}}
 						{{else if and (not .AddedLabels) .RemovedLabels}}
-							{{$.locale.TrN (len .RemovedLabels) "repo.issues.remove_label" "repo.issues.remove_labels" (RenderLabels $.Context .RemovedLabels $.RepoLink) $createdStr | Safe}}
+							{{ctx.Locale.TrN (len .RemovedLabels) "repo.issues.remove_label" "repo.issues.remove_labels" (RenderLabels $.Context .RemovedLabels $.RepoLink) $createdStr | Safe}}
 						{{else}}
-							{{$.locale.Tr "repo.issues.add_remove_labels" (RenderLabels $.Context .AddedLabels $.RepoLink) (RenderLabels $.Context .RemovedLabels $.RepoLink) $createdStr | Safe}}
+							{{ctx.Locale.Tr "repo.issues.add_remove_labels" (RenderLabels $.Context .AddedLabels $.RepoLink) (RenderLabels $.Context .RemovedLabels $.RepoLink) $createdStr | Safe}}
 						{{end}}
 					</span>
 				</div>
@@ -181,7 +181,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.locale.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}
+					{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{ctx.Locale.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}
 				</span>
 			</div>
 		{{else if eq .Type 9}}
@@ -193,9 +193,9 @@
 						<span class="text grey muted-links">
 							{{template "shared/user/authorlink" .Assignee}}
 							{{if eq .Poster.ID .Assignee.ID}}
-								{{$.locale.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
+								{{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
 							{{else}}
-								{{$.locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
+								{{ctx.Locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
 							{{end}}
 						</span>
 					{{else}}
@@ -203,9 +203,9 @@
 						<span class="text grey muted-links">
 							{{template "shared/user/authorlink" .Assignee}}
 							{{if eq .Poster.ID .AssigneeID}}
-								{{$.locale.Tr "repo.issues.self_assign_at" $createdStr | Safe}}
+								{{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr | Safe}}
 							{{else}}
-								{{$.locale.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
+								{{ctx.Locale.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
 							{{end}}
 						</span>
 					{{end}}
@@ -217,7 +217,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji $.Context) (.NewTitle|RenderEmoji $.Context) $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji $.Context) (.NewTitle|RenderEmoji $.Context) $createdStr | Safe}}
 				</span>
 			</div>
 		{{else if eq .Type 11}}
@@ -226,7 +226,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}}
 				</span>
 			</div>
 		{{else if eq .Type 12}}
@@ -235,7 +235,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.start_tracking_history" $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.start_tracking_history" $createdStr | Safe}}
 				</span>
 			</div>
 		{{else if eq .Type 13}}
@@ -244,7 +244,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}}
 				</span>
 				{{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}}
 				<div class="detail">
@@ -263,7 +263,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.add_time_history" $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.add_time_history" $createdStr | Safe}}
 				</span>
 				{{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}}
 				<div class="detail">
@@ -282,7 +282,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}
 				</span>
 			</div>
 		{{else if eq .Type 16}}
@@ -291,7 +291,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.due_date_added" (DateTime "long" .Content) $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.due_date_added" (DateTime "long" .Content) $createdStr | Safe}}
 				</span>
 			</div>
 		{{else if eq .Type 17}}
@@ -304,7 +304,7 @@
 					{{if eq (len $parsedDeadline) 2}}
 						{{$from := DateTime "long" (index $parsedDeadline 1)}}
 						{{$to := DateTime "long" (index $parsedDeadline 0)}}
-						{{$.locale.Tr "repo.issues.due_date_modified" $to $from $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.due_date_modified" $to $from $createdStr | Safe}}
 					{{end}}
 				</span>
 			</div>
@@ -314,7 +314,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.due_date_remove" (DateTime "long" .Content) $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.due_date_remove" (DateTime "long" .Content) $createdStr | Safe}}
 				</span>
 			</div>
 		{{else if eq .Type 19}}
@@ -323,7 +323,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}}
 				</span>
 				{{if .DependentIssue}}
 					<div class="detail">
@@ -346,7 +346,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}}
 				</span>
 				{{if .DependentIssue}}
 					<div class="detail">
@@ -383,22 +383,22 @@
 								{{.OriginalAuthor}}
 							</span>
 							<span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span>
-							<span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
+							<span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
 						{{else}}
 							{{template "shared/user/authorlink" .Poster}}
 						{{end}}
 
 						{{if eq .Review.Type 1}}
-							{{$.locale.Tr "repo.issues.review.approve" $createdStr | Safe}}
+							{{ctx.Locale.Tr "repo.issues.review.approve" $createdStr | Safe}}
 						{{else if eq .Review.Type 2}}
-							{{$.locale.Tr "repo.issues.review.comment" $createdStr | Safe}}
+							{{ctx.Locale.Tr "repo.issues.review.comment" $createdStr | Safe}}
 						{{else if eq .Review.Type 3}}
-							{{$.locale.Tr "repo.issues.review.reject" $createdStr | Safe}}
+							{{ctx.Locale.Tr "repo.issues.review.reject" $createdStr | Safe}}
 						{{else}}
-							{{$.locale.Tr "repo.issues.review.comment" $createdStr | Safe}}
+							{{ctx.Locale.Tr "repo.issues.review.comment" $createdStr | Safe}}
 						{{end}}
 						{{if .Review.Dismissed}}
-							<div class="ui small label">{{$.locale.Tr "repo.issues.review.dismissed_label"}}</div>
+							<div class="ui small label">{{ctx.Locale.Tr "repo.issues.review.dismissed_label"}}</div>
 						{{end}}
 					</span>
 				</div>
@@ -419,12 +419,12 @@
 											{{.OriginalAuthor}}
 										</span>
 										<span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span>
-										<span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
+										<span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
 									{{else}}
 										{{template "shared/user/authorlink" .Poster}}
 									{{end}}
 
-									{{$.locale.Tr "repo.issues.review.left_comment" | Safe}}
+									{{ctx.Locale.Tr "repo.issues.review.left_comment" | Safe}}
 								</span>
 							</div>
 							<div class="comment-header-right actions gt-df gt-ac">
@@ -440,7 +440,7 @@
 								{{if .RenderedContent}}
 									{{.RenderedContent|Str2html}}
 								{{else}}
-									<span class="no-content">{{$.locale.Tr "repo.issues.no_content"}}</span>
+									<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
 								{{end}}
 							</div>
 							<div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div>
@@ -470,8 +470,8 @@
 										<div class="gt-df gt-ac">
 											<a href="{{(index $comms 0).CodeCommentLink}}" class="file-comment gt-ml-3 gt-word-break">{{$filename}}</a>
 											{{if $invalid}}
-												<span class="ui label basic small gt-ml-3" data-tooltip-content="{{$.locale.Tr "repo.issues.review.outdated_description"}}">
-													{{$.locale.Tr "repo.issues.review.outdated"}}
+												<span class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
+													{{ctx.Locale.Tr "repo.issues.review.outdated"}}
 												</span>
 											{{end}}
 										</div>
@@ -480,17 +480,17 @@
 												<button id="show-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if not $resolved}}gt-hidden {{end}}ui compact labeled button show-outdated gt-df gt-ac">
 													{{svg "octicon-unfold" 16 "gt-mr-3"}}
 													{{if $resolved}}
-														{{$.locale.Tr "repo.issues.review.show_resolved"}}
+														{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
 													{{else}}
-														{{$.locale.Tr "repo.issues.review.show_outdated"}}
+														{{ctx.Locale.Tr "repo.issues.review.show_outdated"}}
 													{{end}}
 												</button>
 												<button id="hide-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if $resolved}}gt-hidden {{end}}ui compact labeled button hide-outdated gt-df gt-ac">
 													{{svg "octicon-fold" 16 "gt-mr-3"}}
 													{{if $resolved}}
-														{{$.locale.Tr "repo.issues.review.hide_resolved"}}
+														{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
 													{{else}}
-														{{$.locale.Tr "repo.issues.review.hide_outdated"}}
+														{{ctx.Locale.Tr "repo.issues.review.hide_outdated"}}
 													{{end}}
 												</button>
 											{{end}}
@@ -514,7 +514,7 @@
 									<div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} gt-hidden{{end}}">
 										<div class="ui comments gt-mb-0">
 											{{range $comms}}
-												{{$createdSubStr:= TimeSinceUnix .CreatedUnix $.locale}}
+												{{$createdSubStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
 												<div class="comment code-comment gt-pb-4" id="{{.HashTag}}">
 													<div class="content">
 														<div class="header comment-header">
@@ -531,11 +531,11 @@
 																			{{.OriginalAuthor}}
 																		</span>
 																		<span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span>
-																		<span class="text migrate">({{$.locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
+																		<span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
 																	{{else}}
 																		{{template "shared/user/authorlink" .Poster}}
 																	{{end}}
-																	{{$.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdSubStr | Safe}}
+																	{{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdSubStr | Safe}}
 																</span>
 															</div>
 															<div class="comment-header-right actions gt-df gt-ac">
@@ -551,7 +551,7 @@
 															{{if .RenderedContent}}
 																{{.RenderedContent|Str2html}}
 															{{else}}
-																<span class="no-content">{{$.locale.Tr "repo.issues.no_content"}}</span>
+																<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
 															{{end}}
 															</div>
 															<div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div>
@@ -570,7 +570,7 @@
 												{{if $resolved}}
 													<div class="ui grey text">
 														{{svg "octicon-check" 16 "gt-mr-2"}}
-														<b>{{$resolveDoer.Name}}</b> {{$.locale.Tr "repo.issues.review.resolved_by"}}
+														<b>{{$resolveDoer.Name}}</b> {{ctx.Locale.Tr "repo.issues.review.resolved_by"}}
 													</div>
 												{{end}}
 											</div>
@@ -578,15 +578,15 @@
 												{{if and $.CanMarkConversation $isNotPending}}
 													<button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $comms 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
 														{{if $resolved}}
-															{{$.locale.Tr "repo.issues.review.un_resolve_conversation"}}
+															{{ctx.Locale.Tr "repo.issues.review.un_resolve_conversation"}}
 														{{else}}
-															{{$.locale.Tr "repo.issues.review.resolve_conversation"}}
+															{{ctx.Locale.Tr "repo.issues.review.resolve_conversation"}}
 														{{end}}
 													</button>
 												{{end}}
 												{{if and $.SignedUserID (not $.Repository.IsArchived)}}
 													<button class="comment-form-reply ui primary tiny labeled icon button gt-ml-2 gt-mr-0">
-														{{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{$.locale.Tr "repo.diff.comment.reply"}}
+														{{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{ctx.Locale.Tr "repo.diff.comment.reply"}}
 													</button>
 												{{end}}
 											</div>
@@ -606,12 +606,12 @@
 				{{if .Content}}
 					<span class="text grey muted-links">
 						{{template "shared/user/authorlink" .Poster}}
-						{{$.locale.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}}
 					</span>
 				{{else}}
 					<span class="text grey muted-links">
 						{{template "shared/user/authorlink" .Poster}}
-						{{$.locale.Tr "repo.issues.lock_no_reason" $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.lock_no_reason" $createdStr | Safe}}
 					</span>
 				{{end}}
 			</div>
@@ -621,7 +621,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{$.locale.Tr "repo.issues.unlock_comment" $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.unlock_comment" $createdStr | Safe}}
 				</span>
 			</div>
 		{{else if eq .Type 25}}
@@ -630,7 +630,7 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					<a{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a>
-					{{$.locale.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
 				</span>
 			</div>
 		{{else if eq .Type 26}}
@@ -640,7 +640,7 @@
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
 
-					{{$.locale.Tr "repo.issues.del_time_history" $createdStr | Safe}}
+					{{ctx.Locale.Tr "repo.issues.del_time_history" $createdStr | Safe}}
 				</span>
 				<div class="detail">
 					{{svg "octicon-clock"}}
@@ -661,12 +661,12 @@
 					{{if (gt .AssigneeID 0)}}
 						{{if .RemovedAssignee}}
 							{{if eq .PosterID .AssigneeID}}
-								{{$.locale.Tr "repo.issues.review.remove_review_request_self" $createdStr | Safe}}
+								{{ctx.Locale.Tr "repo.issues.review.remove_review_request_self" $createdStr | Safe}}
 							{{else}}
-								{{$.locale.Tr "repo.issues.review.remove_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
+								{{ctx.Locale.Tr "repo.issues.review.remove_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
 							{{end}}
 						{{else}}
-							{{$.locale.Tr "repo.issues.review.add_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
+							{{ctx.Locale.Tr "repo.issues.review.add_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
 						{{end}}
 					{{else}}
 						<!-- If the assigned team is deleted, just displaying "Ghost Team" in the comment -->
@@ -675,9 +675,9 @@
 							{{$teamName = .AssigneeTeam.Name}}
 						{{end}}
 						{{if .RemovedAssignee}}
-							{{$.locale.Tr "repo.issues.review.remove_review_request" ($teamName|Escape) $createdStr | Safe}}
+							{{ctx.Locale.Tr "repo.issues.review.remove_review_request" ($teamName|Escape) $createdStr | Safe}}
 						{{else}}
-							{{$.locale.Tr "repo.issues.review.add_review_request" ($teamName|Escape) $createdStr | Safe}}
+							{{ctx.Locale.Tr "repo.issues.review.add_review_request" ($teamName|Escape) $createdStr | Safe}}
 						{{end}}
 					{{end}}
 				</span>
@@ -692,14 +692,14 @@
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
 					{{if .IsForcePush}}
-						{{$.locale.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape) (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape) (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr | Safe}}
 					{{else}}
-						{{$.locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr | Safe}}
+						{{ctx.Locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr | Safe}}
 					{{end}}
 				</span>
 				{{if and .IsForcePush $.Issue.PullRequest.BaseRepo.Name}}
 				<span class="gt-float-right comparebox">
-					<a href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow" class="ui compare label">{{$.locale.Tr "repo.issues.force_push_compare"}}</a>
+					<a href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow" class="ui compare label">{{ctx.Locale.Tr "repo.issues.force_push_compare"}}</a>
 				</span>
 				{{end}}
 			</div>
@@ -716,19 +716,19 @@
 					{{$oldProjectDisplayHtml := "Unknown Project"}}
 					{{if .OldProject}}
 						{{$trKey := printf "projects.type-%d.display_name" .OldProject.Type}}
-						{{$oldProjectDisplayHtml = printf `<span data-tooltip-content="%s">%s</span>` ($.locale.Tr $trKey | Escape) (.OldProject.Title | Escape)}}
+						{{$oldProjectDisplayHtml = printf `<span data-tooltip-content="%s">%s</span>` (ctx.Locale.Tr $trKey | Escape) (.OldProject.Title | Escape)}}
 					{{end}}
 					{{$newProjectDisplayHtml := "Unknown Project"}}
 					{{if .Project}}
 						{{$trKey := printf "projects.type-%d.display_name" .Project.Type}}
-						{{$newProjectDisplayHtml = printf `<span data-tooltip-content="%s">%s</span>` ($.locale.Tr $trKey | Escape) (.Project.Title | Escape)}}
+						{{$newProjectDisplayHtml = printf `<span data-tooltip-content="%s">%s</span>` (ctx.Locale.Tr $trKey | Escape) (.Project.Title | Escape)}}
 					{{end}}
 					{{if and (gt .OldProjectID 0) (gt .ProjectID 0)}}
-						{{$.locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr | Safe}}
 					{{else if gt .OldProjectID 0}}
-						{{$.locale.Tr "repo.issues.remove_project_at" $oldProjectDisplayHtml $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.remove_project_at" $oldProjectDisplayHtml $createdStr | Safe}}
 					{{else if gt .ProjectID 0}}
-						{{$.locale.Tr "repo.issues.add_project_at" $newProjectDisplayHtml $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.add_project_at" $newProjectDisplayHtml $createdStr | Safe}}
 					{{end}}
 				</span>
 			</div>
@@ -748,7 +748,7 @@
 						{{else}}
 							{{$reviewerName = .Review.OriginalAuthor}}
 						{{end}}
-						{{$.locale.Tr "repo.issues.review.dismissed" $reviewerName $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.review.dismissed" $reviewerName $createdStr | Safe}}
 					</span>
 				</div>
 				{{if .Content}}
@@ -761,7 +761,7 @@
 									</a>
 								{{end}}
 								<span class="text grey muted-links">
-									{{$.locale.Tr "action.review_dismissed_reason"}}
+									{{ctx.Locale.Tr "action.review_dismissed_reason"}}
 								</span>
 							</div>
 							<div class="ui attached segment">
@@ -769,7 +769,7 @@
 									{{if .RenderedContent}}
 										{{.RenderedContent|Str2html}}
 									{{else}}
-										<span class="no-content">{{$.locale.Tr "repo.issues.no_content"}}</span>
+										<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
 									{{end}}
 								</div>
 							</div>
@@ -784,11 +784,11 @@
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
 					{{if and .OldRef .NewRef}}
-						{{$.locale.Tr "repo.issues.change_ref_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.change_ref_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
 					{{else if .OldRef}}
-						{{$.locale.Tr "repo.issues.remove_ref_at" (.OldRef|Escape) $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.remove_ref_at" (.OldRef|Escape) $createdStr | Safe}}
 					{{else}}
-						{{$.locale.Tr "repo.issues.add_ref_at" (.NewRef|Escape) $createdStr | Safe}}
+						{{ctx.Locale.Tr "repo.issues.add_ref_at" (.NewRef|Escape) $createdStr | Safe}}
 					{{end}}
 				</span>
 			</div>
@@ -797,8 +797,8 @@
 				<span class="badge">{{svg "octicon-git-merge" 16}}</span>
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{if eq .Type 34}}{{$.locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr | Safe}}
-					{{else}}{{$.locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr | Safe}}{{end}}
+					{{if eq .Type 34}}{{ctx.Locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr | Safe}}
+					{{else}}{{ctx.Locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr | Safe}}{{end}}
 				</span>
 			</div>
 		{{else if or (eq .Type 36) (eq .Type 37)}}
@@ -807,8 +807,8 @@
 				{{template "shared/user/avatarlink" dict "user" .Poster}}
 				<span class="text grey muted-links">
 					{{template "shared/user/authorlink" .Poster}}
-					{{if eq .Type 36}}{{$.locale.Tr "repo.issues.pin_comment" $createdStr | Safe}}
-					{{else}}{{$.locale.Tr "repo.issues.unpin_comment" $createdStr | Safe}}{{end}}
+					{{if eq .Type 36}}{{ctx.Locale.Tr "repo.issues.pin_comment" $createdStr | Safe}}
+					{{else}}{{ctx.Locale.Tr "repo.issues.unpin_comment" $createdStr | Safe}}{{end}}
 				</span>
 			</div>
 		{{end}}
diff --git a/templates/repo/issue/view_content/comments_delete_time.tmpl b/templates/repo/issue/view_content/comments_delete_time.tmpl
index 7fed4eb37a..7c01bb4228 100644
--- a/templates/repo/issue/view_content/comments_delete_time.tmpl
+++ b/templates/repo/issue/view_content/comments_delete_time.tmpl
@@ -6,10 +6,10 @@
 					<form method="post" class="delete-time-form" action="{{.ctxData.RepoLink}}/issues/{{.ctxData.Issue.Index}}/times/{{.comment.TimeID}}/delete">
 						{{.ctxData.CsrfTokenHtml}}
 					</form>
-					<div class="header">{{.ctxData.locale.Tr "repo.issues.del_time"}}</div>
+					<div class="header">{{ctx.Locale.Tr "repo.issues.del_time"}}</div>
 					{{template "base/modal_actions_confirm"}}
 				</div>
-				<button class="ui icon button compact mini issue-delete-time" data-id="{{.comment.Time.ID}}" data-tooltip-content="{{.ctxData.locale.Tr "repo.issues.del_time"}}">
+				<button class="ui icon button compact mini issue-delete-time" data-id="{{.comment.Time.ID}}" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.del_time"}}">
 					{{svg "octicon-trash"}}
 				</button>
 			</span>
diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl
index ff94e2554e..4afd73c371 100644
--- a/templates/repo/issue/view_content/context_menu.tmpl
+++ b/templates/repo/issue/view_content/context_menu.tmpl
@@ -9,17 +9,17 @@
 		{{else}}
 			{{$referenceUrl = printf "%s/files#%s" .ctxData.Issue.Link .item.HashTag}}
 		{{end}}
-		<div class="item context js-aria-clickable" data-clipboard-text-type="url" data-clipboard-text="{{$referenceUrl}}">{{.ctxData.locale.Tr "repo.issues.context.copy_link"}}</div>
+		<div class="item context js-aria-clickable" data-clipboard-text-type="url" data-clipboard-text="{{$referenceUrl}}">{{ctx.Locale.Tr "repo.issues.context.copy_link"}}</div>
 		{{if and .ctxData.IsSigned (not .ctxData.Repository.IsArchived)}}
-			<div class="item context js-aria-clickable quote-reply {{if .diff}}quote-reply-diff{{end}}" data-target="{{.item.HashTag}}-raw">{{.ctxData.locale.Tr "repo.issues.context.quote_reply"}}</div>
+			<div class="item context js-aria-clickable quote-reply {{if .diff}}quote-reply-diff{{end}}" data-target="{{.item.HashTag}}-raw">{{ctx.Locale.Tr "repo.issues.context.quote_reply"}}</div>
 			{{if not .ctxData.UnitIssuesGlobalDisabled}}
-				<div class="item context js-aria-clickable reference-issue" data-target="{{.item.HashTag}}-raw" data-modal="#reference-issue-modal" data-poster="{{.item.Poster.GetDisplayName}}" data-poster-username="{{.item.Poster.Name}}" data-reference="{{$referenceUrl}}">{{.ctxData.locale.Tr "repo.issues.context.reference_issue"}}</div>
+				<div class="item context js-aria-clickable reference-issue" data-target="{{.item.HashTag}}-raw" data-modal="#reference-issue-modal" data-poster="{{.item.Poster.GetDisplayName}}" data-poster-username="{{.item.Poster.Name}}" data-reference="{{$referenceUrl}}">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</div>
 			{{end}}
 			{{if or .ctxData.Permission.IsAdmin .IsCommentPoster .ctxData.HasIssuesOrPullsWritePermission}}
 				<div class="divider"></div>
-				<div class="item context js-aria-clickable edit-content">{{.ctxData.locale.Tr "repo.issues.context.edit"}}</div>
+				<div class="item context js-aria-clickable edit-content">{{ctx.Locale.Tr "repo.issues.context.edit"}}</div>
 				{{if .delete}}
-					<div class="item context js-aria-clickable delete-comment" data-comment-id={{.item.HashTag}} data-url="{{.ctxData.RepoLink}}/comments/{{.item.ID}}/delete" data-locale="{{.ctxData.locale.Tr "repo.issues.delete_comment_confirm"}}">{{.ctxData.locale.Tr "repo.issues.context.delete"}}</div>
+					<div class="item context js-aria-clickable delete-comment" data-comment-id={{.item.HashTag}} data-url="{{.ctxData.RepoLink}}/comments/{{.item.ID}}/delete" data-locale="{{ctx.Locale.Tr "repo.issues.delete_comment_confirm"}}">{{ctx.Locale.Tr "repo.issues.context.delete"}}</div>
 				{{end}}
 			{{end}}
 		{{end}}
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index a256660b13..f9a43d7dbe 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -28,39 +28,39 @@
 					<div class="item item-section text gt-f1">
 						<div class="item-section-left">
 							<h3 class="gt-mb-3">
-								{{$.locale.Tr "repo.pulls.merged_success"}}
+								{{ctx.Locale.Tr "repo.pulls.merged_success"}}
 							</h3>
 							<div class="merge-section-info">
-								{{$.locale.Tr "repo.pulls.merged_info_text" (printf "<code>%s</code>" (.HeadTarget | Escape)) | Str2html}}
+								{{ctx.Locale.Tr "repo.pulls.merged_info_text" (printf "<code>%s</code>" (.HeadTarget | Escape)) | Str2html}}
 							</div>
 						</div>
 						<div class="item-section-right">
-							<button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete_html"}}</button>
+							<button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{ctx.Locale.Tr "repo.branch.delete_html"}}</button>
 						</div>
 					</div>
 				{{end}}
 			{{else if .Issue.IsClosed}}
 				<div class="item item-section text gt-f1">
 					<div class="item-section-left">
-						<h3 class="gt-mb-3">{{$.locale.Tr "repo.pulls.closed"}}</h3>
+						<h3 class="gt-mb-3">{{ctx.Locale.Tr "repo.pulls.closed"}}</h3>
 						<div class="merge-section-info">
 							{{if .IsPullRequestBroken}}
-								{{$.locale.Tr "repo.pulls.cant_reopen_deleted_branch"}}
+								{{ctx.Locale.Tr "repo.pulls.cant_reopen_deleted_branch"}}
 							{{else}}
-								{{$.locale.Tr "repo.pulls.reopen_to_merge"}}
+								{{ctx.Locale.Tr "repo.pulls.reopen_to_merge"}}
 							{{end}}
 						</div>
 					</div>
 					{{if and .IsPullBranchDeletable (not .IsPullRequestBroken)}}
 						<div class="item-section-right">
-							<button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{$.locale.Tr "repo.branch.delete_html"}}</button>
+							<button class="delete-button ui button" data-url="{{.DeleteBranchLink}}">{{ctx.Locale.Tr "repo.branch.delete_html"}}</button>
 						</div>
 					{{end}}
 				</div>
 			{{else if .IsPullFilesConflicted}}
 				<div class="item">
 					{{svg "octicon-x"}}
-					{{$.locale.Tr "repo.pulls.files_conflicted"}}
+					{{ctx.Locale.Tr "repo.pulls.files_conflicted"}}
 				</div>
 				<ul>
 					{{range .ConflictedFiles}}
@@ -70,17 +70,17 @@
 			{{else if .IsPullRequestBroken}}
 				<div class="item">
 					{{svg "octicon-x"}}
-					{{$.locale.Tr "repo.pulls.data_broken"}}
+					{{ctx.Locale.Tr "repo.pulls.data_broken"}}
 				</div>
 			{{else if .IsPullWorkInProgress}}
 				<div class="item toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{(.WorkInProgressPrefix|Escape)}}" data-update-url="{{.Issue.Link}}/title">
 					<div class="item-section-left flex-text-inline gt-f1">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
+						{{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
 					</div>
 					{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
 						<button class="ui compact button">
-							{{$.locale.Tr "repo.pulls.remove_prefix" (.WorkInProgressPrefix|Escape) | Safe}}
+							{{ctx.Locale.Tr "repo.pulls.remove_prefix" (.WorkInProgressPrefix|Escape) | Safe}}
 						</button>
 					{{end}}
 				</div>
@@ -88,38 +88,38 @@
 			{{else if .Issue.PullRequest.IsChecking}}
 				<div class="item">
 					{{svg "octicon-sync"}}
-					{{$.locale.Tr "repo.pulls.is_checking"}}
+					{{ctx.Locale.Tr "repo.pulls.is_checking"}}
 				</div>
 			{{else if .Issue.PullRequest.IsAncestor}}
 				<div class="item">
 					{{svg "octicon-alert"}}
-					{{$.locale.Tr "repo.pulls.is_ancestor"}}
+					{{ctx.Locale.Tr "repo.pulls.is_ancestor"}}
 				</div>
 			{{else if or .Issue.PullRequest.CanAutoMerge .Issue.PullRequest.IsEmpty}}
 				{{if .IsBlockedByApprovals}}
 					<div class="item">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
+						{{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
 					</div>
 				{{else if .IsBlockedByRejection}}
 					<div class="item">
 						{{svg "octicon-x"}}
-					{{$.locale.Tr "repo.pulls.blocked_by_rejection"}}
+					{{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}}
 					</div>
 				{{else if .IsBlockedByOfficialReviewRequests}}
 					<div class="item">
 						{{svg "octicon-x"}}
-					{{$.locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
+					{{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
 					</div>
 				{{else if .IsBlockedByOutdatedBranch}}
 					<div class="item">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
+						{{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
 					</div>
 				{{else if .IsBlockedByChangedProtectedFiles}}
 					<div class="item">
 						{{svg "octicon-x"}}
-						{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
+						{{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
 					</div>
 					<ul>
 						{{range .ChangedProtectedFiles}}
@@ -129,21 +129,21 @@
 				{{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}}
 					<div class="item">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.required_status_check_failed"}}
+						{{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}}
 					</div>
 				{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
 					<div class="item">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.required_status_check_missing"}}
+						{{ctx.Locale.Tr "repo.pulls.required_status_check_missing"}}
 					</div>
 				{{else if and .AllowMerge .RequireSigned (not .WillSign)}}
 					<div class="item">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.require_signed_wont_sign"}}
+						{{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}}
 					</div>
 					<div class="item">
 						{{svg "octicon-unlock"}}
-						{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
+						{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
 					</div>
 				{{end}}
 
@@ -157,23 +157,23 @@
 					{{if $notAllOverridableChecksOk}}
 						<div class="item">
 							{{svg "octicon-dot-fill"}}
-							{{$.locale.Tr "repo.pulls.required_status_check_administrator"}}
+							{{ctx.Locale.Tr "repo.pulls.required_status_check_administrator"}}
 						</div>
 					{{else}}
 						<div class="item">
 							{{svg "octicon-check"}}
-							{{$.locale.Tr "repo.pulls.can_auto_merge_desc"}}
+							{{ctx.Locale.Tr "repo.pulls.can_auto_merge_desc"}}
 						</div>
 					{{end}}
 					{{if .WillSign}}
 						<div class="item">
 							{{svg "octicon-lock" 16 "text green"}}
-							{{$.locale.Tr "repo.signing.will_sign" .SigningKey}}
+							{{ctx.Locale.Tr "repo.signing.will_sign" .SigningKey}}
 						</div>
 					{{else if .IsSigned}}
 						<div class="item">
 							{{svg "octicon-unlock"}}
-							{{$.locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
+							{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}}
 						</div>
 					{{end}}
 				{{end}}
@@ -183,7 +183,7 @@
 
 					<div class="item">
 						{{svg "octicon-alert"}}
-						{{$.locale.Tr "repo.pulls.is_empty"}}
+						{{ctx.Locale.Tr "repo.pulls.is_empty"}}
 					</div>
 				{{end}}
 
@@ -193,8 +193,8 @@
 					{{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash}}
 						{{$hasPendingPullRequestMergeTip := ""}}
 						{{if .HasPendingPullRequestMerge}}
-							{{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix $.locale}}
-							{{$hasPendingPullRequestMergeTip = $.locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}}
+							{{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix ctx.Locale}}
+							{{$hasPendingPullRequestMergeTip = ctx.Locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}}
 						{{end}}
 						<div class="divider"></div>
 						<script type="module">
@@ -205,14 +205,14 @@
 							const defaultSquashMergeMessage = {{if .DefaultSquashMergeBody}}{{.DefaultSquashMergeBody}}{{else}}`Reviewed-on: ${issueUrl}\n` + {{$approvers}}{{end}};
 							const mergeForm = {
 								'baseLink': {{.Link}},
-								'textCancel': {{$.locale.Tr "cancel"}},
-								'textDeleteBranch': {{$.locale.Tr "repo.branch.delete" .HeadTarget}},
-								'textAutoMergeButtonWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
-								'textAutoMergeWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_when_succeed"}},
-								'textAutoMergeCancelSchedule': {{$.locale.Tr "repo.pulls.auto_merge_cancel_schedule"}},
-								'textClearMergeMessage': {{$.locale.Tr "repo.pulls.clear_merge_message"}},
-								'textClearMergeMessageHint': {{$.locale.Tr "repo.pulls.clear_merge_message_hint"}},
-								'textMergeCommitId': {{$.locale.Tr "repo.pulls.merge_commit_id"}},
+								'textCancel': {{ctx.Locale.Tr "cancel"}},
+								'textDeleteBranch': {{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}},
+								'textAutoMergeButtonWhenSucceed': {{ctx.Locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
+								'textAutoMergeWhenSucceed': {{ctx.Locale.Tr "repo.pulls.auto_merge_when_succeed"}},
+								'textAutoMergeCancelSchedule': {{ctx.Locale.Tr "repo.pulls.auto_merge_cancel_schedule"}},
+								'textClearMergeMessage': {{ctx.Locale.Tr "repo.pulls.clear_merge_message"}},
+								'textClearMergeMessageHint': {{ctx.Locale.Tr "repo.pulls.clear_merge_message_hint"}},
+								'textMergeCommitId': {{ctx.Locale.Tr "repo.pulls.merge_commit_id"}},
 
 								'canMergeNow': {{$canMergeNow}},
 								'allOverridableChecksOk': {{not $notAllOverridableChecksOk}},
@@ -221,7 +221,7 @@
 								'isPullBranchDeletable': {{.IsPullBranchDeletable}},
 								'defaultMergeStyle': {{.MergeStyle}},
 								'defaultDeleteBranchAfterMerge': {{$prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge}},
-								'mergeMessageFieldPlaceHolder': {{$.locale.Tr "repo.editor.commit_message_desc"}},
+								'mergeMessageFieldPlaceHolder': {{ctx.Locale.Tr "repo.editor.commit_message_desc"}},
 								'defaultMergeMessage': defaultMergeMessage,
 
 								'hasPendingPullRequestMerge': {{.HasPendingPullRequestMerge}},
@@ -233,7 +233,7 @@
 								{
 									'name': 'merge',
 									'allowed': {{$prUnit.PullRequestsConfig.AllowMerge}},
-									'textDoMerge': {{$.locale.Tr "repo.pulls.merge_pull_request"}},
+									'textDoMerge': {{ctx.Locale.Tr "repo.pulls.merge_pull_request"}},
 									'mergeTitleFieldText': defaultMergeTitle,
 									'mergeMessageFieldText': defaultMergeMessage,
 									'hideAutoMerge': generalHideAutoMerge,
@@ -241,14 +241,14 @@
 								{
 									'name': 'rebase',
 									'allowed': {{$prUnit.PullRequestsConfig.AllowRebase}},
-									'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_pull_request"}},
+									'textDoMerge': {{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}},
 									'hideMergeMessageTexts': true,
 									'hideAutoMerge': generalHideAutoMerge,
 								},
 								{
 									'name': 'rebase-merge',
 									'allowed': {{$prUnit.PullRequestsConfig.AllowRebaseMerge}},
-									'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}},
+									'textDoMerge': {{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}},
 									'mergeTitleFieldText': defaultMergeTitle,
 									'mergeMessageFieldText': defaultMergeMessage,
 									'hideAutoMerge': generalHideAutoMerge,
@@ -256,7 +256,7 @@
 								{
 									'name': 'squash',
 									'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}},
-									'textDoMerge': {{$.locale.Tr "repo.pulls.squash_merge_pull_request"}},
+									'textDoMerge': {{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}},
 									'mergeTitleFieldText': defaultSquashMergeTitle,
 									'mergeMessageFieldText': {{.GetCommitMessages}} + defaultSquashMergeMessage,
 									'hideAutoMerge': generalHideAutoMerge,
@@ -264,7 +264,7 @@
 								{
 									'name': 'manually-merged',
 									'allowed': {{and $prUnit.PullRequestsConfig.AllowManualMerge $.IsRepoAdmin}},
-									'textDoMerge': {{$.locale.Tr "repo.pulls.merge_manually"}},
+									'textDoMerge': {{ctx.Locale.Tr "repo.pulls.merge_manually"}},
 									'hideMergeMessageTexts': true,
 									'hideAutoMerge': true,
 								}
@@ -279,11 +279,11 @@
 						<div class="divider"></div>
 						<div class="item text red">
 							{{svg "octicon-x"}}
-							{{$.locale.Tr "repo.pulls.no_merge_desc"}}
+							{{ctx.Locale.Tr "repo.pulls.no_merge_desc"}}
 						</div>
 						<div class="item">
 							{{svg "octicon-info"}}
-							{{$.locale.Tr "repo.pulls.no_merge_helper"}}
+							{{ctx.Locale.Tr "repo.pulls.no_merge_helper"}}
 						</div>
 					{{end}} {{/* end if the repo was set to use any merge style */}}
 				{{else}}
@@ -291,7 +291,7 @@
 					<div class="divider"></div>
 					<div class="item">
 						{{svg "octicon-info"}}
-						{{$.locale.Tr "repo.pulls.no_merge_access"}}
+						{{ctx.Locale.Tr "repo.pulls.no_merge_access"}}
 					</div>
 				{{end}} {{/* end if user is allowed to merge or not */}}
 			{{else}}
@@ -299,27 +299,27 @@
 				{{if .IsBlockedByApprovals}}
 					<div class="item text red">
 						{{svg "octicon-x"}}
-					{{$.locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
+					{{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}}
 					</div>
 				{{else if .IsBlockedByRejection}}
 					<div class="item text red">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.blocked_by_rejection"}}
+						{{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}}
 					</div>
 				{{else if .IsBlockedByOfficialReviewRequests}}
 					<div class="item text red">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
+						{{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}}
 					</div>
 				{{else if .IsBlockedByOutdatedBranch}}
 					<div class="item text red">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
+						{{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}}
 					</div>
 				{{else if .IsBlockedByChangedProtectedFiles}}
 					<div class="item text red">
 						{{svg "octicon-x"}}
-						{{$.locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
+						{{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n" | Safe}}
 					</div>
 					<ul>
 						{{range .ChangedProtectedFiles}}
@@ -329,21 +329,21 @@
 				{{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}}
 					<div class="item text red">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.required_status_check_failed"}}
+						{{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}}
 					</div>
 				{{else if and .RequireSigned (not .WillSign)}}
 					<div class="item text red">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.require_signed_wont_sign"}}
+						{{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}}
 					</div>
 				{{else}}
 					<div class="item text red">
 						{{svg "octicon-x"}}
-						{{$.locale.Tr "repo.pulls.cannot_auto_merge_desc"}}
+						{{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_desc"}}
 					</div>
 					<div class="item">
 						{{svg "octicon-info"}}
-						{{$.locale.Tr "repo.pulls.cannot_auto_merge_helper"}}
+						{{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_helper"}}
 					</div>
 				{{end}}
 			{{end}}{{/* end if: pull request status */}}
@@ -363,10 +363,10 @@
 					<form action="{{.Link}}/merge" method="post">
 						{{.CsrfTokenHtml}}
 						<div class="field">
-							<input type="text" name="merge_commit_id" placeholder="{{$.locale.Tr "repo.pulls.merge_commit_id"}}">
+							<input type="text" name="merge_commit_id" placeholder="{{ctx.Locale.Tr "repo.pulls.merge_commit_id"}}">
 						</div>
 						<button class="ui red button" type="submit" name="do" value="manually-merged">
-							{{$.locale.Tr "repo.pulls.merge_manually"}}
+							{{ctx.Locale.Tr "repo.pulls.merge_manually"}}
 						</button>
 					</form>
 				</div>
diff --git a/templates/repo/issue/view_content/reactions.tmpl b/templates/repo/issue/view_content/reactions.tmpl
index 02202783da..b7ca943e01 100644
--- a/templates/repo/issue/view_content/reactions.tmpl
+++ b/templates/repo/issue/view_content/reactions.tmpl
@@ -2,7 +2,7 @@
 {{range $key, $value := .Reactions}}
 	{{$hasReacted := $value.HasUser $.ctxData.SignedUserID}}
 	<a role="button" class="ui label basic{{if $hasReacted}} primary{{end}}{{if not $.ctxData.IsSigned}} disabled{{end}} comment-reaction-button"
-		data-tooltip-content="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{$.ctxData.locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
+		data-tooltip-content="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
 		data-tooltip-placement="bottom-start"
 		data-reaction-content="{{$key}}" data-has-reacted="{{$hasReacted}}">
 		<span class="reaction">{{ReactionToEmoji $key}}</span>
diff --git a/templates/repo/issue/view_content/reference_issue_dialog.tmpl b/templates/repo/issue/view_content/reference_issue_dialog.tmpl
index 3df85e7b81..b771e08909 100644
--- a/templates/repo/issue/view_content/reference_issue_dialog.tmpl
+++ b/templates/repo/issue/view_content/reference_issue_dialog.tmpl
@@ -1,28 +1,28 @@
 <div class="ui small modal" id="reference-issue-modal">
 	<div class="header">
-		{{.locale.Tr "repo.issues.context.reference_issue"}}
+		{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}
 	</div>
 	<div class="content" style="text-align:left">
 		<form class="ui form form-fetch-action" action="{{printf "%s/issues/new" .Repository.Link}}" method="post">
 			{{.CsrfTokenHtml}}
 			<div class="ui segment content">
 				<div class="field">
-					<span class="text"><strong>{{.locale.Tr "repository"}}</strong></span>
+					<span class="text"><strong>{{ctx.Locale.Tr "repository"}}</strong></span>
 					<div class="ui search normal selection dropdown issue_reference_repository_search">
 						<div class="default text">{{.Repository.FullName}}</div>
 						<div class="menu"></div>
 					</div>
 				</div>
 				<div class="field">
-					<span class="text"><strong>{{.locale.Tr "repo.milestones.title"}}</strong></span>
+					<span class="text"><strong>{{ctx.Locale.Tr "repo.milestones.title"}}</strong></span>
 					<input name="title" value="" autofocus required maxlength="255" autocomplete="off">
 				</div>
 				<div class="field">
-					<span class="text"><strong>{{.locale.Tr "repo.issues.reference_issue.body"}}</strong></span>
+					<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.reference_issue.body"}}</strong></span>
 					<textarea name="content" class="form-control"></textarea>
 				</div>
 				<div class="text right">
-					<button class="ui primary button">{{.locale.Tr "repo.issues.create"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.create"}}</button>
 				</div>
 			</div>
 		</form>
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index 6405a6e180..6692330cbe 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -4,7 +4,7 @@
 		<input id="reviewer_id" name="reviewer_id" type="hidden" value="{{.reviewer_id}}">
 		<div class="ui {{if or (not .Reviewers) (not .CanChooseReviewer) .Repository.IsArchived}}disabled{{end}} floating jump select-reviewers-modify dropdown">
 			<a class="text gt-df gt-ac muted">
-				<strong>{{.locale.Tr "repo.issues.review.reviewers"}}</strong>
+				<strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong>
 				{{if and .CanChooseReviewer (not .Repository.IsArchived)}}
 					{{svg "octicon-gear" 16 "gt-ml-2"}}
 				{{end}}
@@ -13,13 +13,13 @@
 				{{if .Reviewers}}
 					<div class="ui icon search input">
 						<i class="icon">{{svg "octicon-search" 16}}</i>
-						<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_reviewers"}}">
+						<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_reviewers"}}">
 					</div>
 				{{end}}
 				{{if .Reviewers}}
 					{{range .Reviewers}}
 						{{if .User}}
-							<a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-tooltip-content="{{$.locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
+							<a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
 								<span class="octicon-check {{if not .Checked}}gt-invisible{{end}}">{{svg "octicon-check"}}</span>
 								<span class="text">
 									{{ctx.AvatarUtils.Avatar .User 28 "gt-mr-3"}}{{template "repo/search_name" .User}}
@@ -32,7 +32,7 @@
 					<div class="divider"></div>
 					{{range .TeamReviewers}}
 						{{if .Team}}
-							<a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_team_{{.Team.ID}}" {{if not .CanChange}} data-tooltip-content="{{$.locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
+							<a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_team_{{.Team.ID}}" {{if not .CanChange}} data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
 								<span class="octicon-check {{if not .Checked}}gt-invisible{{end}}">{{svg "octicon-check" 16}}</span>
 								<span class="text">
 									{{svg "octicon-people" 16 "gt-ml-4 gt-mr-2"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}
@@ -45,7 +45,7 @@
 		</div>
 
 		<div class="ui assignees list">
-			<span class="no-select item {{if or .OriginalReviews .PullReviewers}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_reviewers"}}</span>
+			<span class="no-select item {{if or .OriginalReviews .PullReviewers}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_reviewers"}}</span>
 			<div class="selected">
 				{{range .PullReviewers}}
 					<div class="item gt-df gt-ac gt-py-3">
@@ -58,39 +58,39 @@
 						</div>
 						<div class="gt-df gt-ac gt-gap-3">
 							{{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed))}}
-								<a href="#" class="ui muted icon gt-df gt-ac show-modal" data-tooltip-content="{{$.locale.Tr "repo.issues.dismiss_review"}}" data-modal="#dismiss-review-modal-{{.Review.ID}}">
+								<a href="#" class="ui muted icon gt-df gt-ac show-modal" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dismiss_review"}}" data-modal="#dismiss-review-modal-{{.Review.ID}}">
 									{{svg "octicon-x" 20}}
 								</a>
 								<div class="ui small modal" id="dismiss-review-modal-{{.Review.ID}}">
 									<div class="header">
-										{{$.locale.Tr "repo.issues.dismiss_review"}}
+										{{ctx.Locale.Tr "repo.issues.dismiss_review"}}
 									</div>
 									<div class="content">
 										<div class="ui warning message">
-											{{$.locale.Tr "repo.issues.dismiss_review_warning"}}
+											{{ctx.Locale.Tr "repo.issues.dismiss_review_warning"}}
 										</div>
 										<form class="ui form dismiss-review-form" id="dismiss-review-{{.Review.ID}}" action="{{$.RepoLink}}/issues/dismiss_review" method="post">
 											{{$.CsrfTokenHtml}}
 											<input type="hidden" name="review_id" value="{{.Review.ID}}">
 											<div class="field">
-												<label for="message">{{$.locale.Tr "action.review_dismissed_reason"}}</label>
+												<label for="message">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</label>
 												<input id="message" name="message">
 											</div>
 											<div class="text right actions">
-												<button class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</button>
-												<button class="ui red button" type="submit">{{$.locale.Tr "ok"}}</button>
+												<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+												<button class="ui red button" type="submit">{{ctx.Locale.Tr "ok"}}</button>
 											</div>
 										</form>
 									</div>
 								</div>
 							{{end}}
 							{{if .Review.Stale}}
-								<span data-tooltip-content="{{$.locale.Tr "repo.issues.is_stale"}}">
+								<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.is_stale"}}">
 									{{svg "octicon-hourglass" 16}}
 								</span>
 							{{end}}
 							{{if .CanChange}}
-								<a href="#" class="ui muted icon re-request-review{{if .Checked}} checked{{end}}" data-tooltip-content="{{if .Checked}}{{$.locale.Tr "repo.issues.remove_request_review"}}{{else}}{{$.locale.Tr "repo.issues.re_request_review"}}{{end}}" data-issue-id="{{$.Issue.ID}}" data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">{{if .Checked}}{{svg "octicon-trash"}}{{else}}{{svg "octicon-sync"}}{{end}}</a>
+								<a href="#" class="ui muted icon re-request-review{{if .Checked}} checked{{end}}" data-tooltip-content="{{if .Checked}}{{ctx.Locale.Tr "repo.issues.remove_request_review"}}{{else}}{{ctx.Locale.Tr "repo.issues.re_request_review"}}{{end}}" data-issue-id="{{$.Issue.ID}}" data-id="{{.ItemID}}" data-update-url="{{$.RepoLink}}/issues/request_review">{{if .Checked}}{{svg "octicon-trash"}}{{else}}{{svg "octicon-sync"}}{{end}}</a>
 							{{end}}
 							{{svg (printf "octicon-%s" .Review.Type.Icon) 16 (printf "text %s" (.Review.HTMLTypeColorName))}}
 						</div>
@@ -99,7 +99,7 @@
 				{{range .OriginalReviews}}
 					<div class="item gt-df gt-ac gt-py-3">
 						<div class="gt-df gt-ac gt-f1">
-							<a class="muted" href="{{$.Repository.OriginalURL}}" data-tooltip-content="{{$.locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe}}">
+							<a class="muted" href="{{$.Repository.OriginalURL}}" data-tooltip-content="{{ctx.Locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape) | Safe}}">
 								{{svg (MigrationIcon $.Repository.GetOriginalURLHostname) 20 "gt-mr-3"}}
 								{{.OriginalAuthor}}
 							</a>
@@ -114,7 +114,7 @@
 		{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
 			<div class="toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{(index .PullRequestWorkInProgressPrefixes 0| Escape)}}" data-update-url="{{.Issue.Link}}/title">
 				<a class="muted">
-					{{.locale.Tr "repo.pulls.still_in_progress"}} {{.locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}
+					{{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}
 				</a>
 			</div>
 		{{end}}
@@ -128,7 +128,7 @@
 
 	<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-milestone dropdown">
 		<a class="text muted flex-text-block">
-			<strong>{{.locale.Tr "repo.issues.new.milestone"}}</strong>
+			<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong>
 			{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
 				{{svg "octicon-gear" 16 "gt-ml-2"}}
 			{{end}}
@@ -138,7 +138,7 @@
 		</div>
 	</div>
 	<div class="ui select-milestone list">
-		<span class="no-select item {{if .Issue.Milestone}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_milestone"}}</span>
+		<span class="no-select item {{if .Issue.Milestone}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_milestone"}}</span>
 		<div class="selected">
 			{{if .Issue.Milestone}}
 				<a class="item muted sidebar-item-link" href="{{.RepoLink}}/milestone/{{.Issue.Milestone.ID}}">
@@ -154,7 +154,7 @@
 
 		<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-project dropdown">
 			<a class="text muted flex-text-block">
-				<strong>{{.locale.Tr "repo.issues.new.projects"}}</strong>
+				<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong>
 				{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
 					{{svg "octicon-gear" 16 "gt-ml-2"}}
 				{{end}}
@@ -163,14 +163,14 @@
 				{{if or .OpenProjects .ClosedProjects}}
 				<div class="ui icon search input">
 					<i class="icon">{{svg "octicon-search" 16}}</i>
-					<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_projects"}}">
+					<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}">
 				</div>
 				{{end}}
-				<div class="no-select item">{{.locale.Tr "repo.issues.new.clear_projects"}}</div>
+				<div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
 				{{if .OpenProjects}}
 					<div class="divider"></div>
 					<div class="header">
-						{{.locale.Tr "repo.issues.new.open_projects"}}
+						{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
 					</div>
 					{{range .OpenProjects}}
 						<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
@@ -181,7 +181,7 @@
 				{{if .ClosedProjects}}
 					<div class="divider"></div>
 					<div class="header">
-						{{.locale.Tr "repo.issues.new.closed_projects"}}
+						{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
 					</div>
 					{{range .ClosedProjects}}
 						<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
@@ -192,7 +192,7 @@
 			</div>
 		</div>
 		<div class="ui select-project list">
-			<span class="no-select item {{if .Issue.Project}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span>
+			<span class="no-select item {{if .Issue.Project}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span>
 			<div class="selected">
 				{{if .Issue.Project}}
 					<a class="item muted sidebar-item-link" href="{{.Issue.Project.Link}}">
@@ -208,7 +208,7 @@
 	<input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}">
 	<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-assignees-modify dropdown">
 		<a class="text muted flex-text-block">
-			<strong>{{.locale.Tr "repo.issues.new.assignees"}}</strong>
+			<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong>
 			{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
 				{{svg "octicon-gear" 16 "gt-ml-2"}}
 			{{end}}
@@ -216,9 +216,9 @@
 		<div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/assignee">
 			<div class="ui icon search input">
 				<i class="icon">{{svg "octicon-search" 16}}</i>
-				<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignees"}}">
+				<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
 			</div>
-			<div class="no-select item">{{.locale.Tr "repo.issues.new.clear_assignees"}}</div>
+			<div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
 			{{range .Assignees}}
 
 				{{$AssigneeID := .ID}}
@@ -238,7 +238,7 @@
 		</div>
 	</div>
 	<div class="ui assignees list">
-		<span class="no-select item {{if .Issue.Assignees}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_assignees"}}</span>
+		<span class="no-select item {{if .Issue.Assignees}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}</span>
 		<div class="selected">
 			{{range .Issue.Assignees}}
 				<div class="item">
@@ -254,7 +254,7 @@
 	<div class="divider"></div>
 
 	{{if .Participants}}
-		<span class="text"><strong>{{.locale.Tr "repo.issues.num_participants" .NumParticipants}}</strong></span>
+		<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.num_participants" .NumParticipants}}</strong></span>
 		<div class="ui list gt-df gt-fw">
 			{{range .Participants}}
 				<a {{if gt .ID 0}}href="{{.HomeLink}}"{{end}} data-tooltip-content="{{.GetDisplayName}}">
@@ -268,7 +268,7 @@
 		<div class="divider"></div>
 
 		<div class="ui watching">
-			<span class="text"><strong>{{.locale.Tr "notification.notifications"}}</strong></span>
+			<span class="text"><strong>{{ctx.Locale.Tr "notification.notifications"}}</strong></span>
 			<div class="gt-mt-3">
 				<form method="post" action="{{.Issue.Link}}/watch">
 					<input type="hidden" name="watch" value="{{if $.IssueWatch.IsWatching}}0{{else}}1{{end}}">
@@ -276,10 +276,10 @@
 					<button class="fluid ui button">
 						{{if $.IssueWatch.IsWatching}}
 							{{svg "octicon-mute" 16 "gt-mr-3"}}
-							{{.locale.Tr "repo.issues.unsubscribe"}}
+							{{ctx.Locale.Tr "repo.issues.unsubscribe"}}
 						{{else}}
 							{{svg "octicon-unmute" 16 "gt-mr-3"}}
-							{{.locale.Tr "repo.issues.subscribe"}}
+							{{ctx.Locale.Tr "repo.issues.subscribe"}}
 						{{end}}
 					</button>
 				</form>
@@ -290,7 +290,7 @@
 		{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
 			<div class="divider"></div>
 			<div class="ui timetrack">
-				<span class="text"><strong>{{.locale.Tr "repo.issues.tracker"}}</strong></span>
+				<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong></span>
 				<div class="gt-mt-3">
 					<form method="post" action="{{.Issue.Link}}/times/stopwatch/toggle" id="toggle_stopwatch_form">
 						{{$.CsrfTokenHtml}}
@@ -301,39 +301,39 @@
 					{{if $.IsStopwatchRunning}}
 						<button class="ui fluid button issue-stop-time">
 							{{svg "octicon-stopwatch" 16 "gt-mr-3"}}
-							{{.locale.Tr "repo.issues.stop_tracking"}}
+							{{ctx.Locale.Tr "repo.issues.stop_tracking"}}
 						</button>
 						<button class="ui fluid button issue-cancel-time gt-mt-3">
 							{{svg "octicon-trash" 16 "gt-mr-3"}}
-							{{.locale.Tr "repo.issues.cancel_tracking"}}
+							{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}
 						</button>
 					{{else}}
 						{{if .HasUserStopwatch}}
 							<div class="ui warning message">
-								{{.locale.Tr "repo.issues.tracking_already_started" (.OtherStopwatchURL|Escape) | Safe}}
+								{{ctx.Locale.Tr "repo.issues.tracking_already_started" (.OtherStopwatchURL|Escape) | Safe}}
 							</div>
 						{{end}}
-						<button class="ui fluid button issue-start-time" data-tooltip-content='{{.locale.Tr "repo.issues.start_tracking"}}'>
+						<button class="ui fluid button issue-start-time" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.start_tracking"}}'>
 							{{svg "octicon-stopwatch" 16 "gt-mr-3"}}
-							{{.locale.Tr "repo.issues.start_tracking_short"}}
+							{{ctx.Locale.Tr "repo.issues.start_tracking_short"}}
 						</button>
 						<div class="ui mini modal issue-start-time-modal">
-							<div class="header">{{.locale.Tr "repo.issues.add_time"}}</div>
+							<div class="header">{{ctx.Locale.Tr "repo.issues.add_time"}}</div>
 							<div class="content">
 								<form method="post" id="add_time_manual_form" action="{{.Issue.Link}}/times/add" class="ui input fluid gt-gap-3">
 									{{$.CsrfTokenHtml}}
-									<input placeholder='{{.locale.Tr "repo.issues.add_time_hours"}}' type="number" name="hours">
-									<input placeholder='{{.locale.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes" class="ui compact">
+									<input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_hours"}}' type="number" name="hours">
+									<input placeholder='{{ctx.Locale.Tr "repo.issues.add_time_minutes"}}' type="number" name="minutes" class="ui compact">
 								</form>
 							</div>
 							<div class="actions">
-								<button class="ui primary approve button">{{.locale.Tr "repo.issues.add_time_short"}}</button>
-								<button class="ui cancel button">{{.locale.Tr "repo.issues.add_time_cancel"}}</button>
+								<button class="ui primary approve button">{{ctx.Locale.Tr "repo.issues.add_time_short"}}</button>
+								<button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.add_time_cancel"}}</button>
 							</div>
 						</div>
-						<button class="ui fluid button issue-add-time gt-mt-3" data-tooltip-content='{{.locale.Tr "repo.issues.add_time"}}'>
+						<button class="ui fluid button issue-add-time gt-mt-3" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.add_time"}}'>
 							{{svg "octicon-plus" 16 "gt-mr-3"}}
-							{{.locale.Tr "repo.issues.add_time_short"}}
+							{{ctx.Locale.Tr "repo.issues.add_time_short"}}
 						</button>
 					{{end}}
 				</div>
@@ -342,7 +342,7 @@
 		{{if gt (len .WorkingUsers) 0}}
 			<div class="divider"></div>
 			<div class="ui comments">
-				<span class="text"><strong>{{.locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Time) | Safe}}</strong></span>
+				<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Time) | Safe}}</strong></span>
 				<div>
 					{{range $user, $trackedtime := .WorkingUsers}}
 						<div class="comment gt-mt-3">
@@ -363,36 +363,36 @@
 	{{end}}
 
 	<div class="divider"></div>
-	<span class="text"><strong>{{.locale.Tr "repo.issues.due_date"}}</strong></span>
+	<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.due_date"}}</strong></span>
 	<div class="ui form" id="deadline-loader">
 		<div class="ui negative message gt-hidden" id="deadline-err-invalid-date">
 			{{svg "octicon-x" 16 "close icon"}}
-			{{.locale.Tr "repo.issues.due_date_invalid"}}
+			{{ctx.Locale.Tr "repo.issues.due_date_invalid"}}
 		</div>
 		{{if ne .Issue.DeadlineUnix 0}}
 			<p>
 				<div class="gt-df gt-sb gt-ac">
-					<div class="due-date {{if .Issue.IsOverdue}}text red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{.locale.Tr "repo.issues.due_date_overdue"}}"{{end}}>
+					<div class="due-date {{if .Issue.IsOverdue}}text red{{end}}" {{if .Issue.IsOverdue}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_overdue"}}"{{end}}>
 						{{svg "octicon-calendar" 16 "gt-mr-3"}}
 						{{DateTime "long" .Issue.DeadlineUnix.FormatDate}}
 					</div>
 					<div>
 						{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
-							<a class="issue-due-edit muted" data-tooltip-content="{{$.locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil" 16 "gt-mr-2"}}</a>
-							<a class="issue-due-remove muted" data-tooltip-content="{{$.locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a>
+							<a class="issue-due-edit muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_edit"}}">{{svg "octicon-pencil" 16 "gt-mr-2"}}</a>
+							<a class="issue-due-remove muted" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date_form_remove"}}">{{svg "octicon-trash"}}</a>
 						{{end}}
 					</div>
 				</div>
 			</p>
 		{{else}}
-			<p>{{.locale.Tr "repo.issues.due_date_not_set"}}</p>
+			<p>{{ctx.Locale.Tr "repo.issues.due_date_not_set"}}</p>
 		{{end}}
 
 		{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
 			<div {{if ne .Issue.DeadlineUnix 0}} class="gt-hidden"{{end}} id="deadlineForm">
 				<form class="ui fluid action input issue-due-form" action="{{AppSubUrl}}/{{PathEscape .Repository.Owner.Name}}/{{PathEscape .Repository.Name}}/issues/{{.Issue.Index}}/deadline" method="post" id="update-issue-deadline-form">
 					{{$.CsrfTokenHtml}}
-					<input required placeholder="{{.locale.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.Format "2006-01-02"}}"{{end}} type="date" name="deadlineDate" id="deadlineDate">
+					<input required placeholder="{{ctx.Locale.Tr "repo.issues.due_date_form"}}" {{if gt .Issue.DeadlineUnix 0}}value="{{.Issue.DeadlineUnix.Format "2006-01-02"}}"{{end}} type="date" name="deadlineDate" id="deadlineDate">
 					<button class="ui icon button">
 						{{if ne .Issue.DeadlineUnix 0}}
 							{{svg "octicon-pencil"}}
@@ -410,20 +410,20 @@
 
 		<div class="ui depending">
 			{{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}}
-				<span class="text"><strong>{{.locale.Tr "repo.issues.dependency.title"}}</strong></span>
+				<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.dependency.title"}}</strong></span>
 				<br>
 				<p>
 					{{if .Issue.IsPull}}
-						{{.locale.Tr "repo.issues.dependency.pr_no_dependencies"}}
+						{{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}}
 					{{else}}
-						{{.locale.Tr "repo.issues.dependency.issue_no_dependencies"}}
+						{{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}}
 					{{end}}
 				</p>
 			{{end}}
 
 			{{if or .BlockingDependencies .BlockingDependenciesNotPermitted}}
-				<span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{.locale.Tr "repo.issues.dependency.pr_close_blocks"}}{{else}}{{.locale.Tr "repo.issues.dependency.issue_close_blocks"}}{{end}}">
-					<strong>{{.locale.Tr "repo.issues.dependency.blocks_short"}}</strong>
+				<span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{ctx.Locale.Tr "repo.issues.dependency.pr_close_blocks"}}{{else}}{{ctx.Locale.Tr "repo.issues.dependency.issue_close_blocks"}}{{end}}">
+					<strong>{{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}</strong>
 				</span>
 				<div class="ui relaxed divided list">
 					{{range .BlockingDependencies}}
@@ -438,7 +438,7 @@
 							</div>
 							<div class="item-right gt-df gt-ac">
 								{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
-									<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{$.locale.Tr "repo.issues.dependency.remove_info"}}">
+									<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
 										{{svg "octicon-trash" 16}}
 									</a>
 								{{end}}
@@ -447,15 +447,15 @@
 					{{end}}
 					{{if .BlockingDependenciesNotPermitted}}
 						<div class="item gt-df gt-ac gt-sb">
-							<span>{{$.locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
+							<span>{{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}</span>
 						</div>
 					{{end}}
 				</div>
 			{{end}}
 
 			{{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}}
-				<span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{.locale.Tr "repo.issues.dependency.pr_closing_blockedby"}}{{else}}{{.locale.Tr "repo.issues.dependency.issue_closing_blockedby"}}{{end}}">
-					<strong>{{.locale.Tr "repo.issues.dependency.blocked_by_short"}}</strong>
+				<span class="text" data-tooltip-content="{{if .Issue.IsPull}}{{ctx.Locale.Tr "repo.issues.dependency.pr_closing_blockedby"}}{{else}}{{ctx.Locale.Tr "repo.issues.dependency.issue_closing_blockedby"}}{{end}}">
+					<strong>{{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}</strong>
 				</span>
 				<div class="ui relaxed divided list">
 					{{range .BlockedByDependencies}}
@@ -470,7 +470,7 @@
 							</div>
 							<div class="item-right gt-df gt-ac">
 								{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
-									<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-tooltip-content="{{$.locale.Tr "repo.issues.dependency.remove_info"}}">
+									<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blockedBy" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
 										{{svg "octicon-trash" 16}}
 									</a>
 								{{end}}
@@ -482,7 +482,7 @@
 							<div class="item dependency{{if .Issue.IsClosed}} is-closed{{end}} gt-df gt-ac gt-sb">
 								<div class="item-left gt-df gt-jc gt-fc gt-f1">
 									<div>
-										<span data-tooltip-content="{{$.locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span>
+										<span data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.no_permission.can_remove"}}">{{svg "octicon-lock" 16}}</span>
 										<span class="title" data-tooltip-content="#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}">
 											#{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
 										</span>
@@ -493,7 +493,7 @@
 								</div>
 								<div class="item-right gt-df gt-ac">
 									{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
-										<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{$.locale.Tr "repo.issues.dependency.remove_info"}}">
+										<a class="delete-dependency-button ci muted" data-id="{{.Issue.ID}}" data-type="blocking" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.dependency.remove_info"}}">
 											{{svg "octicon-trash" 16}}
 										</a>
 									{{end}}
@@ -502,7 +502,7 @@
 						{{end}}
 					{{else if .BlockedByDependenciesNotPermitted}}
 						<div class="item gt-df gt-ac gt-sb">
-							<span>{{$.locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
+							<span>{{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}</span>
 						</div>
 					{{end}}
 				</div>
@@ -517,7 +517,7 @@
 								<input name="newDependency" type="hidden">
 								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 								<input type="text" class="search">
-								<div class="default text">{{.locale.Tr "repo.issues.dependency.add"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.issues.dependency.add"}}</div>
 							</div>
 							<button class="ui icon button">
 								{{svg "octicon-plus"}}
@@ -534,7 +534,7 @@
 			<div class="ui g-modal-confirm modal remove-dependency">
 				<div class="header">
 					{{svg "octicon-trash"}}
-					{{.locale.Tr "repo.issues.dependency.remove_header"}}
+					{{ctx.Locale.Tr "repo.issues.dependency.remove_header"}}
 				</div>
 				<div class="content">
 					<form method="post" action="{{.Issue.Link}}/dependency/delete" id="removeDependencyForm">
@@ -543,13 +543,13 @@
 						<input type="hidden" value="" name="dependencyType" id="dependencyType">
 					</form>
 					<p>{{if .Issue.IsPull}}
-						{{.locale.Tr "repo.issues.dependency.pr_remove_text"}}
+						{{ctx.Locale.Tr "repo.issues.dependency.pr_remove_text"}}
 					{{else}}
-						{{.locale.Tr "repo.issues.dependency.issue_remove_text"}}
+						{{ctx.Locale.Tr "repo.issues.dependency.issue_remove_text"}}
 					{{end}}</p>
 				</div>
-				{{$ModalButtonCancelText := .locale.Tr "repo.issues.dependency.cancel"}}
-				{{$ModalButtonOkText := .locale.Tr "repo.issues.dependency.remove"}}
+				{{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
+				{{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
 				{{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
 			</div>
 		{{end}}
@@ -559,7 +559,7 @@
 	<div class="ui equal width compact grid">
 		{{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
 		<div class="row gt-ac" data-tooltip-content="{{$issueReferenceLink}}">
-			<span class="text column truncate">{{.locale.Tr "repo.issues.reference_link" $issueReferenceLink}}</span>
+			<span class="text column truncate">{{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}}</span>
 			<button class="ui two wide button column gt-p-3" data-clipboard-text="{{$issueReferenceLink}}">{{svg "octicon-copy" 14}}</button>
 		</div>
 	</div>
@@ -568,15 +568,15 @@
 		<div class="divider"></div>
 
 		{{if or .PinEnabled .Issue.IsPinned}}
-			<form class="gt-mt-2 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{.locale.Tr "repo.issues.max_pinned"}}"{{end}}>
+			<form class="gt-mt-2 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.max_pinned"}}"{{end}}>
 				{{$.CsrfTokenHtml}}
 				<button class="fluid ui button {{if not $.NewPinAllowed}}disabled{{end}}">
 					{{if not .Issue.IsPinned}}
 						{{svg "octicon-pin" 16 "gt-mr-3"}}
-						{{.locale.Tr "pin"}}
+						{{ctx.Locale.Tr "pin"}}
 					{{else}}
 						{{svg "octicon-pin-slash" 16 "gt-mr-3"}}
-						{{.locale.Tr "unpin"}}
+						{{ctx.Locale.Tr "unpin"}}
 					{{end}}
 				</button>
 			</form>
@@ -585,29 +585,29 @@
 		<button class="gt-mt-2 fluid ui show-modal button {{if .Issue.IsLocked}} negative {{end}}" data-modal="#lock">
 			{{if .Issue.IsLocked}}
 				{{svg "octicon-key"}}
-				{{.locale.Tr "repo.issues.unlock"}}
+				{{ctx.Locale.Tr "repo.issues.unlock"}}
 			{{else}}
 				{{svg "octicon-lock"}}
-				{{.locale.Tr "repo.issues.lock"}}
+				{{ctx.Locale.Tr "repo.issues.lock"}}
 			{{end}}
 		</button>
 		<div class="ui tiny modal" id="lock">
 			<div class="header">
 				{{if .Issue.IsLocked}}
-					{{.locale.Tr "repo.issues.unlock.title"}}
+					{{ctx.Locale.Tr "repo.issues.unlock.title"}}
 				{{else}}
-					{{.locale.Tr "repo.issues.lock.title"}}
+					{{ctx.Locale.Tr "repo.issues.lock.title"}}
 				{{end}}
 			</div>
 			<div class="content">
 				<div class="ui warning message">
 					{{if .Issue.IsLocked}}
-						{{.locale.Tr "repo.issues.unlock.notice_1"}}<br>
-						{{.locale.Tr "repo.issues.unlock.notice_2"}}<br>
+						{{ctx.Locale.Tr "repo.issues.unlock.notice_1"}}<br>
+						{{ctx.Locale.Tr "repo.issues.unlock.notice_2"}}<br>
 					{{else}}
-						{{.locale.Tr "repo.issues.lock.notice_1"}}<br>
-						{{.locale.Tr "repo.issues.lock.notice_2"}}<br>
-						{{.locale.Tr "repo.issues.lock.notice_3"}}<br>
+						{{ctx.Locale.Tr "repo.issues.lock.notice_1"}}<br>
+						{{ctx.Locale.Tr "repo.issues.lock.notice_2"}}<br>
+						{{ctx.Locale.Tr "repo.issues.lock.notice_3"}}<br>
 					{{end}}
 				</div>
 
@@ -617,7 +617,7 @@
 
 					{{if not .Issue.IsLocked}}
 						<div class="field">
-							<strong> {{.locale.Tr "repo.issues.lock.reason"}} </strong>
+							<strong> {{ctx.Locale.Tr "repo.issues.lock.reason"}} </strong>
 						</div>
 
 						<div class="field">
@@ -643,12 +643,12 @@
 					{{end}}
 
 					<div class="text right actions">
-						<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
+						<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
 						<button class="ui red button">
 							{{if .Issue.IsLocked}}
-								{{.locale.Tr "repo.issues.unlock_confirm"}}
+								{{ctx.Locale.Tr "repo.issues.unlock_confirm"}}
 							{{else}}
-								{{.locale.Tr "repo.issues.lock_confirm"}}
+								{{ctx.Locale.Tr "repo.issues.lock_confirm"}}
 							{{end}}
 						</button>
 					</div>
@@ -657,22 +657,22 @@
 		</div>
 		<button class="gt-mt-2 fluid ui show-modal button" data-modal="#sidebar-delete-issue">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "repo.issues.delete"}}
+			{{ctx.Locale.Tr "repo.issues.delete"}}
 		</button>
 		<div class="ui g-modal-confirm modal" id="sidebar-delete-issue">
 			<div class="header">
 				{{if .Issue.IsPull}}
-					{{.locale.Tr "repo.pulls.delete.title"}}
+					{{ctx.Locale.Tr "repo.pulls.delete.title"}}
 				{{else}}
-					{{.locale.Tr "repo.issues.delete.title"}}
+					{{ctx.Locale.Tr "repo.issues.delete.title"}}
 				{{end}}
 			</div>
 			<div class="content">
 				<p>
 					{{if .Issue.IsPull}}
-						{{.locale.Tr "repo.pulls.delete.text"}}
+						{{ctx.Locale.Tr "repo.pulls.delete.text"}}
 					{{else}}
-						{{.locale.Tr "repo.issues.delete.text"}}
+						{{ctx.Locale.Tr "repo.issues.delete.text"}}
 					{{end}}
 				</p>
 			</div>
@@ -689,10 +689,10 @@
 			<div class="inline field">
 				<div class="ui checkbox" id="allow-edits-from-maintainers"
 						data-url="{{.Issue.Link}}"
-						data-tooltip-content="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
-						data-prompt-error="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
+						data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"
+						data-prompt-error="{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers_err"}}"
 					>
-					<label><strong>{{.locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
+					<label><strong>{{ctx.Locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label>
 					<input type="checkbox" {{if .Issue.PullRequest.AllowMaintainerEdit}}checked{{end}}>
 				</div>
 			</div>
diff --git a/templates/repo/issue/view_content/update_branch_by_merge.tmpl b/templates/repo/issue/view_content/update_branch_by_merge.tmpl
index 7e4a0f18e2..4dbefefe00 100644
--- a/templates/repo/issue/view_content/update_branch_by_merge.tmpl
+++ b/templates/repo/issue/view_content/update_branch_by_merge.tmpl
@@ -3,7 +3,7 @@
 	<div class="item item-section">
 		<div class="item-section-left flex-text-inline">
 			{{svg "octicon-alert"}}
-			{{$.locale.Tr "repo.pulls.outdated_with_base_branch"}}
+			{{ctx.Locale.Tr "repo.pulls.outdated_with_base_branch"}}
 		</div>
 		<div class="item-section-right">
 			{{if and $.UpdateAllowed $.UpdateByRebaseAllowed}}
@@ -11,14 +11,14 @@
 					<div class="ui buttons update-button">
 						<button class="ui button" data-do="{{$.Link}}/update" data-redirect="{{$.Link}}">
 							<span class="button-text">
-								{{$.locale.Tr "repo.pulls.update_branch"}}
+								{{ctx.Locale.Tr "repo.pulls.update_branch"}}
 							</span>
 						</button>
 						<div class="ui dropdown icon button">
 							{{svg "octicon-triangle-down"}}
 							<div class="menu">
-								<a class="item active selected" data-do="{{$.Link}}/update">{{$.locale.Tr "repo.pulls.update_branch"}}</a>
-								<a class="item" data-do="{{$.Link}}/update?style=rebase">{{$.locale.Tr "repo.pulls.update_branch_rebase"}}</a>
+								<a class="item active selected" data-do="{{$.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a>
+								<a class="item" data-do="{{$.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a>
 							</div>
 						</div>
 					</div>
@@ -28,7 +28,7 @@
 				<form action="{{$.Link}}/update" method="post" class="ui update-branch-form">
 					{{$.CsrfTokenHtml}}
 					<button class="ui compact button">
-						<span class="ui text">{{$.locale.Tr "repo.pulls.update_branch"}}</span>
+						<span class="ui text">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</span>
 					</button>
 				</form>
 			{{end}}
diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl
index 0ad408b8d9..c18825f204 100644
--- a/templates/repo/issue/view_title.tmpl
+++ b/templates/repo/issue/view_title.tmpl
@@ -14,32 +14,32 @@
 		</h1>
 		<div class="issue-title-buttons">
 			{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
-				<button id="edit-title" class="ui small basic button edit-button not-in-edit{{if .Issue.IsPull}} gt-mr-0{{end}}">{{.locale.Tr "repo.issues.edit"}}</button>
+				<button id="edit-title" class="ui small basic button edit-button not-in-edit{{if .Issue.IsPull}} gt-mr-0{{end}}">{{ctx.Locale.Tr "repo.issues.edit"}}</button>
 			{{end}}
 			{{if not .Issue.IsPull}}
-				<a role="button" class="ui small primary button new-issue-button gt-mr-0" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
+				<a role="button" class="ui small primary button new-issue-button gt-mr-0" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
 			{{end}}
 		</div>
 		{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
 			<div class="edit-buttons">
-				<button id="cancel-edit-title" class="ui small basic button in-edit gt-hidden">{{.locale.Tr "repo.issues.cancel"}}</button>
-				<button id="save-edit-title" class="ui small primary button in-edit gt-hidden gt-mr-0" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{.locale.Tr "repo.issues.save"}}</button>
+				<button id="cancel-edit-title" class="ui small basic button in-edit gt-hidden">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
+				<button id="save-edit-title" class="ui small primary button in-edit gt-hidden gt-mr-0" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{ctx.Locale.Tr "repo.issues.save"}}</button>
 			</div>
 		{{end}}
 	</div>
 	<div class="issue-title-meta">
 		{{if .HasMerged}}
-			<div class="ui purple label issue-state-label">{{svg "octicon-git-merge" 16 "gt-mr-2"}} {{if eq .Issue.PullRequest.Status 3}}{{.locale.Tr "repo.pulls.manually_merged"}}{{else}}{{.locale.Tr "repo.pulls.merged"}}{{end}}</div>
+			<div class="ui purple label issue-state-label">{{svg "octicon-git-merge" 16 "gt-mr-2"}} {{if eq .Issue.PullRequest.Status 3}}{{ctx.Locale.Tr "repo.pulls.manually_merged"}}{{else}}{{ctx.Locale.Tr "repo.pulls.merged"}}{{end}}</div>
 		{{else if .Issue.IsClosed}}
-			<div class="ui red label issue-state-label">{{if .Issue.IsPull}}{{svg "octicon-git-pull-request"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{.locale.Tr "repo.issues.closed_title"}}</div>
+			<div class="ui red label issue-state-label">{{if .Issue.IsPull}}{{svg "octicon-git-pull-request"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{ctx.Locale.Tr "repo.issues.closed_title"}}</div>
 		{{else if .Issue.IsPull}}
 			{{if .IsPullWorkInProgress}}
-				<div class="ui grey label issue-state-label">{{svg "octicon-git-pull-request-draft"}} {{.locale.Tr "repo.issues.draft_title"}}</div>
+				<div class="ui grey label issue-state-label">{{svg "octicon-git-pull-request-draft"}} {{ctx.Locale.Tr "repo.issues.draft_title"}}</div>
 			{{else}}
-				<div class="ui green label issue-state-label">{{svg "octicon-git-pull-request"}} {{.locale.Tr "repo.issues.open_title"}}</div>
+				<div class="ui green label issue-state-label">{{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.issues.open_title"}}</div>
 			{{end}}
 		{{else}}
-			<div class="ui green label issue-state-label">{{svg "octicon-issue-opened"}} {{.locale.Tr "repo.issues.open_title"}}</div>
+			<div class="ui green label issue-state-label">{{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.open_title"}}</div>
 		{{end}}
 		<div class="gt-ml-3">
 			{{if .Issue.IsPull}}
@@ -47,45 +47,45 @@
 				{{if .HeadBranchLink}}
 					{{$headHref = printf `<a href="%s">%s</a>` (.HeadBranchLink | Escape) $headHref}}
 				{{end}}
-				{{$headHref = printf `%s <button class="btn interact-fg" data-tooltip-content="%s" data-clipboard-text="%s">%s</button>` $headHref (.locale.Tr "copy_branch") (.HeadTarget | Escape) (svg "octicon-copy" 14)}}
+				{{$headHref = printf `%s <button class="btn interact-fg" data-tooltip-content="%s" data-clipboard-text="%s">%s</button>` $headHref (ctx.Locale.Tr "copy_branch") (.HeadTarget | Escape) (svg "octicon-copy" 14)}}
 				{{$baseHref := .BaseTarget|Escape}}
 				{{if .BaseBranchLink}}
 					{{$baseHref = printf `<a href="%s">%s</a>` (.BaseBranchLink | Escape) $baseHref}}
 				{{end}}
 				{{if .Issue.PullRequest.HasMerged}}
-					{{$mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix $.locale}}
+					{{$mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix ctx.Locale}}
 					{{if .Issue.OriginalAuthor}}
 						{{.Issue.OriginalAuthor}}
-						<span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
+						<span class="pull-desc">{{ctx.Locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
 					{{else}}
 						<a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.GetDisplayName}}</a>
-						<span class="pull-desc">{{$.locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
+						<span class="pull-desc">{{ctx.Locale.Tr "repo.pulls.merged_title_desc" .NumCommits $headHref $baseHref $mergedStr | Safe}}</span>
 					{{end}}
 				{{else}}
 					{{if .Issue.OriginalAuthor}}
-						<span id="pull-desc" class="pull-desc">{{.Issue.OriginalAuthor}} {{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}</span>
+						<span id="pull-desc" class="pull-desc">{{.Issue.OriginalAuthor}} {{ctx.Locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}</span>
 					{{else}}
 						<span id="pull-desc" class="pull-desc">
 							<a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a>
-							{{$.locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}
+							{{ctx.Locale.Tr "repo.pulls.title_desc" .NumCommits $headHref $baseHref | Safe}}
 						</span>
 					{{end}}
 					<span id="pull-desc-edit" class="gt-hidden flex-text-block">
 						<div class="ui floating filter dropdown">
 							<div class="ui basic small button gt-mr-0">
-								<span class="text">{{.locale.Tr "repo.pulls.compare_compare"}}: {{$.HeadTarget}}</span>
+								<span class="text">{{ctx.Locale.Tr "repo.pulls.compare_compare"}}: {{$.HeadTarget}}</span>
 							</div>
 						</div>
 						{{svg "octicon-arrow-right"}}
-						<div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}">
+						<div class="ui floating filter dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}">
 							<div class="ui basic small button">
-								<span class="text" id="pull-target-branch" data-basename="{{$.BaseName}}" data-branch="{{$.BaseBranch}}">{{.locale.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span>
+								<span class="text" id="pull-target-branch" data-basename="{{$.BaseName}}" data-branch="{{$.BaseBranch}}">{{ctx.Locale.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span>
 								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 							</div>
 							<div class="menu">
 								<div class="ui icon search input">
 									<i class="icon">{{svg "octicon-filter" 16}}</i>
-									<input name="search" placeholder="{{.locale.Tr "repo.pulls.filter_branch"}}...">
+									<input name="search" placeholder="{{ctx.Locale.Tr "repo.pulls.filter_branch"}}...">
 								</div>
 								<div class="scrolling menu" id="branch-select">
 									{{range .Branches}}
@@ -101,17 +101,17 @@
 					</span>
 				{{end}}
 			{{else}}
-				{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
+				{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}}
 				<span class="time-desc">
 					{{if .Issue.OriginalAuthor}}
-						{{$.locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.OriginalAuthor|Escape) | Safe}}
+						{{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.OriginalAuthor|Escape) | Safe}}
 					{{else if gt .Issue.Poster.ID 0}}
-						{{$.locale.Tr "repo.issues.opened_by" $createdStr (.Issue.Poster.HomeLink|Escape) (.Issue.Poster.GetDisplayName|Escape) | Safe}}
+						{{ctx.Locale.Tr "repo.issues.opened_by" $createdStr (.Issue.Poster.HomeLink|Escape) (.Issue.Poster.GetDisplayName|Escape) | Safe}}
 					{{else}}
-						{{$.locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.Poster.GetDisplayName|Escape) | Safe}}
+						{{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.Poster.GetDisplayName|Escape) | Safe}}
 					{{end}}
 					·
-					{{$.locale.TrN .Issue.NumComments "repo.issues.num_comments_1" "repo.issues.num_comments" .Issue.NumComments}}
+					{{ctx.Locale.TrN .Issue.NumComments "repo.issues.num_comments_1" "repo.issues.num_comments" .Issue.NumComments}}
 				</span>
 			{{end}}
 		</div>
diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl
index 394e7c2ecf..a34a039f8f 100644
--- a/templates/repo/migrate/codebase.tmpl
+++ b/templates/repo/migrate/codebase.tmpl
@@ -6,25 +6,25 @@
 				{{template "base/disable_form_autofill"}}
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "repo.migrate.migrate" .service.Title}}
+					{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}}
 					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
-						<label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label>
+						<label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label>
 						<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
 						<span class="help">
-						{{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}}
+						{{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}}
 						</span>
 					</div>
 
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_username">{{.locale.Tr "username"}}</label>
+						<label for="auth_username">{{ctx.Locale.Tr "username"}}</label>
 						<input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}>
 					</div>
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_password">{{.locale.Tr "password"}}</label>
+						<label for="auth_password">{{ctx.Locale.Tr "password"}}</label>
 						<input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}">
 					</div>
 
@@ -32,25 +32,25 @@
 
 					<div id="migrate_items">
 						<div class="inline field">
-							<label>{{.locale.Tr "repo.migrate_items"}}</label>
+							<label>{{ctx.Locale.Tr "repo.migrate_items"}}</label>
 							<div class="ui checkbox">
 								<input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="labels" type="checkbox" {{if .labels}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="issues" type="checkbox" {{if .issues}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label>
 							</div>
 						</div>
 					</div>
@@ -58,7 +58,7 @@
 					<div class="divider"></div>
 
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -82,30 +82,30 @@
 					</div>
 
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100">
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui checkbox">
 							{{if .IsForcedPrivate}}
 								<input name="private" type="checkbox" checked readonly>
-								<label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
 							{{else}}
 								<input name="private" type="checkbox" {{if .private}}checked{{end}}>
-								<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 							{{end}}
 						</div>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 						<textarea id="description" name="description" maxlength="2048">{{.description}}</textarea>
 					</div>
 
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button">
-							{{.locale.Tr "repo.migrate_repo"}}
+							{{ctx.Locale.Tr "repo.migrate_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl
index 1e449ae30e..7fe4fbc672 100644
--- a/templates/repo/migrate/git.tmpl
+++ b/templates/repo/migrate/git.tmpl
@@ -6,24 +6,24 @@
 				{{template "base/disable_form_autofill"}}
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "repo.migrate.migrate" .service.Title}}
+					{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}}
 					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
-						<label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label>
+						<label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label>
 						<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
 						<span class="help">
-						{{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}}
+						{{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}}
 						</span>
 					</div>
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_username">{{.locale.Tr "username"}}</label>
+						<label for="auth_username">{{ctx.Locale.Tr "username"}}</label>
 						<input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}>
 					</div>
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_password">{{.locale.Tr "password"}}</label>
+						<label for="auth_password">{{ctx.Locale.Tr "password"}}</label>
 						<input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}">
 					</div>
 
@@ -32,7 +32,7 @@
 					<div class="divider"></div>
 
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -56,30 +56,30 @@
 					</div>
 
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100">
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui checkbox">
 							{{if .IsForcedPrivate}}
 								<input name="private" type="checkbox" checked readonly>
-								<label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
 							{{else}}
 								<input name="private" type="checkbox" {{if .private}}checked{{end}}>
-								<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 							{{end}}
 						</div>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 						<textarea id="description" name="description" maxlength="2048">{{.description}}</textarea>
 					</div>
 
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button">
-							{{.locale.Tr "repo.migrate_repo"}}
+							{{ctx.Locale.Tr "repo.migrate_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl
index aa269e561c..d07351e727 100644
--- a/templates/repo/migrate/gitbucket.tmpl
+++ b/templates/repo/migrate/gitbucket.tmpl
@@ -6,67 +6,67 @@
 				{{template "base/disable_form_autofill"}}
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "repo.migrate.migrate" .service.Title}}
+					{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}}
 					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
-						<label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label>
+						<label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label>
 						<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
 						<span class="help">
-						{{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}}
+						{{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}}
 						</span>
 					</div>
 
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_username">{{.locale.Tr "username"}}</label>
+						<label for="auth_username">{{ctx.Locale.Tr "username"}}</label>
 						<input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}>
 					</div>
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_password">{{.locale.Tr "password"}}</label>
+						<label for="auth_password">{{ctx.Locale.Tr "password"}}</label>
 						<input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}">
 					</div>
 
 					{{template "repo/migrate/options" .}}
 
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.migrate_items"}}</label>
+						<label>{{ctx.Locale.Tr "repo.migrate_items"}}</label>
 						<div class="ui checkbox">
 							<input name="wiki" type="checkbox" {{if .wiki}}checked{{end}}>
-							<label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
+							<label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
 						</div>
 					</div>
 
 					<div id="migrate_items">
-						<span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span>
+						<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="labels" type="checkbox" {{if .labels}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="issues" type="checkbox" {{if .issues}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="releases" type="checkbox" {{if .releases}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
 							</div>
 						</div>
 					</div>
@@ -74,7 +74,7 @@
 					<div class="divider"></div>
 
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -98,30 +98,30 @@
 					</div>
 
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100">
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui checkbox">
 							{{if .IsForcedPrivate}}
 								<input name="private" type="checkbox" checked readonly>
-								<label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
 							{{else}}
 								<input name="private" type="checkbox" {{if .private}}checked{{end}}>
-								<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 							{{end}}
 						</div>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 						<textarea id="description" name="description" maxlength="2048">{{.description}}</textarea>
 					</div>
 
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button">
-							{{.locale.Tr "repo.migrate_repo"}}
+							{{ctx.Locale.Tr "repo.migrate_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl
index e4d8c62734..a40886b7a5 100644
--- a/templates/repo/migrate/gitea.tmpl
+++ b/templates/repo/migrate/gitea.tmpl
@@ -5,21 +5,21 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "repo.migrate.migrate" .service.Title}}
+					{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}}
 					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
-						<label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label>
+						<label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label>
 						<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
 						<span class="help">
-							{{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}}
+							{{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}}
 						</span>
 					</div>
 
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_token">{{.locale.Tr "access_token"}}</label>
+						<label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label>
 						<input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}>
 						<a target="_blank" href="https://docs.gitea.com/development/api-usage">{{svg "octicon-question"}}</a>
 					</div>
@@ -27,42 +27,42 @@
 					{{template "repo/migrate/options" .}}
 
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.migrate_items"}}</label>
+						<label>{{ctx.Locale.Tr "repo.migrate_items"}}</label>
 						<div class="ui checkbox">
 							<input name="wiki" type="checkbox" {{if .wiki}} checked{{end}}>
-							<label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
+							<label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
 						</div>
 					</div>
 
 					<div id="migrate_items">
-						<span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span>
+						<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="labels" type="checkbox" {{if .labels}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="issues" type="checkbox" {{if .issues}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="pull_requests" type="checkbox" {{if .pull_requests}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="releases" type="checkbox" {{if .releases}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="milestones" type="checkbox" {{if .milestones}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
 							</div>
 						</div>
 					</div>
@@ -70,7 +70,7 @@
 					<div class="divider"></div>
 
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -94,30 +94,30 @@
 					</div>
 
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100">
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui checkbox">
 							{{if .IsForcedPrivate}}
 								<input name="private" type="checkbox" checked readonly>
-								<label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
 							{{else}}
 								<input name="private" type="checkbox" {{if .private}} checked{{end}}>
-								<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 							{{end}}
 						</div>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 						<textarea id="description" name="description" maxlength="2048">{{.description}}</textarea>
 					</div>
 
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button">
-							{{.locale.Tr "repo.migrate_repo"}}
+							{{ctx.Locale.Tr "repo.migrate_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl
index d3f0e0b8bd..07f8216fcb 100644
--- a/templates/repo/migrate/github.tmpl
+++ b/templates/repo/migrate/github.tmpl
@@ -5,66 +5,66 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "repo.migrate.migrate" .service.Title}}
+					{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}}
 					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
-						<label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label>
+						<label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label>
 						<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
 						<span class="help">
-						{{.locale.Tr "repo.migrate.clone_address_desc"}}
+						{{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}
 						</span>
 					</div>
 
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_token">{{.locale.Tr "access_token"}}</label>
+						<label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label>
 						<input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>
 						<a target="_blank" href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token">{{svg "octicon-question"}}</a>
 						<span class="help">
-						{{.locale.Tr "repo.migrate.github_token_desc"}}
+						{{ctx.Locale.Tr "repo.migrate.github_token_desc"}}
 						</span>
 					</div>
 
 					{{template "repo/migrate/options" .}}
 
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.migrate_items"}}</label>
+						<label>{{ctx.Locale.Tr "repo.migrate_items"}}</label>
 						<div class="ui checkbox">
 							<input name="wiki" type="checkbox" {{if .wiki}}checked{{end}}>
-							<label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
+							<label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
 						</div>
 					</div>
 					<div id="migrate_items">
-						<span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span>
+						<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="labels" type="checkbox" {{if .labels}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="issues" type="checkbox" {{if .issues}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="releases" type="checkbox" {{if .releases}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
 							</div>
 						</div>
 					</div>
@@ -72,7 +72,7 @@
 					<div class="divider"></div>
 
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -96,30 +96,30 @@
 					</div>
 
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100">
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui checkbox">
 							{{if .IsForcedPrivate}}
 								<input name="private" type="checkbox" checked readonly>
-								<label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
 							{{else}}
 								<input name="private" type="checkbox" {{if .private}}checked{{end}}>
-								<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 							{{end}}
 						</div>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 						<textarea id="description" name="description" maxlength="2048">{{.description}}</textarea>
 					</div>
 
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button">
-							{{.locale.Tr "repo.migrate_repo"}}
+							{{ctx.Locale.Tr "repo.migrate_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl
index e055cce19e..623822df11 100644
--- a/templates/repo/migrate/gitlab.tmpl
+++ b/templates/repo/migrate/gitlab.tmpl
@@ -5,21 +5,21 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "repo.migrate.migrate" .service.Title}}
+					{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}}
 					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
-						<label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label>
+						<label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label>
 						<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
 						<span class="help">
-						{{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}}
+						{{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}}
 						</span>
 					</div>
 
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_token">{{.locale.Tr "access_token"}}</label>
+						<label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label>
 						<input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}}data-need-clear="true"{{end}}>
 						<a target="_blank" href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html">{{svg "octicon-question"}}</a>
 					</div>
@@ -27,41 +27,41 @@
 					{{template "repo/migrate/options" .}}
 
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.migrate_items"}}</label>
+						<label>{{ctx.Locale.Tr "repo.migrate_items"}}</label>
 						<div class="ui checkbox">
 							<input name="wiki" type="checkbox" {{if .wiki}}checked{{end}}>
-							<label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
+							<label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
 						</div>
 					</div>
 					<div id="migrate_items">
-						<span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span>
+						<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="labels" type="checkbox" {{if .labels}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="issues" type="checkbox" {{if .issues}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="releases" type="checkbox" {{if .releases}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
 							</div>
 						</div>
 					</div>
@@ -69,7 +69,7 @@
 					<div class="divider"></div>
 
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -93,30 +93,30 @@
 					</div>
 
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100">
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui checkbox">
 							{{if .IsForcedPrivate}}
 								<input name="private" type="checkbox" checked readonly>
-								<label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
 							{{else}}
 								<input name="private" type="checkbox" {{if .private}}checked{{end}}>
-								<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 							{{end}}
 						</div>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 						<textarea id="description" name="description" maxlength="2048">{{.description}}</textarea>
 					</div>
 
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button">
-							{{.locale.Tr "repo.migrate_repo"}}
+							{{ctx.Locale.Tr "repo.migrate_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl
index 2d66800608..095efd5d60 100644
--- a/templates/repo/migrate/gogs.tmpl
+++ b/templates/repo/migrate/gogs.tmpl
@@ -5,21 +5,21 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "repo.migrate.migrate" .service.Title}}
+					{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}}
 					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
-						<label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label>
+						<label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label>
 						<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
 						<span class="help">
-							{{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}}
+							{{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}}
 						</span>
 					</div>
 
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_token">{{.locale.Tr "access_token"}}</label>
+						<label for="auth_token">{{ctx.Locale.Tr "access_token"}}</label>
 						<input id="auth_token" name="auth_token" type="password" autocomplete="new-password" value="{{.auth_token}}" {{if not .auth_token}} data-need-clear="true" {{end}}>
 						<!-- <a target="_blank" href="https://docs.gitea.com/development/api-usage">{{svg "octicon-question"}}</a> -->
 					</div>
@@ -27,31 +27,31 @@
 					{{template "repo/migrate/options" .}}
 
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.migrate_items"}}</label>
+						<label>{{ctx.Locale.Tr "repo.migrate_items"}}</label>
 						<div class="ui checkbox">
 							<input name="wiki" type="checkbox" {{if .wiki}} checked{{end}}>
-							<label>{{.locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
+							<label>{{ctx.Locale.Tr "repo.migrate_items_wiki" | Safe}}</label>
 						</div>
 					</div>
 
 					<div id="migrate_items">
-						<span class="help">{{.locale.Tr "repo.migrate.migrate_items_options"}}</span>
+						<span class="help">{{ctx.Locale.Tr "repo.migrate.migrate_items_options"}}</span>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="labels" type="checkbox" {{if .labels}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="issues" type="checkbox" {{if .issues}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="milestones" type="checkbox" {{if .milestones}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
 							</div>
 						</div>
 						<!-- Gogs do not support it
@@ -59,11 +59,11 @@
 							<label></label>
 							<div class="ui checkbox">
 								<input name="pull_requests" type="checkbox" {{if .pull_requests}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_merge_requests" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="releases" type="checkbox" {{if .releases}} checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_releases" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_releases" | Safe}}</label>
 							</div>
 						</div>
 						-->
@@ -72,7 +72,7 @@
 					<div class="divider"></div>
 
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -96,30 +96,30 @@
 					</div>
 
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100">
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui checkbox">
 							{{if .IsForcedPrivate}}
 								<input name="private" type="checkbox" checked readonly>
-								<label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
 							{{else}}
 								<input name="private" type="checkbox" {{if .private}} checked{{end}}>
-								<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 							{{end}}
 						</div>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 						<textarea id="description" name="description" maxlength="2048">{{.description}}</textarea>
 					</div>
 
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button">
-							{{.locale.Tr "repo.migrate_repo"}}
+							{{ctx.Locale.Tr "repo.migrate_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/migrate/migrate.tmpl b/templates/repo/migrate/migrate.tmpl
index eb17794647..c686f0b832 100644
--- a/templates/repo/migrate/migrate.tmpl
+++ b/templates/repo/migrate/migrate.tmpl
@@ -20,7 +20,7 @@
 								{{.Title}}
 							</div>
 							<div class="description gt-text-center">
-								{{(printf "repo.migrate.%s.description" .Name) | $.locale.Tr}}
+								{{(printf "repo.migrate.%s.description" .Name) | ctx.Locale.Tr}}
 							</div>
 						</div>
 					</a>
diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl
index 6effa05f97..649d14ad99 100644
--- a/templates/repo/migrate/migrating.tmpl
+++ b/templates/repo/migrate/migrating.tmpl
@@ -21,14 +21,14 @@
 					<div class="ui stackable middle very relaxed page grid">
 						<div class="sixteen wide center aligned centered column">
 							<div id="repo_migrating_progress">
-								<p>{{.locale.Tr "repo.migrate.migrating" .CloneAddr | Safe}}</p>
+								<p>{{ctx.Locale.Tr "repo.migrate.migrating" .CloneAddr | Safe}}</p>
 								<p id="repo_migrating_progress_message"></p>
 							</div>
 							<div id="repo_migrating_failed" class="gt-hidden">
 								{{if .CloneAddr}}
-									<p>{{.locale.Tr "repo.migrate.migrating_failed" .CloneAddr | Safe}}</p>
+									<p>{{ctx.Locale.Tr "repo.migrate.migrating_failed" .CloneAddr | Safe}}</p>
 								{{else}}
-									<p>{{.locale.Tr "repo.migrate.migrating_failed_no_addr" | Safe}}</p>
+									<p>{{ctx.Locale.Tr "repo.migrate.migrating_failed_no_addr" | Safe}}</p>
 								{{end}}
 								<p id="repo_migrating_failed_error"></p>
 							</div>
@@ -36,11 +36,11 @@
 								<div class="divider"></div>
 								<div class="item">
 									{{if .Failed}}
-										<button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.locale.Tr "repo.settings.delete"}}</button>
+										<button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{ctx.Locale.Tr "repo.settings.delete"}}</button>
 									{{else}}
-										<button class="ui basic show-modal button" data-modal="#cancel-repo-modal">{{.locale.Tr "cancel"}}</button>
+										<button class="ui basic show-modal button" data-modal="#cancel-repo-modal">{{ctx.Locale.Tr "cancel"}}</button>
 									{{end}}
-									<button id="repo_migrating_retry" data-migrating-task-retry-url="{{.Link}}/settings/migrate/retry" class="ui basic button gt-hidden">{{.locale.Tr "retry"}}</button>
+									<button id="repo_migrating_retry" data-migrating-task-retry-url="{{.Link}}/settings/migrate/retry" class="ui basic button gt-hidden">{{ctx.Locale.Tr "retry"}}</button>
 								</div>
 							{{end}}
 						</div>
@@ -53,14 +53,14 @@
 
 <div class="ui small modal" id="delete-repo-modal">
 	<div class="header">
-		{{.locale.Tr "repo.settings.delete"}}
+		{{ctx.Locale.Tr "repo.settings.delete"}}
 	</div>
 	<div class="content">
 		<div class="ui warning message">
-			{{.locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
-			{{.locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}}
+			{{ctx.Locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
+			{{ctx.Locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}}
 			{{if .Repository.NumForks}}<br>
-			{{.locale.Tr "repo.settings.delete_notices_fork_1"}}
+			{{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}
 			{{end}}
 		</div>
 		<form class="ui form" action="{{.Link}}/settings" method="post">
@@ -68,18 +68,18 @@
 			<input type="hidden" name="action" value="delete">
 			<div class="field">
 				<label>
-					{{.locale.Tr "repo.settings.transfer_form_title"}}
+					{{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
 					<span class="text red">{{.Repository.Name}}</span>
 				</label>
 			</div>
 			<div class="required field">
-				<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+				<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 				<input id="repo_name" name="repo_name" required>
 			</div>
 
 			<div class="text right actions">
-				<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
-				<button class="ui red button">{{.locale.Tr "repo.settings.confirm_delete"}}</button>
+				<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+				<button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button>
 			</div>
 		</form>
 	</div>
@@ -87,12 +87,12 @@
 
 <div class="ui g-modal-confirm modal" id="cancel-repo-modal">
 	<div class="header">
-		{{.locale.Tr "repo.migrate.cancel_migrating_title"}}
+		{{ctx.Locale.Tr "repo.migrate.cancel_migrating_title"}}
 	</div>
 	<form action="{{.Link}}/settings/migrate/cancel" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="content">
-			{{.locale.Tr "repo.migrate.cancel_migrating_confirm"}}
+			{{ctx.Locale.Tr "repo.migrate.cancel_migrating_confirm"}}
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</form>
diff --git a/templates/repo/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl
index 818b23fddc..b06e6929a1 100644
--- a/templates/repo/migrate/onedev.tmpl
+++ b/templates/repo/migrate/onedev.tmpl
@@ -6,25 +6,25 @@
 				{{template "base/disable_form_autofill"}}
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "repo.migrate.migrate" .service.Title}}
+					{{ctx.Locale.Tr "repo.migrate.migrate" .service.Title}}
 					<input id="service_type" type="hidden" name="service" value="{{.service}}">
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_CloneAddr}}error{{end}}">
-						<label for="clone_addr">{{.locale.Tr "repo.migrate.clone_address"}}</label>
+						<label for="clone_addr">{{ctx.Locale.Tr "repo.migrate.clone_address"}}</label>
 						<input id="clone_addr" name="clone_addr" value="{{.clone_addr}}" autofocus required>
 						<span class="help">
-						{{.locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate.clone_local_path"}}{{end}}
+						{{ctx.Locale.Tr "repo.migrate.clone_address_desc"}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate.clone_local_path"}}{{end}}
 						</span>
 					</div>
 
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_username">{{.locale.Tr "username"}}</label>
+						<label for="auth_username">{{ctx.Locale.Tr "username"}}</label>
 						<input id="auth_username" name="auth_username" value="{{.auth_username}}" {{if not .auth_username}}data-need-clear="true"{{end}}>
 					</div>
 					<div class="inline field {{if .Err_Auth}}error{{end}}">
-						<label for="auth_password">{{.locale.Tr "password"}}</label>
+						<label for="auth_password">{{ctx.Locale.Tr "password"}}</label>
 						<input id="auth_password" name="auth_password" type="password" value="{{.auth_password}}">
 					</div>
 
@@ -32,25 +32,25 @@
 
 					<div id="migrate_items">
 						<div class="inline field">
-							<label>{{.locale.Tr "repo.migrate_items"}}</label>
+							<label>{{ctx.Locale.Tr "repo.migrate_items"}}</label>
 							<div class="ui checkbox">
 								<input name="milestones" type="checkbox" {{if .milestones}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_milestones" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="labels" type="checkbox" {{if .labels}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_labels" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_labels" | Safe}}</label>
 							</div>
 						</div>
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
 								<input name="issues" type="checkbox" {{if .issues}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_issues" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_issues" | Safe}}</label>
 							</div>
 							<div class="ui checkbox">
 								<input name="pull_requests" type="checkbox" {{if .pull_requests}}checked{{end}}>
-								<label>{{.locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.migrate_items_pullrequests" | Safe}}</label>
 							</div>
 						</div>
 					</div>
@@ -58,7 +58,7 @@
 					<div class="divider"></div>
 
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -82,30 +82,30 @@
 					</div>
 
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100">
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui checkbox">
 							{{if .IsForcedPrivate}}
 								<input name="private" type="checkbox" checked readonly>
-								<label>{{.locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper_forced" | Safe}}</label>
 							{{else}}
 								<input name="private" type="checkbox" {{if .private}}checked{{end}}>
-								<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+								<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 							{{end}}
 						</div>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 						<textarea id="description" name="description" maxlength="2048">{{.description}}</textarea>
 					</div>
 
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button">
-							{{.locale.Tr "repo.migrate_repo"}}
+							{{ctx.Locale.Tr "repo.migrate_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/migrate/options.tmpl b/templates/repo/migrate/options.tmpl
index d39caf01b4..1bc30b886d 100644
--- a/templates/repo/migrate/options.tmpl
+++ b/templates/repo/migrate/options.tmpl
@@ -1,9 +1,9 @@
 {{if not .DisableNewPullMirrors}}
 <div class="inline field">
-	<label>{{.locale.Tr "repo.migrate_options"}}</label>
+	<label>{{ctx.Locale.Tr "repo.migrate_options"}}</label>
 	<div class="ui checkbox">
 		<input id="mirror" name="mirror" type="checkbox" {{if .mirror}} checked{{end}}>
-		<label>{{.locale.Tr "repo.migrate_options_mirror_helper"}}</label>
+		<label>{{ctx.Locale.Tr "repo.migrate_options_mirror_helper"}}</label>
 	</div>
 </div>
 {{end}}
@@ -12,15 +12,15 @@
 	<label></label>
 	<div class="ui checkbox">
 		<input id="lfs" name="lfs" type="checkbox" {{if .lfs}} checked{{end}}>
-		<label>{{.locale.Tr "repo.migrate_options_lfs"}}</label>
+		<label>{{ctx.Locale.Tr "repo.migrate_options_lfs"}}</label>
 	</div>
-	<span id="lfs_settings" class="gt-hidden">(<a id="lfs_settings_show" href="#">{{.locale.Tr "repo.settings.advanced_settings"}}</a>)</span>
+	<span id="lfs_settings" class="gt-hidden">(<a id="lfs_settings_show" href="#">{{ctx.Locale.Tr "repo.settings.advanced_settings"}}</a>)</span>
 </div>
 <div id="lfs_endpoint" class="gt-hidden">
-	<span class="help">{{.locale.Tr "repo.migrate_options_lfs_endpoint.description" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}{{if .ContextUser.CanImportLocal}} {{.locale.Tr "repo.migrate_options_lfs_endpoint.description.local"}}{{end}}</span>
+	<span class="help">{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.description" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}{{if .ContextUser.CanImportLocal}} {{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.description.local"}}{{end}}</span>
 	<div class="inline field {{if .Err_LFSEndpoint}}error{{end}}">
-		<label>{{.locale.Tr "repo.migrate_options_lfs_endpoint.label"}}</label>
-		<input name="lfs_endpoint" value="{{.lfs_endpoint}}" placeholder="{{.locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}">
+		<label>{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.label"}}</label>
+		<input name="lfs_endpoint" value="{{.lfs_endpoint}}" placeholder="{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}">
 	</div>
 </div>
 {{end}}
diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl
index 66b1c3a276..57d2269807 100644
--- a/templates/repo/pulls/fork.tmpl
+++ b/templates/repo/pulls/fork.tmpl
@@ -5,12 +5,12 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "new_fork"}}
+					{{ctx.Locale.Tr "new_fork"}}
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="inline required field {{if .Err_Owner}}error{{end}}">
-						<label>{{.locale.Tr "repo.owner"}}</label>
+						<label>{{ctx.Locale.Tr "repo.owner"}}</label>
 						<div class="ui selection owner dropdown">
 							<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
 							<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -36,30 +36,30 @@
 					</div>
 
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.fork_from"}}</label>
+						<label>{{ctx.Locale.Tr "repo.fork_from"}}</label>
 						<a href="{{.ForkRepo.Link}}" class="gt-dib">{{.ForkRepo.FullName}}</a>
 					</div>
 					<div class="inline required field {{if .Err_RepoName}}error{{end}}">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" value="{{.repo_name}}" required>
 					</div>
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
 						<div class="ui disabled checkbox">
 							<input type="checkbox" disabled {{if .IsPrivate}}checked{{end}}>
-							<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
+							<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}}</label>
 						</div>
-						<span class="help">{{.locale.Tr "repo.fork_visibility_helper"}}</span>
+						<span class="help">{{ctx.Locale.Tr "repo.fork_visibility_helper"}}</span>
 					</div>
 					<div class="inline field {{if .Err_Description}}error{{end}}">
-						<label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
+						<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 						<textarea id="description" name="description">{{.description}}</textarea>
 					</div>
 
 					<div class="inline field">
 						<label></label>
 						<button class="ui primary button{{if not .CanForkRepo}} disabled{{end}}">
-							{{.locale.Tr "repo.fork_repo"}}
+							{{ctx.Locale.Tr "repo.fork_repo"}}
 						</button>
 					</div>
 				</div>
diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl
index 25d8954658..476b89a425 100644
--- a/templates/repo/pulls/status.tmpl
+++ b/templates/repo/pulls/status.tmpl
@@ -2,17 +2,17 @@
 	{{if not $.Issue.PullRequest.HasMerged}}
 		<div class="ui top attached header">
 			{{if eq .LatestCommitStatus.State "pending"}}
-				{{$.locale.Tr "repo.pulls.status_checking"}}
+				{{ctx.Locale.Tr "repo.pulls.status_checking"}}
 			{{else if eq .LatestCommitStatus.State "success"}}
-				{{$.locale.Tr "repo.pulls.status_checks_success"}}
+				{{ctx.Locale.Tr "repo.pulls.status_checks_success"}}
 			{{else if eq .LatestCommitStatus.State "warning"}}
-				{{$.locale.Tr "repo.pulls.status_checks_warning"}}
+				{{ctx.Locale.Tr "repo.pulls.status_checks_warning"}}
 			{{else if eq .LatestCommitStatus.State "failure"}}
-				{{$.locale.Tr "repo.pulls.status_checks_failure"}}
+				{{ctx.Locale.Tr "repo.pulls.status_checks_failure"}}
 			{{else if eq .LatestCommitStatus.State "error"}}
-				{{$.locale.Tr "repo.pulls.status_checks_error"}}
+				{{ctx.Locale.Tr "repo.pulls.status_checks_error"}}
 			{{else}}
-				{{$.locale.Tr "repo.pulls.status_checking"}}
+				{{ctx.Locale.Tr "repo.pulls.status_checking"}}
 			{{end}}
 			</div>
 	{{end}}
@@ -24,9 +24,9 @@
 				<span>{{.Context}} <span class="text grey">{{.Description}}</span></span>
 				<div class="ui status-details">
 					{{if $.is_context_required}}
-						{{if (call $.is_context_required .Context)}}<div class="ui label">{{$.locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}}
+						{{if (call $.is_context_required .Context)}}<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}}
 					{{end}}
-					<span>{{if .TargetURL}}<a href="{{.TargetURL}}">{{$.locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span>
+					<span>{{if .TargetURL}}<a href="{{.TargetURL}}">{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span>
 				</div>
 			</div>
 		</div>
diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl
index fe1d4e4de0..10bdfdb3de 100644
--- a/templates/repo/pulls/tab_menu.tmpl
+++ b/templates/repo/pulls/tab_menu.tmpl
@@ -2,17 +2,17 @@
 	<div class="ui top attached pull tabular menu">
 		<a class="item {{if .PageIsPullConversation}}active{{end}}" href="{{.Issue.Link}}">
 			{{svg "octicon-comment-discussion"}}
-			{{$.locale.Tr "repo.pulls.tab_conversation"}}
+			{{ctx.Locale.Tr "repo.pulls.tab_conversation"}}
 			<span class="ui small label">{{.Issue.NumComments}}</span>
 		</a>
 		<a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.Issue.Link}}/commits"{{end}}>
 			{{svg "octicon-git-commit"}}
-			{{$.locale.Tr "repo.pulls.tab_commits"}}
+			{{ctx.Locale.Tr "repo.pulls.tab_commits"}}
 			<span class="ui small label">{{if .NumCommits}}{{.NumCommits}}{{else}}-{{end}}</span>
 		</a>
 		<a class="item {{if .PageIsPullFiles}}active{{end}}" href="{{.Issue.Link}}/files">
 			{{svg "octicon-diff"}}
-			{{$.locale.Tr "repo.pulls.tab_files"}}
+			{{ctx.Locale.Tr "repo.pulls.tab_files"}}
 			<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
 		</a>
 		<span class="item gt-ml-auto gt-pr-0 gt-font-bold gt-df gt-ac gt-gap-3">
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index a717fba651..16e57b257f 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -19,16 +19,16 @@
 								<h4 class="release-list-title">
 									<a href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{.Title}}</a>
 									{{if .IsDraft}}
-										<span class="ui yellow label">{{$.locale.Tr "repo.release.draft"}}</span>
+										<span class="ui yellow label">{{ctx.Locale.Tr "repo.release.draft"}}</span>
 									{{else if .IsPrerelease}}
-										<span class="ui orange label">{{$.locale.Tr "repo.release.prerelease"}}</span>
+										<span class="ui orange label">{{ctx.Locale.Tr "repo.release.prerelease"}}</span>
 									{{else if not .IsTag}}
-										<span class="ui green label">{{$.locale.Tr "repo.release.stable"}}</span>
+										<span class="ui green label">{{ctx.Locale.Tr "repo.release.stable"}}</span>
 									{{end}}
 								</h4>
 								<div>
 									{{if and $.CanCreateRelease (not .IsTag)}}
-										<a class="muted" data-tooltip-content="{{$.locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{.TagName | PathEscapeSegments}}" rel="nofollow">
+										<a class="muted" data-tooltip-content="{{ctx.Locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{.TagName | PathEscapeSegments}}" rel="nofollow">
 											{{svg "octicon-pencil"}}
 										</a>
 									{{end}}
@@ -42,14 +42,14 @@
 									<a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a>
 								</span>
 								<span class="released">
-									{{$.locale.Tr "repo.tagged_this"}}
+									{{ctx.Locale.Tr "repo.tagged_this"}}
 								</span>
 								{{if .CreatedUnix}}
-									<span class="time">{{TimeSinceUnix .CreatedUnix $.locale}}</span>
+									<span class="time">{{TimeSinceUnix .CreatedUnix ctx.Locale}}</span>
 								{{end}}
 								|
 								{{end}}
-								<span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{$.locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.locale.Tr "repo.tag.ahead.target" .TargetBehind}}</span>
+								<span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{ctx.Locale.Tr "repo.tag.ahead.target" .TargetBehind}}</span>
 							</p>
 						{{else}}
 							<p class="text grey">
@@ -64,13 +64,13 @@
 								{{end}}
 								</span>
 								<span class="released">
-									{{$.locale.Tr "repo.released_this"}}
+									{{ctx.Locale.Tr "repo.released_this"}}
 								</span>
 								{{if .CreatedUnix}}
-									<span class="time">{{TimeSinceUnix .CreatedUnix $.locale}}</span>
+									<span class="time">{{TimeSinceUnix .CreatedUnix ctx.Locale}}</span>
 								{{end}}
 								{{if not .IsDraft}}
-									| <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{$.locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{$.locale.Tr "repo.release.ahead.target" .TargetBehind}}</span>
+									| <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{ctx.Locale.Tr "repo.release.ahead.target" .TargetBehind}}</span>
 								{{end}}
 							</p>
 						{{end}}
@@ -80,15 +80,15 @@
 							<div class="divider"></div>
 							<details class="download" {{if eq $idx 0}}open{{end}}>
 								<summary class="gt-my-4">
-									{{$.locale.Tr "repo.release.downloads"}}
+									{{ctx.Locale.Tr "repo.release.downloads"}}
 								</summary>
 								<ul class="list">
 									{{if and (not $.DisableDownloadSourceArchives) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
 										<li>
-											<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.source_code"}} (ZIP)</strong></a>
+											<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong></a>
 										</li>
 										<li>
-											<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a>
+											<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong></a>
 										</li>
 									{{end}}
 									{{if .Attachments}}
@@ -99,7 +99,7 @@
 												</a>
 												<div>
 													<span class="text grey">{{.Size | FileSize}}</span>
-													<span data-tooltip-content="{{$.locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}">
+													<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}}">
 														{{svg "octicon-info"}}
 													</span>
 												</div>
@@ -122,10 +122,10 @@
 	<div class="ui g-modal-confirm delete modal">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "repo.release.delete_tag"}}
+			{{ctx.Locale.Tr "repo.release.delete_tag"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "repo.release.deletion_tag_desc"}}</p>
+			<p>{{ctx.Locale.Tr "repo.release.deletion_tag_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl
index 217196f6cf..9fd3e5bd97 100644
--- a/templates/repo/release/new.tmpl
+++ b/templates/repo/release/new.tmpl
@@ -4,11 +4,11 @@
 	<div class="ui container">
 		<h2 class="ui dividing header">
 			{{if .PageIsEditRelease}}
-				{{.locale.Tr "repo.release.edit_release"}}
-				<div class="sub header">{{.locale.Tr "repo.release.edit_subheader"}}</div>
+				{{ctx.Locale.Tr "repo.release.edit_release"}}
+				<div class="sub header">{{ctx.Locale.Tr "repo.release.edit_subheader"}}</div>
 			{{else}}
-				{{.locale.Tr "repo.release.new_release"}}
-				<div class="sub header">{{.locale.Tr "repo.release.new_subheader"}}</div>
+				{{ctx.Locale.Tr "repo.release.new_release"}}
+				<div class="sub header">{{ctx.Locale.Tr "repo.release.new_subheader"}}</div>
 			{{end}}
 		</h2>
 		{{template "base/alert" .}}
@@ -19,15 +19,15 @@
 					{{if .PageIsEditRelease}}
 						<b>{{.tag_name}}</b><span class="at">@</span><strong>{{.tag_target}}</strong>
 					{{else}}
-						<input id="tag-name" name="tag_name" value="{{.tag_name}}" aria-label="{{.locale.Tr "repo.release.tag_name"}}" placeholder="{{.locale.Tr "repo.release.tag_name"}}" autofocus required maxlength="255">
-						<input id="tag-name-editor" type="hidden" data-existing-tags="{{JsonUtils.EncodeToString .Tags}}" data-tag-helper="{{.locale.Tr "repo.release.tag_helper"}}" data-tag-helper-new="{{.locale.Tr "repo.release.tag_helper_new"}}" data-tag-helper-existing="{{.locale.Tr "repo.release.tag_helper_existing"}}">
+						<input id="tag-name" name="tag_name" value="{{.tag_name}}" aria-label="{{ctx.Locale.Tr "repo.release.tag_name"}}" placeholder="{{ctx.Locale.Tr "repo.release.tag_name"}}" autofocus required maxlength="255">
+						<input id="tag-name-editor" type="hidden" data-existing-tags="{{JsonUtils.EncodeToString .Tags}}" data-tag-helper="{{ctx.Locale.Tr "repo.release.tag_helper"}}" data-tag-helper-new="{{ctx.Locale.Tr "repo.release.tag_helper_new"}}" data-tag-helper-existing="{{ctx.Locale.Tr "repo.release.tag_helper_existing"}}">
 						<div id="tag-target-selector" class="gt-dib">
 							<span class="at">@</span>
 							<div class="ui selection dropdown">
 								<input type="hidden" name="tag_target" value="{{.tag_target}}">
 								{{svg "octicon-git-branch"}}
 								<div class="text">
-									{{.locale.Tr "repo.release.target"}} :
+									{{ctx.Locale.Tr "repo.release.target"}} :
 									<strong id="repo-branch-current">{{.Repository.DefaultBranch}}</strong>
 								</div>
 								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
@@ -39,14 +39,14 @@
 							</div>
 						</div>
 						<div>
-							<span id="tag-helper" class="help gt-mt-3 gt-pb-0">{{.locale.Tr "repo.release.tag_helper"}}</span>
+							<span id="tag-helper" class="help gt-mt-3 gt-pb-0">{{ctx.Locale.Tr "repo.release.tag_helper"}}</span>
 						</div>
 					{{end}}
 				</div>
 			</div>
 			<div class="eleven wide gt-pt-0">
 				<div class="field {{if .Err_Title}}error{{end}}">
-					<input name="title" aria-label="{{.locale.Tr "repo.release.title"}}" placeholder="{{.locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus maxlength="255">
+					<input name="title" aria-label="{{ctx.Locale.Tr "repo.release.title"}}" placeholder="{{ctx.Locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus maxlength="255">
 				</div>
 				<div class="field">
 					{{template "shared/combomarkdowneditor" (dict
@@ -54,8 +54,8 @@
 						"MarkdownPreviewContext" .RepoLink
 						"TextareaName" "content"
 						"TextareaContent" .content
-						"TextareaPlaceholder" (.locale.Tr "repo.release.message")
-						"TextareaAriaLabel" (.locale.Tr "repo.release.message")
+						"TextareaPlaceholder" (ctx.Locale.Tr "repo.release.message")
+						"TextareaAriaLabel" (ctx.Locale.Tr "repo.release.message")
 						"DropzoneParentContainer" "form"
 					)}}
 				</div>
@@ -65,12 +65,12 @@
 							<input name="attachment-edit-{{.UUID}}"  class="attachment_edit" required value="{{.Name}}">
 							<input name="attachment-del-{{.UUID}}" type="hidden" value="false">
 							<span class="ui text grey gt-whitespace-nowrap">{{.Size | FileSize}}</span>
-							<span data-tooltip-content="{{$.locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}">
+							<span data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber .DownloadCount)}}">
 								{{svg "octicon-info"}}
 							</span>
 						</div>
 						<a class="ui mini compact red button remove-rel-attach" data-id="{{.ID}}" data-uuid="{{.UUID}}">
-							{{$.locale.Tr "remove"}}
+							{{ctx.Locale.Tr "remove"}}
 						</a>
 					</div>
 				{{end}}
@@ -87,7 +87,7 @@
 						<div class="tag-message field">
 							<div class="ui checkbox">
 								<input type="checkbox" name="add_tag_msg">
-								<label><strong>{{.locale.Tr "repo.release.add_tag_msg"}}</strong></label>
+								<label><strong>{{ctx.Locale.Tr "repo.release.add_tag_msg"}}</strong></label>
 							</div>
 						</div>
 					{{else}}
@@ -96,32 +96,32 @@
 					<div class="prerelease field">
 						<div class="ui checkbox">
 							<input type="checkbox" name="prerelease" {{if .prerelease}}checked{{end}}>
-							<label><strong>{{.locale.Tr "repo.release.prerelease_desc"}}</strong></label>
+							<label><strong>{{ctx.Locale.Tr "repo.release.prerelease_desc"}}</strong></label>
 						</div>
 					</div>
-					<span class="help">{{.locale.Tr "repo.release.prerelease_helper"}}</span>
+					<span class="help">{{ctx.Locale.Tr "repo.release.prerelease_helper"}}</span>
 					<div class="divider gt-mt-0"></div>
 					<div class="gt-df gt-je">
 						{{if .PageIsEditRelease}}
 							<a class="ui small button" href="{{.RepoLink}}/releases">
-								{{.locale.Tr "repo.release.cancel"}}
+								{{ctx.Locale.Tr "repo.release.cancel"}}
 							</a>
 							<a class="ui small red button delete-button" data-url="{{$.RepoLink}}/releases/delete" data-id="{{.ID}}">
-								{{$.locale.Tr "repo.release.delete_release"}}
+								{{ctx.Locale.Tr "repo.release.delete_release"}}
 							</a>
 							{{if .IsDraft}}
-								<button class="ui small button" type="submit" name="draft" value="{{.locale.Tr "repo.release.save_draft"}}">{{.locale.Tr "repo.release.save_draft"}}</button>
+								<button class="ui small button" type="submit" name="draft" value="{{ctx.Locale.Tr "repo.release.save_draft"}}">{{ctx.Locale.Tr "repo.release.save_draft"}}</button>
 								<button class="ui small primary button">
-									{{.locale.Tr "repo.release.publish"}}
+									{{ctx.Locale.Tr "repo.release.publish"}}
 								</button>
 							{{else}}
 								<button class="ui small primary button">
-									{{.locale.Tr "repo.release.edit_release"}}
+									{{ctx.Locale.Tr "repo.release.edit_release"}}
 								</button>
 							{{end}}
 						{{else}}
 							<button class="ui small primary button">
-								{{.locale.Tr "repo.release.publish"}}
+								{{ctx.Locale.Tr "repo.release.publish"}}
 							</button>
 						{{end}}
 					</div>
@@ -135,10 +135,10 @@
 	<div class="ui g-modal-confirm delete modal">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "repo.release.deletion"}}
+			{{ctx.Locale.Tr "repo.release.deletion"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "repo.release.deletion_desc"}}</p>
+			<p>{{ctx.Locale.Tr "repo.release.deletion_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl
index 89358e9dd4..4fe6a1251c 100644
--- a/templates/repo/release_tag_header.tmpl
+++ b/templates/repo/release_tag_header.tmpl
@@ -5,18 +5,18 @@
 	<div class="gt-df">
 		<div class="gt-f1 gt-df gt-ac">
 			<h2 class="ui compact small menu header small-menu-items">
-				<a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{.locale.PrettyNumber .NumReleases}} {{.locale.TrN .NumReleases "repo.release" "repo.releases"}}</a>
+				<a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{ctx.Locale.PrettyNumber .NumReleases}} {{ctx.Locale.TrN .NumReleases "repo.release" "repo.releases"}}</a>
 				{{if $canReadCode}}
-					<a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{.locale.PrettyNumber .NumTags}} {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
+					<a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{ctx.Locale.PrettyNumber .NumTags}} {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
 				{{end}}
 			</h2>
 			{{if .EnableFeed}}
-				<a class="rss-icon gt-mx-3" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
+				<a class="rss-icon gt-mx-3" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
 			{{end}}
 		</div>
 		{{if and (not .PageIsTagList) .CanCreateRelease}}
 			<a class="ui small primary button" href="{{$.RepoLink}}/releases/new">
-				{{.locale.Tr "repo.release.new_release"}}
+				{{ctx.Locale.Tr "repo.release.new_release"}}
 			</a>
 		{{end}}
 	</div>
diff --git a/templates/repo/search.tmpl b/templates/repo/search.tmpl
index cf088442b3..b6c90de32f 100644
--- a/templates/repo/search.tmpl
+++ b/templates/repo/search.tmpl
@@ -5,13 +5,13 @@
 		<div class="ui repo-search">
 			<form class="ui form ignore-dirty" method="get">
 				<div class="ui fluid action input">
-					<input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{.locale.Tr "repo.search.search_repo"}}">
-					<div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{.locale.Tr "repo.search.type.tooltip"}}">
+					<input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{ctx.Locale.Tr "repo.search.search_repo"}}">
+					<div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.search.type.tooltip"}}">
 						<input name="t" type="hidden"{{if .CodeIndexerUnavailable}} disabled{{end}} value="{{.queryType}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}}
-						<div class="text">{{.locale.Tr (printf "repo.search.%s" (or .queryType "fuzzy"))}}</div>
+						<div class="text">{{ctx.Locale.Tr (printf "repo.search.%s" (or .queryType "fuzzy"))}}</div>
 						<div class="menu">
-							<div class="item" data-value="" data-tooltip-content="{{.locale.Tr "repo.search.fuzzy.tooltip"}}">{{.locale.Tr "repo.search.fuzzy"}}</div>
-							<div class="item" data-value="match" data-tooltip-content="{{.locale.Tr "repo.search.match.tooltip"}}">{{.locale.Tr "repo.search.match"}}</div>
+							<div class="item" data-value="" data-tooltip-content="{{ctx.Locale.Tr "repo.search.fuzzy.tooltip"}}">{{ctx.Locale.Tr "repo.search.fuzzy"}}</div>
+							<div class="item" data-value="match" data-tooltip-content="{{ctx.Locale.Tr "repo.search.match.tooltip"}}">{{ctx.Locale.Tr "repo.search.match"}}</div>
 						</div>
 					</div>
 					<button class="ui icon button"{{if .CodeIndexerUnavailable}} disabled{{end}} type="submit">{{svg "octicon-search" 16}}</button>
@@ -20,11 +20,11 @@
 		</div>
 		{{if .CodeIndexerUnavailable}}
 			<div class="ui error message">
-				<p>{{$.locale.Tr "repo.search.code_search_unavailable"}}</p>
+				<p>{{ctx.Locale.Tr "repo.search.code_search_unavailable"}}</p>
 			</div>
 		{{else if .Keyword}}
 			<h3>
-				{{.locale.Tr "repo.search.results" (.Keyword|Escape) (.RepoLink|Escape) (.RepoName|Escape) | Str2html}}
+				{{ctx.Locale.Tr "repo.search.results" (.Keyword|Escape) (.RepoLink|Escape) (.RepoName|Escape) | Str2html}}
 			</h3>
 			{{if .SearchResults}}
 				<div class="flex-text-block gt-fw">
@@ -41,7 +41,7 @@
 						<div class="diff-file-box diff-box file-content non-diff-file-content repo-search-result">
 							<h4 class="ui top attached normal header gt-df gt-fw">
 								<span class="file gt-f1">{{.Filename}}</span>
-								<a role="button" class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments .Filename}}">{{$.locale.Tr "repo.diff.view_file"}}</a>
+								<a role="button" class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments .Filename}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
 							</h4>
 							<div class="ui attached table segment">
 								<div class="file-body file-code code-view">
@@ -65,7 +65,7 @@
 				</div>
 				{{template "base/paginate" .}}
 			{{else}}
-				<div>{{$.locale.Tr "repo.search.code_no_results"}}</div>
+				<div>{{ctx.Locale.Tr "repo.search.code_no_results"}}</div>
 			{{end}}
 		{{end}}
 	</div>
diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl
index 43203a7ad3..fbdc12defb 100644
--- a/templates/repo/settings/branches.tmpl
+++ b/templates/repo/settings/branches.tmpl
@@ -2,15 +2,15 @@
 	<div class="repo-setting-content">
 		{{if .Repository.IsArchived}}
 			<div class="ui warning message gt-text-center">
-				{{.locale.Tr "repo.settings.archive.branchsettings_unavailable"}}
+				{{ctx.Locale.Tr "repo.settings.archive.branchsettings_unavailable"}}
 			</div>
 		{{else}}
 			<h4 class="ui top attached header">
-				{{.locale.Tr "repo.default_branch"}}
+				{{ctx.Locale.Tr "repo.default_branch"}}
 			</h4>
 			<div class="ui attached segment">
 				<p>
-					{{.locale.Tr "repo.settings.default_branch_desc"}}
+					{{ctx.Locale.Tr "repo.settings.default_branch_desc"}}
 				</p>
 				<form class="gt-df" action="{{.Link}}" method="post">
 					{{.CsrfTokenHtml}}
@@ -26,15 +26,15 @@
 								{{end}}
 							</div>
 						</div>
-						<button class="ui primary button">{{$.locale.Tr "repo.settings.branches.update_default_branch"}}</button>
+						<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.branches.update_default_branch"}}</button>
 					{{end}}
 				</form>
 			</div>
 
 			<h4 class="ui top attached header">
-				{{.locale.Tr "repo.settings.protected_branch"}}
+				{{ctx.Locale.Tr "repo.settings.protected_branch"}}
 				<div class="ui right">
-					<a class="ui primary tiny button" href="{{$.Repository.Link}}/settings/branches/edit">{{$.locale.Tr "repo.settings.branches.add_new_rule"}}</a>
+					<a class="ui primary tiny button" href="{{$.Repository.Link}}/settings/branches/edit">{{ctx.Locale.Tr "repo.settings.branches.add_new_rule"}}</a>
 				</div>
 			</h4>
 
@@ -48,15 +48,15 @@
 								</div>
 							</div>
 							<div class="flex-item-trailing">
-								<a class="rm ui tiny button" href="{{$.Repository.Link}}/settings/branches/edit?rule_name={{.RuleName}}">{{$.locale.Tr "repo.settings.edit_protected_branch"}}</a>
+								<a class="rm ui tiny button" href="{{$.Repository.Link}}/settings/branches/edit?rule_name={{.RuleName}}">{{ctx.Locale.Tr "repo.settings.edit_protected_branch"}}</a>
 								<button class="ui red tiny button delete-button" data-url="{{$.Repository.Link}}/settings/branches/{{.ID}}/delete" data-id="{{.ID}}">
-									{{$.locale.Tr "repo.settings.protected_branch.delete_rule"}}
+									{{ctx.Locale.Tr "repo.settings.protected_branch.delete_rule"}}
 								</button>
 							</div>
 						</div>
 					{{else}}
 						<div class="flex-item center aligned">
-							{{.locale.Tr "repo.settings.no_protected_branch"}}
+							{{ctx.Locale.Tr "repo.settings.no_protected_branch"}}
 						</div>
 					{{end}}
 				</div>
@@ -67,10 +67,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.settings.protected_branch_deletion"}}
+		{{ctx.Locale.Tr "repo.settings.protected_branch_deletion"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.settings.protected_branch_deletion_desc"}}</p>
+		<p>{{ctx.Locale.Tr "repo.settings.protected_branch_deletion_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl
index 290a1ae093..19abf1bee8 100644
--- a/templates/repo/settings/collaboration.tmpl
+++ b/templates/repo/settings/collaboration.tmpl
@@ -1,7 +1,7 @@
 {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings collaboration")}}
 	<div class="repo-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.collaboration"}}
+			{{ctx.Locale.Tr "repo.settings.collaboration"}}
 		</h4>
 		{{if .Collaborators}}
 		<div class="ui attached segment">
@@ -20,17 +20,17 @@
 							<div class="flex-text-block">
 								{{svg "octicon-shield-lock"}}
 								<div class="ui inline dropdown access-mode" data-url="{{$.Link}}/access_mode" data-uid="{{.ID}}" data-last-value="{{printf "%d" .Collaboration.Mode}}">
-									<div class="text">{{if eq .Collaboration.Mode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div>
+									<div class="text">{{if eq .Collaboration.Mode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}{{else}}{{ctx.Locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div>
 									{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 									<div class="menu">
-										<div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{$.locale.Tr "repo.settings.collaboration.admin"}}</div>
-										<div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.write"}}" data-value="2">{{$.locale.Tr "repo.settings.collaboration.write"}}</div>
-										<div class="item" data-text="{{$.locale.Tr "repo.settings.collaboration.read"}}" data-value="1">{{$.locale.Tr "repo.settings.collaboration.read"}}</div>
+										<div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}</div>
+										<div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.write"}}" data-value="2">{{ctx.Locale.Tr "repo.settings.collaboration.write"}}</div>
+										<div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.read"}}" data-value="1">{{ctx.Locale.Tr "repo.settings.collaboration.read"}}</div>
 									</div>
 								</div>
 							</div>
 							<button class="ui red tiny button inline text-thin delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
-								{{$.locale.Tr "repo.settings.delete_collaborator"}}
+								{{ctx.Locale.Tr "repo.settings.delete_collaborator"}}
 							</button>
 						</div>
 					</div>
@@ -42,15 +42,15 @@
 			<form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<div id="search-user-box" class="ui search input gt-vm">
-					<input class="prompt" name="collaborator" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required>
+					<input class="prompt" name="collaborator" placeholder="{{ctx.Locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required>
 				</div>
-				<button class="ui primary button">{{.locale.Tr "repo.settings.add_collaborator"}}</button>
+				<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_collaborator"}}</button>
 			</form>
 		</div>
 
 		{{if .RepoOwnerIsOrganization}}
 		<h4 class="ui top attached header">
-			{{$.locale.Tr "repo.settings.teams"}}
+			{{ctx.Locale.Tr "repo.settings.teams"}}
 		</h4>
 		{{$allowedToChangeTeams := (or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}}
 		{{if .Teams}}
@@ -64,19 +64,19 @@
 							</a>
 							<div class="flex-item-body flex-text-block">
 								{{svg "octicon-shield-lock"}}
-								{{if eq .AccessMode 1}}{{$.locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{$.locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{$.locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{$.locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{$.locale.Tr "repo.settings.collaboration.undefined"}}{{end}}
+								{{if eq .AccessMode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .AccessMode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .AccessMode 3}}{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}{{else if eq .AccessMode 4}}{{ctx.Locale.Tr "repo.settings.collaboration.owner"}}{{else}}{{ctx.Locale.Tr "repo.settings.collaboration.undefined"}}{{end}}
 							</div>
 							{{if or (eq .AccessMode 1) (eq .AccessMode 2)}}
 								{{$first := true}}
-								<div class="flex-item-body" data-tooltip-content="{{$.locale.Tr "repo.settings.change_team_permission_tip"}}">
-									Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $.Context $unit.Type) ($team.UnitEnabled $.Context $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{$.locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}}
+								<div class="flex-item-body" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.change_team_permission_tip"}}">
+									Sections: {{range $u, $unit := $.Units}}{{if and ($.Repo.UnitEnabled $.Context $unit.Type) ($team.UnitEnabled $.Context $unit.Type)}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{ctx.Locale.Tr $unit.NameKey}}{{end}}{{end}} {{if $first}}None{{end}}
 								</div>
 							{{end}}
 						</div>
 						{{if $allowedToChangeTeams}}
-							<div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{$.locale.Tr "repo.settings.delete_team_tip"}}"{{end}}>
+							<div class="flex-item-trailing" {{if .IncludesAllRepositories}} data-tooltip-content="{{ctx.Locale.Tr "repo.settings.delete_team_tip"}}"{{end}}>
 								<button class="ui red tiny button inline text-thin delete-button {{if .IncludesAllRepositories}}disabled{{end}}" data-url="{{$.Link}}/team/delete" data-id="{{.ID}}">
-										{{$.locale.Tr "repo.settings.delete_collaborator"}}
+										{{ctx.Locale.Tr "repo.settings.delete_collaborator"}}
 								</button>
 							</div>
 						{{end}}
@@ -90,13 +90,13 @@
 				<form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post">
 					{{.CsrfTokenHtml}}
 					<div id="search-team-box" class="ui search input gt-vm" data-org-name="{{.OrgName}}">
-						<input class="prompt" name="team" placeholder="{{$.locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required>
+						<input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required>
 					</div>
-					<button class="ui primary button">{{$.locale.Tr "repo.settings.add_team"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_team"}}</button>
 				</form>
 			{{else}}
 				<div class="item">
-					{{$.locale.Tr "repo.settings.change_team_access_not_allowed"}}
+					{{ctx.Locale.Tr "repo.settings.change_team_access_not_allowed"}}
 				</div>
 			{{end}}
 		</div>
@@ -106,10 +106,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.settings.collaborator_deletion"}}
+		{{ctx.Locale.Tr "repo.settings.collaborator_deletion"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.settings.collaborator_deletion_desc"}}</p>
+		<p>{{ctx.Locale.Tr "repo.settings.collaborator_deletion_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl
index a7b7dd6511..c5d2d2a04a 100644
--- a/templates/repo/settings/deploy_keys.tmpl
+++ b/templates/repo/settings/deploy_keys.tmpl
@@ -1,12 +1,12 @@
 {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}}
 	<div class="repo-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.deploy_keys"}}
+			{{ctx.Locale.Tr "repo.settings.deploy_keys"}}
 			<div class="ui right">
 			{{if not .DisableSSH}}
-				<button class="ui primary tiny show-panel toggle button" data-panel="#add-deploy-key-panel">{{.locale.Tr "repo.settings.add_deploy_key"}}</button>
+				<button class="ui primary tiny show-panel toggle button" data-panel="#add-deploy-key-panel">{{ctx.Locale.Tr "repo.settings.add_deploy_key"}}</button>
 			{{else}}
-				<button class="ui primary tiny button disabled">{{.locale.Tr "settings.ssh_disabled"}}</button>
+				<button class="ui primary tiny button disabled">{{ctx.Locale.Tr "settings.ssh_disabled"}}</button>
 			{{end}}
 			</div>
 		</h4>
@@ -15,30 +15,30 @@
 				<form class="ui form" action="{{.Link}}" method="post">
 					{{.CsrfTokenHtml}}
 					<div class="field">
-						{{.locale.Tr "repo.settings.deploy_key_desc"}}
+						{{ctx.Locale.Tr "repo.settings.deploy_key_desc"}}
 					</div>
 					<div class="field {{if .Err_Title}}error{{end}}">
-						<label for="title">{{.locale.Tr "repo.settings.title"}}</label>
+						<label for="title">{{ctx.Locale.Tr "repo.settings.title"}}</label>
 						<input id="ssh-key-title" name="title" value="{{.title}}" autofocus required>
 					</div>
 					<div class="field {{if .Err_Content}}error{{end}}">
-						<label for="content">{{.locale.Tr "repo.settings.deploy_key_content"}}</label>
-						<textarea id="ssh-key-content" name="content" placeholder="{{.locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
+						<label for="content">{{ctx.Locale.Tr "repo.settings.deploy_key_content"}}</label>
+						<textarea id="ssh-key-content" name="content" placeholder="{{ctx.Locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
 					</div>
 					<div class="field">
 						<div class="ui checkbox {{if .Err_IsWritable}}error{{end}}">
 							<input id="ssh-key-is-writable" name="is_writable" type="checkbox" value="1">
 							<label for="is_writable">
-								{{.locale.Tr "repo.settings.is_writable"}}
+								{{ctx.Locale.Tr "repo.settings.is_writable"}}
 							</label>
-							<small style="padding-left: 26px;">{{$.locale.Tr "repo.settings.is_writable_info" | Str2html}}</small>
+							<small style="padding-left: 26px;">{{ctx.Locale.Tr "repo.settings.is_writable_info" | Str2html}}</small>
 						</div>
 					</div>
 					<button class="ui primary button">
-						{{.locale.Tr "repo.settings.add_deploy_key"}}
+						{{ctx.Locale.Tr "repo.settings.add_deploy_key"}}
 					</button>
 					<button class="ui hide-panel button" data-panel="#add-deploy-key-panel">
-						{{.locale.Tr "cancel"}}
+						{{ctx.Locale.Tr "cancel"}}
 					</button>
 				</form>
 			</div>
@@ -47,7 +47,7 @@
 					{{range .Deploykeys}}
 						<div class="flex-item">
 							<div class="flex-item-leading">
-								<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
+								<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
 							</div>
 							<div class="flex-item-main">
 								<div class="flex-item-title">{{.Name}}</div>
@@ -55,19 +55,19 @@
 									{{.Fingerprint}}
 								</div>
 								<div class="flex-item-body">
-									<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} —  {{svg "octicon-info"}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}} - <span>{{$.locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{$.locale.Tr "settings.can_write_info"}} {{end}}</span></i>
+									<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} —  {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}} - <span>{{ctx.Locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{ctx.Locale.Tr "settings.can_write_info"}} {{end}}</span></i>
 								</div>
 							</div>
 							<div class="flex-item-trailing">
 								<button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
-									{{$.locale.Tr "settings.delete_key"}}
+									{{ctx.Locale.Tr "settings.delete_key"}}
 								</button>
 							</div>
 						</div>
 					{{end}}
 				</div>
 			{{else}}
-				{{.locale.Tr "repo.settings.no_deploy_keys"}}
+				{{ctx.Locale.Tr "repo.settings.no_deploy_keys"}}
 			{{end}}
 		</div>
 	</div>
@@ -75,10 +75,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.settings.deploy_key_deletion"}}
+		{{ctx.Locale.Tr "repo.settings.deploy_key_deletion"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.settings.deploy_key_deletion_desc"}}</p>
+		<p>{{ctx.Locale.Tr "repo.settings.deploy_key_deletion_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl
index c2fabd02ed..db8982a282 100644
--- a/templates/repo/settings/githook_edit.tmpl
+++ b/templates/repo/settings/githook_edit.tmpl
@@ -1,24 +1,24 @@
 {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit githook")}}
 	<div class="repo-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.githooks"}}
+			{{ctx.Locale.Tr "repo.settings.githooks"}}
 		</h4>
 		<div class="ui attached segment">
-			<p>{{.locale.Tr "repo.settings.githook_edit_desc"}}</p>
+			<p>{{ctx.Locale.Tr "repo.settings.githook_edit_desc"}}</p>
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				{{with .Hook}}
 					<div class="inline field">
-						<label>{{$.locale.Tr "repo.settings.githook_name"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.githook_name"}}</label>
 						<span class="hook-filename">{{.Name}}</span>
 					</div>
 					<div class="field">
-						<label for="content">{{$.locale.Tr "repo.settings.githook_content"}}</label>
+						<label for="content">{{ctx.Locale.Tr "repo.settings.githook_content"}}</label>
 						<textarea id="content" name="content" class="gt-hidden">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea>
 						<div class="editor-loading is-loading"></div>
 					</div>
 					<div class="inline field">
-						<button class="ui primary button">{{$.locale.Tr "repo.settings.update_githook"}}</button>
+						<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_githook"}}</button>
 					</div>
 				{{end}}
 			</form>
diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl
index 75729108fa..389d381f30 100644
--- a/templates/repo/settings/githooks.tmpl
+++ b/templates/repo/settings/githooks.tmpl
@@ -1,12 +1,12 @@
 {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings githooks")}}
 	<div class="repo-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.githooks"}}
+			{{ctx.Locale.Tr "repo.settings.githooks"}}
 		</h4>
 		<div class="ui attached segment">
 			<div class="ui list">
 				<div class="item">
-					{{.locale.Tr "repo.settings.githooks_desc" | Str2html}}
+					{{ctx.Locale.Tr "repo.settings.githooks_desc" | Str2html}}
 				</div>
 				{{range .Hooks}}
 					<div class="item truncated-item-container">
diff --git a/templates/repo/settings/lfs.tmpl b/templates/repo/settings/lfs.tmpl
index 06ccb92c30..dca4d1f1ce 100644
--- a/templates/repo/settings/lfs.tmpl
+++ b/templates/repo/settings/lfs.tmpl
@@ -1,10 +1,10 @@
 {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
 	<div class="repo-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.lfs_filelist"}} ({{.locale.Tr "admin.total" .Total}})
+			{{ctx.Locale.Tr "repo.settings.lfs_filelist"}} ({{ctx.Locale.Tr "admin.total" .Total}})
 			<div class="ui right">
-				<a class="ui tiny button" href="{{.Link}}/locks">{{.locale.Tr "repo.settings.lfs_locks"}}</a>
-				<a class="ui primary tiny button" href="{{.Link}}/pointers">&nbsp;{{.locale.Tr "repo.settings.lfs_findpointerfiles"}}</a>
+				<a class="ui tiny button" href="{{.Link}}/locks">{{ctx.Locale.Tr "repo.settings.lfs_locks"}}</a>
+				<a class="ui primary tiny button" href="{{.Link}}/pointers">&nbsp;{{ctx.Locale.Tr "repo.settings.lfs_findpointerfiles"}}</a>
 			</div>
 		</h4>
 		<table id="lfs-files-table" class="ui attached segment single line table">
@@ -17,17 +17,17 @@
 							</a>
 						</td>
 						<td>{{FileSize .Size}}</td>
-						<td>{{TimeSince .CreatedUnix.AsTime $.locale}}</td>
+						<td>{{TimeSince .CreatedUnix.AsTime ctx.Locale}}</td>
 						<td class="right aligned">
-							<a class="ui primary button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a>
+							<a class="ui primary button" href="{{$.Link}}/find?oid={{.Oid}}&size={{.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
 							<button class="ui basic show-modal icon button red" data-modal="#delete-{{.Oid}}">
-								<span class="btn-octicon btn-octicon-danger" data-tooltip-content="{{$.locale.Tr "repo.editor.delete_this_file"}}">{{svg "octicon-trash"}}</span>
+								<span class="btn-octicon btn-octicon-danger" data-tooltip-content="{{ctx.Locale.Tr "repo.editor.delete_this_file"}}">{{svg "octicon-trash"}}</span>
 							</button>
 						</td>
 					</tr>
 				{{else}}
 					<tr>
-						<td colspan="4">{{.locale.Tr "repo.settings.lfs_no_lfs_files"}}</td>
+						<td colspan="4">{{ctx.Locale.Tr "repo.settings.lfs_no_lfs_files"}}</td>
 					</tr>
 				{{end}}
 			</tbody>
@@ -36,11 +36,11 @@
 		{{range .LFSFiles}}
 			<div class="ui g-modal-confirm modal" id="delete-{{.Oid}}">
 				<div class="header">
-					{{$.locale.Tr "repo.settings.lfs_delete" .Oid}}
+					{{ctx.Locale.Tr "repo.settings.lfs_delete" .Oid}}
 				</div>
 				<div class="content">
 					<p>
-						{{$.locale.Tr "repo.settings.lfs_delete_warning"}}
+						{{ctx.Locale.Tr "repo.settings.lfs_delete_warning"}}
 					</p>
 					<form class="ui form" action="{{$.Link}}/delete/{{.Oid}}" method="post">
 						{{$.CsrfTokenHtml}}
diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl
index de6f0100f8..a718eed0f1 100644
--- a/templates/repo/settings/lfs_file.tmpl
+++ b/templates/repo/settings/lfs_file.tmpl
@@ -2,13 +2,13 @@
 	<div class="user-main-content twelve wide column content repository file list">
 		<div class="tab-size-8 non-diff-file-content">
 			<h4 class="ui top attached header">
-				<a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.LFSFile.Oid}}</span>
+				<a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.LFSFile.Oid}}</span>
 				<div class="ui right">
 					{{if .EscapeStatus.Escaped}}
-						<a class="ui mini basic button unescape-button gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</a>
-						<a class="ui mini basic button escape-button">{{.locale.Tr "repo.escape_control_characters"}}</a>
+						<a class="ui mini basic button unescape-button gt-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</a>
+						<a class="ui mini basic button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</a>
 					{{end}}
-					<a class="ui primary button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a>
+					<a class="ui primary button" href="{{.LFSFilesLink}}/find?oid={{.LFSFile.Oid}}&size={{.LFSFile.Size}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
 				</div>
 			</h4>
 			<div class="ui attached table unstackable segment">
@@ -24,16 +24,16 @@
 								<img src="{{$.RawFileLink}}">
 							{{else if .IsVideoFile}}
 								<video controls src="{{$.RawFileLink}}">
-									<strong>{{.locale.Tr "repo.video_not_supported_in_browser"}}</strong>
+									<strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong>
 								</video>
 							{{else if .IsAudioFile}}
 								<audio controls src="{{$.RawFileLink}}">
-									<strong>{{.locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
+									<strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
 								</audio>
 							{{else if .IsPDFFile}}
-								<div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{.locale.Tr "diff.view_file"}}"></div>
+								<div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "diff.view_file"}}"></div>
 							{{else}}
-								<a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.locale.Tr "repo.file_view_raw"}}</a>
+								<a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
 							{{end}}
 						</div>
 					{{else if .FileSize}}
@@ -41,7 +41,7 @@
 							<tbody>
 								<tr>
 								{{if .IsFileTooLarge}}
-									<td><strong>{{.locale.Tr "repo.file_too_large"}}</strong></td>
+									<td><strong>{{ctx.Locale.Tr "repo.file_too_large"}}</strong></td>
 								{{else}}
 									<td class="lines-num">{{.LineNums}}</td>
 									<td class="lines-code"><pre><code class="{{.HighlightClass}}"><ol>{{.FileContent}}</ol></code></pre></td>
diff --git a/templates/repo/settings/lfs_file_find.tmpl b/templates/repo/settings/lfs_file_find.tmpl
index b85f67fb43..fea9aa323f 100644
--- a/templates/repo/settings/lfs_file_find.tmpl
+++ b/templates/repo/settings/lfs_file_find.tmpl
@@ -2,7 +2,7 @@
 	<div class="user-main-content twelve wide column content repository file list">
 		<div class="tab-size-8 non-diff-file-content">
 			<h4 class="ui top attached header">
-				<a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.Oid}}</span>
+				<a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / <span class="truncate sha">{{.Oid}}</span>
 			</h4>
 			<table id="lfs-files-find-table" class="ui attached segment single line table">
 				<tbody>
@@ -24,19 +24,19 @@
 							</td>
 							<td>
 								{{if .ParentHashes}}
-									{{$.locale.Tr "repo.diff.parent"}}
+									{{ctx.Locale.Tr "repo.diff.parent"}}
 									{{range .ParentHashes}}
 										<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.String}}">{{ShortSha .String}}</a>
 									{{end}}
 								{{end}}
-								{{$.locale.Tr "repo.diff.commit"}}
+								{{ctx.Locale.Tr "repo.diff.commit"}}
 								<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.SHA}}">{{ShortSha .SHA}}</a>
 							</td>
-							<td>{{TimeSince .When $.locale}}</td>
+							<td>{{TimeSince .When ctx.Locale}}</td>
 						</tr>
 					{{else}}
 						<tr>
-							<td colspan="5">{{.locale.Tr "repo.settings.lfs_lfs_file_no_commits"}}</td>
+							<td colspan="5">{{ctx.Locale.Tr "repo.settings.lfs_lfs_file_no_commits"}}</td>
 						</tr>
 					{{end}}
 				</tbody>
diff --git a/templates/repo/settings/lfs_locks.tmpl b/templates/repo/settings/lfs_locks.tmpl
index 4eadf9ca32..98f0e49097 100644
--- a/templates/repo/settings/lfs_locks.tmpl
+++ b/templates/repo/settings/lfs_locks.tmpl
@@ -2,14 +2,14 @@
 	<div class="user-main-content twelve wide column content repository file list">
 		<div class="tab-size-8 non-diff-file-content">
 			<h4 class="ui top attached header">
-				<a href="{{.LFSFilesLink}}">{{.locale.Tr "repo.settings.lfs"}}</a> / {{.locale.Tr "repo.settings.lfs_locks"}} ({{.locale.Tr "admin.total" .Total}})
+				<a href="{{.LFSFilesLink}}">{{ctx.Locale.Tr "repo.settings.lfs"}}</a> / {{ctx.Locale.Tr "repo.settings.lfs_locks"}} ({{ctx.Locale.Tr "admin.total" .Total}})
 			</h4>
 			<div class="ui attached segment">
 				<form class="ui form ignore-dirty" method="post">
 					{{$.CsrfTokenHtml}}
 					<div class="ui fluid action input">
-						<input name="path" value="" placeholder="{{.locale.Tr "repo.settings.lfs_lock_path"}}" autofocus>
-						<button class="ui primary button">{{.locale.Tr "repo.settings.lfs_lock"}}</button>
+						<input name="path" value="" placeholder="{{ctx.Locale.Tr "repo.settings.lfs_lock_path"}}" autofocus>
+						<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.lfs_lock"}}</button>
 					</div>
 				</form>
 			</div>
@@ -23,10 +23,10 @@
 								<a href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments $.Repository.DefaultBranch}}/{{PathEscapeSegments $lock.Path}}" title="{{$lock.Path}}">{{$lock.Path}}</a>
 								{{else}}
 									{{svg "octicon-diff"}}
-								<span data-tooltip-content="{{$.locale.Tr "repo.settings.lfs_lock_file_no_exist"}}">{{$lock.Path}}</span>
+								<span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.lfs_lock_file_no_exist"}}">{{$lock.Path}}</span>
 								{{end}}
 								{{if not (index $.Lockables $index)}}
-									<span data-tooltip-content="{{$.locale.Tr "repo.settings.lfs_noattribute"}}">{{svg "octicon-alert"}}</span>
+									<span data-tooltip-content="{{ctx.Locale.Tr "repo.settings.lfs_noattribute"}}">{{svg "octicon-alert"}}</span>
 								{{end}}
 							</td>
 							<td>
@@ -35,17 +35,17 @@
 									{{$.Owner.DisplayName}}
 								</a>
 							</td>
-							<td>{{TimeSince .Created $.locale}}</td>
+							<td>{{TimeSince .Created ctx.Locale}}</td>
 							<td class="right aligned">
 								<form action="{{$.LFSFilesLink}}/locks/{{$lock.ID}}/unlock" method="post">
 									{{$.CsrfTokenHtml}}
-									<button class="ui primary button"><span class="btn-octicon">{{svg "octicon-lock"}}</span>{{$.locale.Tr "repo.settings.lfs_force_unlock"}}</button>
+									<button class="ui primary button"><span class="btn-octicon">{{svg "octicon-lock"}}</span>{{ctx.Locale.Tr "repo.settings.lfs_force_unlock"}}</button>
 								</form>
 							</td>
 						</tr>
 					{{else}}
 						<tr>
-							<td colspan="4">{{.locale.Tr "repo.settings.lfs_locks_no_locks"}}</td>
+							<td colspan="4">{{ctx.Locale.Tr "repo.settings.lfs_locks_no_locks"}}</td>
 						</tr>
 					{{end}}
 				</tbody>
diff --git a/templates/repo/settings/lfs_pointers.tmpl b/templates/repo/settings/lfs_pointers.tmpl
index db3fdd2f85..c22f56a14f 100644
--- a/templates/repo/settings/lfs_pointers.tmpl
+++ b/templates/repo/settings/lfs_pointers.tmpl
@@ -1,7 +1,7 @@
 {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings lfs")}}
 	<div class="repo-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist}}
+			{{ctx.Locale.Tr "repo.settings.lfs_pointers.found" .NumPointers .NumAssociated .NumNotAssociated .NumNoExist}}
 			{{if gt .NumAssociatable 0}}
 				<div class="ui right">
 					<form class="ui form" method="post" action="{{$.Link}}/associate">
@@ -11,7 +11,7 @@
 								<input type="hidden" name="oid" value="{{.Oid}} {{.Size}}">
 							{{end}}
 						{{end}}
-						<button class="ui primary button">{{$.locale.Tr "repo.settings.lfs_pointers.associateAccessible" $.NumAssociatable}}</button>
+						<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.lfs_pointers.associateAccessible" $.NumAssociatable}}</button>
 					</form>
 				</div>
 			{{end}}
@@ -20,11 +20,11 @@
 			<table id="lfs-files-table" class="ui fixed single line table">
 				<thead>
 					<tr>
-						<th class="three wide">{{.locale.Tr "repo.settings.lfs_pointers.sha"}}</th>
-						<th class="four wide">{{.locale.Tr "repo.settings.lfs_pointers.oid"}}</th>
-						<th class="two wide">{{.locale.Tr "repo.settings.lfs_pointers.inRepo"}}</th>
-						<th class="two wide">{{.locale.Tr "repo.settings.lfs_pointers.exists"}}</th>
-						<th class="two wide" data-tooltip-content="{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}">{{.locale.Tr "repo.settings.lfs_pointers.accessible"}}</th>
+						<th class="three wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.sha"}}</th>
+						<th class="four wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.oid"}}</th>
+						<th class="two wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.inRepo"}}</th>
+						<th class="two wide">{{ctx.Locale.Tr "repo.settings.lfs_pointers.exists"}}</th>
+						<th class="two wide" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.lfs_pointers.accessible"}}">{{ctx.Locale.Tr "repo.settings.lfs_pointers.accessible"}}</th>
 						<th class="three wide"></th>
 					</tr>
 				</thead>
@@ -45,7 +45,7 @@
 							<td>{{if .Exists}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
 							<td>{{if .Accessible}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
 							<td class="gt-text-right">
-								<a class="ui primary button" href="{{$.LFSFilesLink}}/find?oid={{.Oid}}&size={{.Size}}&sha={{.SHA}}">{{$.locale.Tr "repo.settings.lfs_findcommits"}}</a>
+								<a class="ui primary button" href="{{$.LFSFilesLink}}/find?oid={{.Oid}}&size={{.Size}}&sha={{.SHA}}">{{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}</a>
 							</td>
 						</tr>
 					{{end}}
diff --git a/templates/repo/settings/nav.tmpl b/templates/repo/settings/nav.tmpl
index 4a88d69adf..93ecb3877b 100644
--- a/templates/repo/settings/nav.tmpl
+++ b/templates/repo/settings/nav.tmpl
@@ -1,19 +1,19 @@
 <div id="setting-menu" class="grid-1-5 panel panel-radius left">
-	<p class="panel-header"><strong>{{.locale.Tr "repo.settings"}}</strong></p>
+	<p class="panel-header"><strong>{{ctx.Locale.Tr "repo.settings"}}</strong></p>
 	<div class="panel-body">
 		<ul class="menu menu-vertical switching-list grid-1-5 left">
-			<li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.locale.Tr "repo.settings.options"}}</a></li>
-			<li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.locale.Tr "repo.settings.collaboration"}}</a></li>
-			<li {{if .PageIsSettingsBranches}}class="current"{{end}}><a href="{{.RepoLink}}/settings/branches">{{.locale.Tr "repo.settings.branches"}}</a></li>
-			<li {{if .PageIsSettingsTags}}class="current"{{end}}><a href="{{.RepoLink}}/settings/tags">{{.locale.Tr "repo.settings.tags"}}</a></li>
+			<li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{ctx.Locale.Tr "repo.settings.options"}}</a></li>
+			<li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{ctx.Locale.Tr "repo.settings.collaboration"}}</a></li>
+			<li {{if .PageIsSettingsBranches}}class="current"{{end}}><a href="{{.RepoLink}}/settings/branches">{{ctx.Locale.Tr "repo.settings.branches"}}</a></li>
+			<li {{if .PageIsSettingsTags}}class="current"{{end}}><a href="{{.RepoLink}}/settings/tags">{{ctx.Locale.Tr "repo.settings.tags"}}</a></li>
 			{{if not DisableWebhooks}}
-			<li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.locale.Tr "repo.settings.hooks"}}</a></li>
+			<li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{ctx.Locale.Tr "repo.settings.hooks"}}</a></li>
 			{{end}}
 			{{if or .SignedUser.AllowGitHook .SignedUser.IsAdmin}}
-				<li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{.locale.Tr "repo.settings.githooks"}}</a></li>
+				<li {{if .PageIsSettingsGitHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks/git">{{ctx.Locale.Tr "repo.settings.githooks"}}</a></li>
 			{{end}}
-			<li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.locale.Tr "repo.settings.deploy_keys"}}</a></li>
-			<li {{if .PageIsSharedSettingsSecrets}}class="current"{{end}}><a href="{{.RepoLink}}/settings/secrets">{{.locale.Tr "secrets.secrets"}}</a></li>
+			<li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{ctx.Locale.Tr "repo.settings.deploy_keys"}}</a></li>
+			<li {{if .PageIsSharedSettingsSecrets}}class="current"{{end}}><a href="{{.RepoLink}}/settings/secrets">{{ctx.Locale.Tr "secrets.secrets"}}</a></li>
 		</ul>
 	</div>
 </div>
diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl
index 390cc5022d..74c4b86c68 100644
--- a/templates/repo/settings/navbar.tmpl
+++ b/templates/repo/settings/navbar.tmpl
@@ -1,50 +1,50 @@
 <div class="four wide column">
 	<div class="ui fluid vertical menu">
-		<div class="header item">{{.locale.Tr "repo.settings"}}</div>
+		<div class="header item">{{ctx.Locale.Tr "repo.settings"}}</div>
 		<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.RepoLink}}/settings">
-			{{.locale.Tr "repo.settings.options"}}
+			{{ctx.Locale.Tr "repo.settings.options"}}
 		</a>
 		<a class="{{if .PageIsSettingsCollaboration}}active {{end}}item" href="{{.RepoLink}}/settings/collaboration">
-			{{.locale.Tr "repo.settings.collaboration"}}
+			{{ctx.Locale.Tr "repo.settings.collaboration"}}
 		</a>
 		{{if not .Repository.IsEmpty}}
 			<a class="{{if .PageIsSettingsBranches}}active {{end}}item" href="{{.RepoLink}}/settings/branches">
-				{{.locale.Tr "repo.settings.branches"}}
+				{{ctx.Locale.Tr "repo.settings.branches"}}
 			</a>
 		{{end}}
 		<a class="{{if .PageIsSettingsTags}}active {{end}}item" href="{{.RepoLink}}/settings/tags">
-			{{.locale.Tr "repo.settings.tags"}}
+			{{ctx.Locale.Tr "repo.settings.tags"}}
 		</a>
 		{{if not DisableWebhooks}}
 			<a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks">
-				{{.locale.Tr "repo.settings.hooks"}}
+				{{ctx.Locale.Tr "repo.settings.hooks"}}
 			</a>
 		{{end}}
 		{{if .SignedUser.CanEditGitHook}}
 			<a class="{{if .PageIsSettingsGitHooks}}active {{end}}item" href="{{.RepoLink}}/settings/hooks/git">
-				{{.locale.Tr "repo.settings.githooks"}}
+				{{ctx.Locale.Tr "repo.settings.githooks"}}
 			</a>
 		{{end}}
 		<a class="{{if .PageIsSettingsKeys}}active {{end}}item" href="{{.RepoLink}}/settings/keys">
-			{{.locale.Tr "repo.settings.deploy_keys"}}
+			{{ctx.Locale.Tr "repo.settings.deploy_keys"}}
 		</a>
 		{{if .LFSStartServer}}
 			<a class="{{if .PageIsSettingsLFS}}active {{end}}item" href="{{.RepoLink}}/settings/lfs">
-				{{.locale.Tr "repo.settings.lfs"}}
+				{{ctx.Locale.Tr "repo.settings.lfs"}}
 			</a>
 		{{end}}
 		{{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}}
 		<details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}open{{end}}>
-			<summary>{{.locale.Tr "actions.actions"}}</summary>
+			<summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
 			<div class="menu">
 				<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{.RepoLink}}/settings/actions/runners">
-					{{.locale.Tr "actions.runners"}}
+					{{ctx.Locale.Tr "actions.runners"}}
 				</a>
 				<a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{.RepoLink}}/settings/actions/secrets">
-					{{.locale.Tr "secrets.secrets"}}
+					{{ctx.Locale.Tr "secrets.secrets"}}
 				</a>
 				<a class="{{if .PageIsSharedSettingsVariables}}active {{end}}item" href="{{.RepoLink}}/settings/actions/variables">
-					{{.locale.Tr "actions.variables"}}
+					{{ctx.Locale.Tr "actions.variables"}}
 				</a>
 			</div>
 		</details>
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 28841de4cd..85ff82fda7 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -1,7 +1,7 @@
 {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}}
 	<div class="user-main-content twelve wide column">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.basic_settings"}}
+			{{ctx.Locale.Tr "repo.settings.basic_settings"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="{{.Link}}" method="post">
@@ -9,43 +9,43 @@
 				{{.CsrfTokenHtml}}
 				<input type="hidden" name="action" value="update">
 				<div class="required field {{if .Err_RepoName}}error{{end}}">
-					<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+					<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 					<input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
 				</div>
 				<div class="inline field">
-					<label>{{.locale.Tr "repo.repo_size"}}</label>
+					<label>{{ctx.Locale.Tr "repo.repo_size"}}</label>
 					<span {{if not (eq .Repository.Size 0)}} data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>{{FileSize .Repository.Size}}</span>
 				</div>
 				<div class="inline field">
-					<label>{{.locale.Tr "repo.template"}}</label>
+					<label>{{ctx.Locale.Tr "repo.template"}}</label>
 					<div class="ui checkbox">
 						<input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}>
-						<label>{{.locale.Tr "repo.template_helper"}}</label>
+						<label>{{ctx.Locale.Tr "repo.template_helper"}}</label>
 					</div>
 				</div>
 				{{if not .Repository.IsFork}}
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.visibility"}}</label>
-						<div class="ui checkbox" {{if and (not .Repository.IsPrivate) (gt .Repository.NumStars 0)}}data-tooltip-content="{{.locale.Tr "repo.stars_remove_warning"}}"{{end}}>
+						<label>{{ctx.Locale.Tr "repo.visibility"}}</label>
+						<div class="ui checkbox" {{if and (not .Repository.IsPrivate) (gt .Repository.NumStars 0)}}data-tooltip-content="{{ctx.Locale.Tr "repo.stars_remove_warning"}}"{{end}}>
 							{{if .IsAdmin}}
 							<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
 							{{else}}
 							<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} readonly{{end}}>
 							{{end}}
-							<label>{{.locale.Tr "repo.visibility_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.locale.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label>
+							<label>{{ctx.Locale.Tr "repo.visibility_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{ctx.Locale.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label>
 						</div>
 					</div>
 				{{end}}
 				<div class="field {{if .Err_Description}}error{{end}}">
-					<label for="description">{{$.locale.Tr "repo.repo_desc"}}</label>
+					<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
 					<textarea id="description" name="description" rows="2" maxlength="2048">{{.Repository.Description}}</textarea>
 				</div>
 				<div class="field {{if .Err_Website}}error{{end}}">
-					<label for="website">{{.locale.Tr "repo.settings.site"}}</label>
+					<label for="website">{{ctx.Locale.Tr "repo.settings.site"}}</label>
 					<input id="website" name="website" type="url" maxlength="1024" value="{{.Repository.Website}}">
 				</div>
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
 				</div>
 			</form>
 
@@ -53,12 +53,12 @@
 			<form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
 				{{.CsrfTokenHtml}}
 				<div class="inline field">
-					<label for="avatar">{{.locale.Tr "settings.choose_new_avatar"}}</label>
+					<label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
 					<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
 				</div>
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button>
-					<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
+					<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
 				</div>
 			</form>
 		</div>
@@ -76,37 +76,37 @@
 
 		{{if $showMirrorSettings}}
 			<h4 class="ui top attached header">
-				{{.locale.Tr "repo.settings.mirror_settings"}}
+				{{ctx.Locale.Tr "repo.settings.mirror_settings"}}
 			</h4>
 			<div class="ui attached segment">
 				{{if $newMirrorsEntirelyEnabled}}
-					{{$.locale.Tr "repo.settings.mirror_settings.docs"}}
-					<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pushing-to-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
-					{{$.locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}}
-					<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section"}}</a><br>
+					{{ctx.Locale.Tr "repo.settings.mirror_settings.docs"}}
+					<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pushing-to-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
+					{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.pull_mirror_instructions"}}
+					<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_pull_section"}}</a><br>
 				{{else if $onlyNewPushMirrorsEnabled}}
-					{{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}}
-					{{$.locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
-					<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br>
+					{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_pull_mirror.instructions"}}
+					{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
+					<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br>
 				{{else if $onlyNewPullMirrorsEnabled}}
-					{{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}}
-					{{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}}
-					{{$.locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
-					<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{$.locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
-					{{$.locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}}
+					{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.instructions"}}
+					{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.pull_mirror_warning"}}
+					{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.more_information_if_disabled"}}
+					<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com/usage/repo-mirror#pulling-from-a-remote-repository">{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.doc_link_title"}}</a><br><br>
+					{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.disabled_push_mirror.info"}}
 					{{if $existingPushMirror}}
-						{{$.locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}
+						{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}
 					{{end}}
 				{{else}}
-					{{$.locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{$.locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}<br>
+					{{ctx.Locale.Tr "repo.settings.mirror_settings.docs.no_new_mirrors"}} {{ctx.Locale.Tr "repo.settings.mirror_settings.docs.can_still_use"}}<br>
 				{{end}}
 				<table class="ui table">
 					{{if $existingPushMirror}}
 					<thead>
 						<tr>
-							<th style="width:40%">{{$.locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</th>
-							<th>{{$.locale.Tr "repo.settings.mirror_settings.direction"}}</th>
-							<th>{{$.locale.Tr "repo.settings.mirror_settings.last_update"}}</th>
+							<th style="width:40%">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</th>
+							<th>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction"}}</th>
+							<th>{{ctx.Locale.Tr "repo.settings.mirror_settings.last_update"}}</th>
 							<th></th>
 						</tr>
 					</thead>
@@ -116,7 +116,7 @@
 						<tbody>
 							<tr>
 								<td colspan="4">
-									<div class="text red gt-py-4 gt-border-secondary-bottom">{{$.locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{$.locale.Tr "error.occurred"}}</div>
+									<div class="text red gt-py-4 gt-border-secondary-bottom">{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{ctx.Locale.Tr "error.occurred"}}</div>
 								</td>
 							</tr>
 						</tbody>
@@ -124,13 +124,13 @@
 					<tbody>
 						<tr>
 							<td>{{.PullMirror.RemoteAddress}}</td>
-							<td>{{$.locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td>
+							<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}</td>
 							<td>{{DateTime "full" .PullMirror.UpdatedUnix}}</td>
 							<td class="right aligned">
 								<form method="post" class="gt-dib">
 									{{.CsrfTokenHtml}}
 									<input type="hidden" name="action" value="mirror-sync">
-									<button class="ui primary tiny button inline text-thin">{{$.locale.Tr "repo.settings.sync_mirror"}}</button>
+									<button class="ui primary tiny button inline text-thin">{{ctx.Locale.Tr "repo.settings.sync_mirror"}}</button>
 								</form>
 							</td>
 						</tr>
@@ -141,55 +141,55 @@
 									{{.CsrfTokenHtml}}
 									<input type="hidden" name="action" value="mirror">
 									<div class="inline field {{if .Err_EnablePrune}}error{{end}}">
-										<label>{{.locale.Tr "repo.mirror_prune"}}</label>
+										<label>{{ctx.Locale.Tr "repo.mirror_prune"}}</label>
 										<div class="ui checkbox">
 									<input id="enable_prune" name="enable_prune" type="checkbox" {{if .PullMirror.EnablePrune}}checked{{end}}>
-									<label>{{.locale.Tr "repo.mirror_prune_desc"}}</label>
+									<label>{{ctx.Locale.Tr "repo.mirror_prune_desc"}}</label>
 										</div>
 									</div>
 									<div class="inline field {{if .Err_Interval}}error{{end}}">
-										<label for="interval">{{.locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
+										<label for="interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
 										<input id="interval" name="interval" value="{{.PullMirror.Interval}}">
 									</div>
 									{{$address := MirrorRemoteAddress $.Context .Repository .PullMirror.GetRemoteName false}}
 									<div class="field {{if .Err_MirrorAddress}}error{{end}}">
-										<label for="mirror_address">{{.locale.Tr "repo.mirror_address"}}</label>
+										<label for="mirror_address">{{ctx.Locale.Tr "repo.mirror_address"}}</label>
 										<input id="mirror_address" name="mirror_address" value="{{$address.Address}}" required>
-										<p class="help">{{.locale.Tr "repo.mirror_address_desc"}}</p>
+										<p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p>
 									</div>
 									<details class="ui optional field" {{if or .Err_Auth $address.Username}}open{{end}}>
 										<summary class="gt-p-2">
-											{{.locale.Tr "repo.need_auth"}}
+											{{ctx.Locale.Tr "repo.need_auth"}}
 										</summary>
 										<div class="gt-p-2">
 											<div class="inline field {{if .Err_Auth}}error{{end}}">
-												<label for="mirror_username">{{.locale.Tr "username"}}</label>
+												<label for="mirror_username">{{ctx.Locale.Tr "username"}}</label>
 												<input id="mirror_username" name="mirror_username" value="{{$address.Username}}" {{if not .mirror_username}}data-need-clear="true"{{end}}>
 											</div>
 											<div class="inline field {{if .Err_Auth}}error{{end}}">
-												<label for="mirror_password">{{.locale.Tr "password"}}</label>
-												<input id="mirror_password" name="mirror_password" type="password" placeholder="{{if $address.Password}}{{.locale.Tr "repo.mirror_password_placeholder"}}{{else}}{{.locale.Tr "repo.mirror_password_blank_placeholder"}}{{end}}" value="" {{if not .mirror_password}}data-need-clear="true"{{end}} autocomplete="off">
+												<label for="mirror_password">{{ctx.Locale.Tr "password"}}</label>
+												<input id="mirror_password" name="mirror_password" type="password" placeholder="{{if $address.Password}}{{ctx.Locale.Tr "repo.mirror_password_placeholder"}}{{else}}{{ctx.Locale.Tr "repo.mirror_password_blank_placeholder"}}{{end}}" value="" {{if not .mirror_password}}data-need-clear="true"{{end}} autocomplete="off">
 											</div>
-											<p class="help">{{.locale.Tr "repo.mirror_password_help"}}</p>
+											<p class="help">{{ctx.Locale.Tr "repo.mirror_password_help"}}</p>
 										</div>
 									</details>
 
 									{{if .LFSStartServer}}
 									<div class="inline field">
-										<label>{{.locale.Tr "repo.mirror_lfs"}}</label>
+										<label>{{ctx.Locale.Tr "repo.mirror_lfs"}}</label>
 										<div class="ui checkbox">
 											<input id="mirror_lfs" name="mirror_lfs" type="checkbox" {{if .PullMirror.LFS}}checked{{end}}>
-											<label>{{.locale.Tr "repo.mirror_lfs_desc"}}</label>
+											<label>{{ctx.Locale.Tr "repo.mirror_lfs_desc"}}</label>
 										</div>
 									</div>
 									<div class="field {{if .Err_LFSEndpoint}}error{{end}}">
-										<label for="mirror_lfs_endpoint">{{.locale.Tr "repo.mirror_lfs_endpoint"}}</label>
-										<input id="mirror_lfs_endpoint" name="mirror_lfs_endpoint" value="{{.PullMirror.LFSEndpoint}}" placeholder="{{.locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}">
-										<p class="help">{{.locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}</p>
+										<label for="mirror_lfs_endpoint">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint"}}</label>
+										<input id="mirror_lfs_endpoint" name="mirror_lfs_endpoint" value="{{.PullMirror.LFSEndpoint}}" placeholder="{{ctx.Locale.Tr "repo.migrate_options_lfs_endpoint.placeholder"}}">
+										<p class="help">{{ctx.Locale.Tr "repo.mirror_lfs_endpoint_desc" "https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#server-discovery" | Str2html}}</p>
 									</div>
 									{{end}}
 									<div class="field">
-										<button class="ui primary button">{{$.locale.Tr "repo.settings.update_mirror_settings"}}</button>
+										<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_mirror_settings"}}</button>
 									</div>
 								</form>
 							</td>
@@ -201,13 +201,13 @@
 						{{range .PushMirrors}}
 						<tr>
 							<td class="gt-word-break">{{.RemoteAddress}}</td>
-							<td>{{$.locale.Tr "repo.settings.mirror_settings.direction.push"}}</td>
-							<td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{$.locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{$.locale.Tr "error"}}</div>{{end}}</td>
+							<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.push"}}</td>
+							<td>{{if .LastUpdateUnix}}{{DateTime "full" .LastUpdateUnix}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .LastError}}<div class="ui red label" data-tooltip-content="{{.LastError}}">{{ctx.Locale.Tr "error"}}</div>{{end}}</td>
 							<td class="right aligned">
 								<button
 									class="ui tiny button show-modal"
 									data-modal="#push-mirror-edit-modal"
-									data-tooltip-content="{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}"
+									data-tooltip-content="{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}"
 									data-modal-push-mirror-edit-id="{{.ID}}"
 									data-modal-push-mirror-edit-interval="{{.Interval}}"
 									data-modal-push-mirror-edit-address="{{.RemoteAddress}}"
@@ -218,19 +218,19 @@
 									{{$.CsrfTokenHtml}}
 									<input type="hidden" name="action" value="push-mirror-sync">
 									<input type="hidden" name="push_mirror_id" value="{{.ID}}">
-									<button class="ui primary tiny button" data-tooltip-content="{{$.locale.Tr "repo.settings.sync_mirror"}}">{{svg "octicon-sync" 14}}</button>
+									<button class="ui primary tiny button" data-tooltip-content="{{ctx.Locale.Tr "repo.settings.sync_mirror"}}">{{svg "octicon-sync" 14}}</button>
 								</form>
 								<form method="post" class="gt-dib">
 									{{$.CsrfTokenHtml}}
 									<input type="hidden" name="action" value="push-mirror-remove">
 									<input type="hidden" name="push_mirror_id" value="{{.ID}}">
-									<button class="ui basic red tiny button" data-tooltip-content="{{$.locale.Tr "remove"}}">{{svg "octicon-trash" 14}}</button>
+									<button class="ui basic red tiny button" data-tooltip-content="{{ctx.Locale.Tr "remove"}}">{{svg "octicon-trash" 14}}</button>
 								</form>
 							</td>
 						</tr>
 						{{else}}
 						<tr>
-							<td>{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}</td>
+							<td>{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.none"}}</td>
 						</tr>
 						{{end}}
 						{{if (not .DisableNewPushMirrors)}}
@@ -241,21 +241,21 @@
 										{{.CsrfTokenHtml}}
 										<input type="hidden" name="action" value="push-mirror-add">
 										<div class="field {{if .Err_PushMirrorAddress}}error{{end}}">
-											<label for="push_mirror_address">{{.locale.Tr "repo.settings.mirror_settings.push_mirror.remote_url"}}</label>
+											<label for="push_mirror_address">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.remote_url"}}</label>
 											<input id="push_mirror_address" name="push_mirror_address" value="{{.push_mirror_address}}" required>
-											<p class="help">{{.locale.Tr "repo.mirror_address_desc"}}</p>
+											<p class="help">{{ctx.Locale.Tr "repo.mirror_address_desc"}}</p>
 										</div>
 										<details class="ui optional field" {{if or .Err_PushMirrorAuth .push_mirror_username}}open{{end}}>
 											<summary class="gt-p-2">
-												{{.locale.Tr "repo.need_auth"}}
+												{{ctx.Locale.Tr "repo.need_auth"}}
 											</summary>
 											<div class="gt-p-2">
 												<div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}">
-													<label for="push_mirror_username">{{.locale.Tr "username"}}</label>
+													<label for="push_mirror_username">{{ctx.Locale.Tr "username"}}</label>
 													<input id="push_mirror_username" name="push_mirror_username" value="{{.push_mirror_username}}">
 												</div>
 												<div class="inline field {{if .Err_PushMirrorAuth}}error{{end}}">
-													<label for="push_mirror_password">{{.locale.Tr "password"}}</label>
+													<label for="push_mirror_password">{{ctx.Locale.Tr "password"}}</label>
 													<input id="push_mirror_password" name="push_mirror_password" type="password" value="{{.push_mirror_password}}" autocomplete="off">
 												</div>
 											</div>
@@ -263,15 +263,15 @@
 										<div class="field">
 											<div class="ui checkbox">
 												<input id="push_mirror_sync_on_commit" name="push_mirror_sync_on_commit" type="checkbox" {{if .push_mirror_sync_on_commit}}checked{{end}}>
-												<label for="push_mirror_sync_on_commit">{{.locale.Tr "repo.mirror_sync_on_commit"}}</label>
+												<label for="push_mirror_sync_on_commit">{{ctx.Locale.Tr "repo.mirror_sync_on_commit"}}</label>
 											</div>
 										</div>
 										<div class="inline field {{if .Err_PushMirrorInterval}}error{{end}}">
-											<label for="push_mirror_interval">{{.locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
+											<label for="push_mirror_interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
 											<input id="push_mirror_interval" name="push_mirror_interval" value="{{if .push_mirror_interval}}{{.push_mirror_interval}}{{else}}{{.DefaultMirrorInterval}}{{end}}">
 										</div>
 										<div class="field">
-											<button class="ui primary button">{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button>
+											<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button>
 										</div>
 									</form>
 								</td>
@@ -283,7 +283,7 @@
 		{{end}}
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.advanced_settings"}}
+			{{ctx.Locale.Tr "repo.settings.advanced_settings"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" method="post">
@@ -293,10 +293,10 @@
 				{{$isCodeEnabled := .Repository.UnitEnabled $.Context $.UnitTypeCode}}
 				{{$isCodeGlobalDisabled := .UnitTypeCode.UnitGlobalDisabled}}
 				<div class="inline field">
-					<label>{{.locale.Tr "repo.code"}}</label>
-					<div class="ui checkbox{{if $isCodeGlobalDisabled}} disabled{{end}}"{{if $isCodeGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+					<label>{{ctx.Locale.Tr "repo.code"}}</label>
+					<div class="ui checkbox{{if $isCodeGlobalDisabled}} disabled{{end}}"{{if $isCodeGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 						<input class="enable-system" name="enable_code" type="checkbox"{{if $isCodeEnabled}} checked{{end}}>
-						<label>{{.locale.Tr "repo.code.desc"}}</label>
+						<label>{{ctx.Locale.Tr "repo.code.desc"}}</label>
 					</div>
 				</div>
 
@@ -305,29 +305,29 @@
 				{{$isExternalWikiGlobalDisabled := .UnitTypeExternalWiki.UnitGlobalDisabled}}
 				{{$isBothWikiGlobalDisabled := and $isWikiGlobalDisabled $isExternalWikiGlobalDisabled}}
 				<div class="inline field">
-					<label>{{.locale.Tr "repo.wiki"}}</label>
-					<div class="ui checkbox{{if $isBothWikiGlobalDisabled}} disabled{{end}}"{{if $isBothWikiGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+					<label>{{ctx.Locale.Tr "repo.wiki"}}</label>
+					<div class="ui checkbox{{if $isBothWikiGlobalDisabled}} disabled{{end}}"{{if $isBothWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 						<input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.wiki_desc"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.wiki_desc"}}</label>
 					</div>
 				</div>
 				<div class="field{{if not $isWikiEnabled}} disabled{{end}}" id="wiki_box">
 					<div class="field">
-						<div class="ui radio checkbox{{if $isWikiGlobalDisabled}} disabled{{end}}"{{if $isWikiGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+						<div class="ui radio checkbox{{if $isWikiGlobalDisabled}} disabled{{end}}"{{if $isWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 							<input class="enable-system-radio" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.use_internal_wiki"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.use_internal_wiki"}}</label>
 						</div>
 					</div>
 					<div class="field">
-						<div class="ui radio checkbox{{if $isExternalWikiGlobalDisabled}} disabled{{end}}"{{if $isExternalWikiGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+						<div class="ui radio checkbox{{if $isExternalWikiGlobalDisabled}} disabled{{end}}"{{if $isExternalWikiGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 							<input class="enable-system-radio" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalWiki}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.use_external_wiki"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.use_external_wiki"}}</label>
 						</div>
 					</div>
 					<div class="field gt-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box">
-						<label for="external_wiki_url">{{.locale.Tr "repo.settings.external_wiki_url"}}</label>
+						<label for="external_wiki_url">{{ctx.Locale.Tr "repo.settings.external_wiki_url"}}</label>
 						<input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}">
-						<p class="help">{{.locale.Tr "repo.settings.external_wiki_url_desc"}}</p>
+						<p class="help">{{ctx.Locale.Tr "repo.settings.external_wiki_url_desc"}}</p>
 					</div>
 				</div>
 
@@ -338,17 +338,17 @@
 				{{$isExternalTrackerGlobalDisabled := .UnitTypeExternalTracker.UnitGlobalDisabled}}
 				{{$isIssuesAndExternalGlobalDisabled := and $isIssuesGlobalDisabled $isExternalTrackerGlobalDisabled}}
 				<div class="inline field">
-					<label>{{.locale.Tr "repo.issues"}}</label>
-					<div class="ui checkbox{{if $isIssuesAndExternalGlobalDisabled}} disabled{{end}}"{{if $isIssuesAndExternalGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+					<label>{{ctx.Locale.Tr "repo.issues"}}</label>
+					<div class="ui checkbox{{if $isIssuesAndExternalGlobalDisabled}} disabled{{end}}"{{if $isIssuesAndExternalGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 						<input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.issues_desc"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.issues_desc"}}</label>
 					</div>
 				</div>
 				<div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box">
 					<div class="field">
-						<div class="ui radio checkbox{{if $isIssuesGlobalDisabled}} disabled{{end}}"{{if $isIssuesGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+						<div class="ui radio checkbox{{if $isIssuesGlobalDisabled}} disabled{{end}}"{{if $isIssuesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 							<input class="enable-system-radio" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.use_internal_issue_tracker"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.use_internal_issue_tracker"}}</label>
 						</div>
 					</div>
 					<div class="field gt-pl-4 {{if (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box">
@@ -356,71 +356,71 @@
 							<div class="field">
 								<div class="ui checkbox">
 									<input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled $.Context}}checked{{end}}>
-									<label>{{.locale.Tr "repo.settings.enable_timetracker"}}</label>
+									<label>{{ctx.Locale.Tr "repo.settings.enable_timetracker"}}</label>
 								</div>
 							</div>
 							<div class="field {{if not (.Repository.IsTimetrackerEnabled $.Context)}}disabled{{end}}" id="only_contributors">
 								<div class="ui checkbox">
 									<input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime $.Context}}checked{{end}}>
-									<label>{{.locale.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
+									<label>{{ctx.Locale.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
 								</div>
 							</div>
 						{{end}}
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="enable_issue_dependencies" type="checkbox" {{if (.Repository.IsDependenciesEnabled $.Context)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.issues.dependency.setting"}}</label>
+								<label>{{ctx.Locale.Tr "repo.issues.dependency.setting"}}</label>
 							</div>
 						</div>
 						<div class="ui checkbox">
 							<input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{if .Repository.CloseIssuesViaCommitInAnyBranch}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label>
 						</div>
 					</div>
 					<div class="field">
-						<div class="ui radio checkbox{{if $isExternalTrackerGlobalDisabled}} disabled{{end}}"{{if $isExternalTrackerGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+						<div class="ui radio checkbox{{if $isExternalTrackerGlobalDisabled}} disabled{{end}}"{{if $isExternalTrackerGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 							<input class="enable-system-radio" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.Context $.UnitTypeExternalTracker}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.use_external_issue_tracker"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.use_external_issue_tracker"}}</label>
 						</div>
 					</div>
 					<div class="field gt-pl-4 {{if not (.Repository.UnitEnabled $.Context $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box">
 						<div class="field">
-							<label for="external_tracker_url">{{.locale.Tr "repo.settings.external_tracker_url"}}</label>
+							<label for="external_tracker_url">{{ctx.Locale.Tr "repo.settings.external_tracker_url"}}</label>
 							<input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}">
-							<p class="help">{{.locale.Tr "repo.settings.external_tracker_url_desc"}}</p>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.external_tracker_url_desc"}}</p>
 						</div>
 						<div class="field">
-							<label for="tracker_url_format">{{.locale.Tr "repo.settings.tracker_url_format"}}</label>
+							<label for="tracker_url_format">{{ctx.Locale.Tr "repo.settings.tracker_url_format"}}</label>
 							<input id="tracker_url_format" name="tracker_url_format" type="url" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerFormat}}" placeholder="https://github.com/{user}/{repo}/issues/{index}">
-							<p class="help">{{.locale.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
 						</div>
 						<div class="inline fields">
-							<label for="issue_style">{{.locale.Tr "repo.settings.tracker_issue_style"}}</label>
+							<label for="issue_style">{{ctx.Locale.Tr "repo.settings.tracker_issue_style"}}</label>
 							<div class="field">
 								<div class="ui radio checkbox">
 								{{$externalTracker := (.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker)}}
 								{{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}}
 									<input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="numeric" {{if eq $externalTrackerStyle "numeric"}}checked{{end}}>
-									<label>{{.locale.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">#1234</span></label>
+									<label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">#1234</span></label>
 								</div>
 							</div>
 							<div class="field">
 								<div class="ui radio checkbox">
 									<input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="alphanumeric" {{if eq $externalTrackerStyle "alphanumeric"}}checked{{end}}>
-									<label>{{.locale.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">ABC-123 , DEFG-234</span></label>
+									<label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">ABC-123 , DEFG-234</span></label>
 								</div>
 							</div>
 							<div class="field">
 								<div class="ui radio checkbox">
 									<input class="js-tracker-issue-style" name="tracker_issue_style" type="radio" value="regexp" {{if eq $externalTrackerStyle "regexp"}}checked{{end}}>
-									<label>{{.locale.Tr "repo.settings.tracker_issue_style.regexp"}} <span class="ui light grey text">(ISSUE-\d+) , ISSUE-(\d+)</span></label>
+									<label>{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp"}} <span class="ui light grey text">(ISSUE-\d+) , ISSUE-(\d+)</span></label>
 								</div>
 							</div>
 						</div>
 						<div class="field {{if ne $externalTrackerStyle "regexp"}}disabled{{end}}" id="tracker-issue-style-regex-box">
-							<label for="external_tracker_regexp_pattern">{{.locale.Tr "repo.settings.tracker_issue_style.regexp_pattern"}}</label>
+							<label for="external_tracker_regexp_pattern">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern"}}</label>
 							<input id="external_tracker_regexp_pattern" name="external_tracker_regexp_pattern" value="{{(.Repository.MustGetUnit $.Context $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerRegexpPattern}}">
-							<p class="help">{{.locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc" | Str2html}}</p>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.tracker_issue_style.regexp_pattern_desc" | Str2html}}</p>
 						</div>
 					</div>
 				</div>
@@ -430,30 +430,30 @@
 				{{$isProjectsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeProjects}}
 				{{$isProjectsGlobalDisabled := .UnitTypeProjects.UnitGlobalDisabled}}
 				<div class="inline field">
-					<label>{{.locale.Tr "repo.project_board"}}</label>
-					<div class="ui checkbox{{if $isProjectsGlobalDisabled}} disabled{{end}}"{{if $isProjectsGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+					<label>{{ctx.Locale.Tr "repo.project_board"}}</label>
+					<div class="ui checkbox{{if $isProjectsGlobalDisabled}} disabled{{end}}"{{if $isProjectsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 						<input class="enable-system" name="enable_projects" type="checkbox" {{if $isProjectsEnabled}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.projects_desc"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.projects_desc"}}</label>
 					</div>
 				</div>
 
 				{{$isReleasesEnabled := .Repository.UnitEnabled $.Context $.UnitTypeReleases}}
 				{{$isReleasesGlobalDisabled := .UnitTypeReleases.UnitGlobalDisabled}}
 				<div class="inline field">
-					<label>{{.locale.Tr "repo.releases"}}</label>
-					<div class="ui checkbox{{if $isReleasesGlobalDisabled}} disabled{{end}}"{{if $isReleasesGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+					<label>{{ctx.Locale.Tr "repo.releases"}}</label>
+					<div class="ui checkbox{{if $isReleasesGlobalDisabled}} disabled{{end}}"{{if $isReleasesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 						<input class="enable-system" name="enable_releases" type="checkbox" {{if $isReleasesEnabled}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.releases_desc"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.releases_desc"}}</label>
 					</div>
 				</div>
 
 				{{$isPackagesEnabled := .Repository.UnitEnabled $.Context $.UnitTypePackages}}
 				{{$isPackagesGlobalDisabled := .UnitTypePackages.UnitGlobalDisabled}}
 				<div class="inline field">
-					<label>{{.locale.Tr "repo.packages"}}</label>
-					<div class="ui checkbox{{if $isPackagesGlobalDisabled}} disabled{{end}}"{{if $isPackagesGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+					<label>{{ctx.Locale.Tr "repo.packages"}}</label>
+					<div class="ui checkbox{{if $isPackagesGlobalDisabled}} disabled{{end}}"{{if $isPackagesGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 						<input class="enable-system" name="enable_packages" type="checkbox" {{if $isPackagesEnabled}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.packages_desc"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.packages_desc"}}</label>
 					</div>
 				</div>
 
@@ -461,10 +461,10 @@
 					{{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}}
 					{{$isActionsGlobalDisabled := .UnitTypeActions.UnitGlobalDisabled}}
 					<div class="inline field">
-						<label>{{.locale.Tr "actions.actions"}}</label>
-							<div class="ui checkbox{{if $isActionsGlobalDisabled}} disabled{{end}}"{{if $isActionsGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+						<label>{{ctx.Locale.Tr "actions.actions"}}</label>
+							<div class="ui checkbox{{if $isActionsGlobalDisabled}} disabled{{end}}"{{if $isActionsGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 							<input class="enable-system" name="enable_actions" type="checkbox" {{if $isActionsEnabled}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.actions_desc"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.actions_desc"}}</label>
 						</div>
 					</div>
 				{{end}}
@@ -475,110 +475,110 @@
 					{{$pullRequestGlobalDisabled := .UnitTypePullRequests.UnitGlobalDisabled}}
 					{{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}}
 					<div class="inline field">
-						<label>{{.locale.Tr "repo.pulls"}}</label>
-						<div class="ui checkbox{{if $pullRequestGlobalDisabled}} disabled{{end}}"{{if $pullRequestGlobalDisabled}} data-tooltip-content="{{.locale.Tr "repo.unit_disabled"}}"{{end}}>
+						<label>{{ctx.Locale.Tr "repo.pulls"}}</label>
+						<div class="ui checkbox{{if $pullRequestGlobalDisabled}} disabled{{end}}"{{if $pullRequestGlobalDisabled}} data-tooltip-content="{{ctx.Locale.Tr "repo.unit_disabled"}}"{{end}}>
 							<input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.pulls_desc"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.pulls_desc"}}</label>
 						</div>
 					</div>
 					<div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box">
 						<div class="field">
 							<p>
-								{{.locale.Tr "repo.settings.merge_style_desc"}}
+								{{ctx.Locale.Tr "repo.settings.merge_style_desc"}}
 							</p>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.pulls.merge_pull_request"}}</label>
+								<label>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</label>
 							</div>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</label>
+								<label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</label>
 							</div>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="pulls_allow_rebase_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseMerge)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</label>
+								<label>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</label>
 							</div>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</label>
+								<label>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</label>
 							</div>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="pulls_allow_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowManualMerge)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.pulls.merge_manually"}}</label>
+								<label>{{ctx.Locale.Tr "repo.pulls.merge_manually"}}</label>
 							</div>
 						</div>
 
 						<div class="field">
 							<p>
-								{{.locale.Tr "repo.settings.default_merge_style_desc"}}
+								{{ctx.Locale.Tr "repo.settings.default_merge_style_desc"}}
 							</p>
 							<div class="ui dropdown selection">
 								<select name="pulls_default_merge_style">
-									<option value="merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}selected{{end}}>{{.locale.Tr "repo.pulls.merge_pull_request"}}</option>
-									<option value="rebase" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}selected{{end}}>{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</option>
-									<option value="rebase-merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}selected{{end}}>{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</option>
-									<option value="squash" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}selected{{end}}>{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</option>
+									<option value="merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</option>
+									<option value="rebase" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</option>
+									<option value="rebase-merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</option>
+									<option value="squash" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</option>
 								</select>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 								<div class="default text">
 									{{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}}
-										{{.locale.Tr "repo.pulls.merge_pull_request"}}
+										{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}
 									{{end}}
 									{{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase")}}
-										{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}
+										{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}
 									{{end}}
 									{{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "rebase-merge")}}
-										{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}
+										{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}
 									{{end}}
 									{{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}}
-										{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}
+										{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}
 									{{end}}
 								</div>
 								<div class="menu">
-									<div class="item" data-value="merge">{{.locale.Tr "repo.pulls.merge_pull_request"}}</div>
-									<div class="item" data-value="rebase">{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div>
-									<div class="item" data-value="rebase-merge">{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div>
-									<div class="item" data-value="squash">{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</div>
+									<div class="item" data-value="merge">{{ctx.Locale.Tr "repo.pulls.merge_pull_request"}}</div>
+									<div class="item" data-value="rebase">{{ctx.Locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div>
+									<div class="item" data-value="rebase-merge">{{ctx.Locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div>
+									<div class="item" data-value="squash">{{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}}</div>
 								</div>
 							</div>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="default_allow_maintainer_edit" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultAllowMaintainerEdit)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.settings.pulls.default_allow_edits_from_maintainers"}}</label>
+								<label>{{ctx.Locale.Tr "repo.settings.pulls.default_allow_edits_from_maintainers"}}</label>
 							</div>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="pulls_allow_rebase_update" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseUpdate)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label>
+								<label>{{ctx.Locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label>
 							</div>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="default_delete_branch_after_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label>
+								<label>{{ctx.Locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label>
 							</div>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="enable_autodetect_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AutodetectManualMerge)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label>
+								<label>{{ctx.Locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label>
 							</div>
 						</div>
 						<div class="field">
 							<div class="ui checkbox">
 								<input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}>
-								<label>{{.locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
+								<label>{{ctx.Locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
 							</div>
 						</div>
 					</div>
@@ -586,60 +586,60 @@
 
 				<div class="divider"></div>
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
 				</div>
 			</form>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.signing_settings"}}
+			{{ctx.Locale.Tr "repo.settings.signing_settings"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" method="post">
 				{{.CsrfTokenHtml}}
 				<input type="hidden" name="action" value="signing">
 				<div class="field">
-					<label>{{.locale.Tr "repo.settings.trust_model"}}</label><br>
+					<label>{{ctx.Locale.Tr "repo.settings.trust_model"}}</label><br>
 					<div class="field">
 						<div class="ui radio checkbox">
 							<input type="radio" id="trust_model_default" name="trust_model" {{if eq .Repository.TrustModel.String "default"}}checked="checked"{{end}} value="default">
-							<label for="trust_model_default">{{.locale.Tr "repo.settings.trust_model.default"}}</label>
-							<p class="help">{{.locale.Tr "repo.settings.trust_model.default.desc"}}</p>
+							<label for="trust_model_default">{{ctx.Locale.Tr "repo.settings.trust_model.default"}}</label>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.default.desc"}}</p>
 						</div>
 					</div>
 					<div class="field">
 						<div class="ui radio checkbox">
 							<input type="radio" id="trust_model_collaborator" name="trust_model" {{if eq .Repository.TrustModel.String "collaborator"}}checked="checked"{{end}} value="collaborator">
-							<label for="trust_model_collaborator">{{.locale.Tr "repo.settings.trust_model.collaborator.long"}}</label>
-							<p class="help">{{.locale.Tr "repo.settings.trust_model.collaborator.desc"}}</p>
+							<label for="trust_model_collaborator">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.long"}}</label>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaborator.desc"}}</p>
 						</div>
 					</div>
 					<div class="field">
 						<div class="ui radio checkbox">
 							<input type="radio" name="trust_model" id="trust_model_committer" {{if eq .Repository.TrustModel.String "committer"}}checked="checked"{{end}} value="committer">
-							<label for="trust_model_committer">{{.locale.Tr "repo.settings.trust_model.committer.long"}}</label>
-							<p class="help">{{.locale.Tr "repo.settings.trust_model.committer.desc"}}</p>
+							<label for="trust_model_committer">{{ctx.Locale.Tr "repo.settings.trust_model.committer.long"}}</label>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.committer.desc"}}</p>
 						</div>
 					</div>
 					<div class="field">
 						<div class="ui radio checkbox">
 							<input type="radio" name="trust_model" id="trust_model_collaboratorcommitter" {{if eq .Repository.TrustModel.String "collaboratorcommitter"}}checked="checked"{{end}} value="collaboratorcommitter">
-							<label for="trust_model_collaboratorcommitter">{{.locale.Tr "repo.settings.trust_model.collaboratorcommitter.long"}}</label>
-							<p class="help">{{.locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}</p>
+							<label for="trust_model_collaboratorcommitter">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.long"}}</label>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.trust_model.collaboratorcommitter.desc"}}</p>
 						</div>
 					</div>
 				</div>
 
 				<div class="divider"></div>
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
 				</div>
 			</form>
 		</div>
 
 		{{if .IsAdmin}}
 		<h4 class="ui top attached header">
-			{{.locale.Tr "repo.settings.admin_settings"}}
+			{{ctx.Locale.Tr "repo.settings.admin_settings"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" method="post">
@@ -648,12 +648,12 @@
 				<div class="field">
 					<div class="ui checkbox">
 						<input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.admin_enable_health_check"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.admin_enable_health_check"}}</label>
 					</div>
 				</div>
 
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
 				</div>
 			</form>
 
@@ -662,27 +662,27 @@
 				{{.CsrfTokenHtml}}
 				<input type="hidden" name="action" value="admin_index">
 				{{if .CodeIndexerEnabled}}
-					<h4 class="ui header">{{.locale.Tr "repo.settings.admin_code_indexer"}}</h4>
+					<h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}</h4>
 					<div class="inline fields">
-						<label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
 						<span class="field">
 							{{if .CodeIndexerStatus}}
 								<a rel="nofollow" class="ui sha label" href="{{.RepoLink}}/commit/{{.CodeIndexerStatus.CommitSha}}">
 									<span class="shortsha">{{ShortSha .CodeIndexerStatus.CommitSha}}</span>
 								</a>
 							{{else}}
-									<span>{{.locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
+									<span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
 							{{end}}
 						</span>
 						<div class="field">
-							<button class="ui primary button" name="request_reindex_type" value="code">{{$.locale.Tr "repo.settings.reindex_button"}}</button>
+							<button class="ui primary button" name="request_reindex_type" value="code">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button>
 						</div>
 					</div>
 				{{end}}
-				<h4 class="ui header">{{.locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
+				<h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_stats_indexer"}}</h4>
 				<div class="inline fields">
 					{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
-						<label>{{.locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
 					{{end}}
 					<span class="field">
 						{{if and .StatsIndexerStatus .StatsIndexerStatus.CommitSha}}
@@ -690,11 +690,11 @@
 								<span class="shortsha">{{ShortSha .StatsIndexerStatus.CommitSha}}</span>
 							</a>
 						{{else}}
-							<span>{{.locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
+							<span>{{ctx.Locale.Tr "repo.settings.admin_indexer_unindexed"}}</span>
 						{{end}}
 					</span>
 					<div class="field">
-						<button class="ui primary button" name="request_reindex_type" value="stats">{{$.locale.Tr "repo.settings.reindex_button"}}</button>
+						<button class="ui primary button" name="request_reindex_type" value="stats">{{ctx.Locale.Tr "repo.settings.reindex_button"}}</button>
 					</div>
 				</div>
 			</form>
@@ -703,40 +703,40 @@
 
 		{{if .Permission.IsOwner}}
 		<h4 class="ui top attached error header">
-			{{.locale.Tr "repo.settings.danger_zone"}}
+			{{ctx.Locale.Tr "repo.settings.danger_zone"}}
 		</h4>
 		<div class="ui attached error danger segment">
 			<div class="flex-list">
 				{{if .Repository.IsMirror}}
 					<div class="flex-item">
 						<div class="flex-item-main">
-							<div class="flex-item-title">{{.locale.Tr "repo.settings.convert"}}</div>
-							<div class="flex-item-body">{{.locale.Tr "repo.settings.convert_desc"}}</div>
+							<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert"}}</div>
+							<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_desc"}}</div>
 						</div>
 						<div class="flex-item-trailing">
-							<button class="ui basic red show-modal button" data-modal="#convert-mirror-repo-modal">{{.locale.Tr "repo.settings.convert"}}</button>
+							<button class="ui basic red show-modal button" data-modal="#convert-mirror-repo-modal">{{ctx.Locale.Tr "repo.settings.convert"}}</button>
 						</div>
 					</div>
 				{{end}}
 				{{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
 					<div class="flex-item">
 						<div class="flex-item-main">
-							<div class="flex-item-title">{{.locale.Tr "repo.settings.convert_fork"}}</div>
-							<div class="flex-item-body">{{.locale.Tr "repo.settings.convert_fork_desc"}}</div>
+							<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</div>
+							<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.convert_fork_desc"}}</div>
 						</div>
 						<div class="flex-item-trailing">
-							<button class="ui basic red show-modal button" data-modal="#convert-fork-repo-modal">{{.locale.Tr "repo.settings.convert_fork"}}</button>
+							<button class="ui basic red show-modal button" data-modal="#convert-fork-repo-modal">{{ctx.Locale.Tr "repo.settings.convert_fork"}}</button>
 						</div>
 					</div>
 				{{end}}
 				<div class="flex-item">
 					<div class="flex-item-main">
-						<div class="flex-item-title">{{.locale.Tr "repo.settings.transfer"}}</div>
+						<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.transfer"}}</div>
 						<div class="flex-item-body">
 							{{if .RepoTransfer}}
-								{{.locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}}
+								{{ctx.Locale.Tr "repo.settings.transfer_started" .RepoTransfer.Recipient.DisplayName}}
 							{{else}}
-								{{.locale.Tr "repo.settings.transfer_desc"}}
+								{{ctx.Locale.Tr "repo.settings.transfer_desc"}}
 							{{end}}
 						</div>
 					</div>
@@ -745,50 +745,50 @@
 							<form class="ui form" action="{{.Link}}" method="post">
 								{{.CsrfTokenHtml}}
 								<input type="hidden" name="action" value="cancel_transfer">
-								<button class="ui red button">{{.locale.Tr "repo.settings.transfer_abort"}}</button>
+								<button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_abort"}}</button>
 							</form>
 						{{else}}
-							<button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.locale.Tr "repo.settings.transfer"}}</button>
+							<button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{ctx.Locale.Tr "repo.settings.transfer"}}</button>
 						{{end}}
 					</div>
 				</div>
 				{{if .Permission.CanRead $.UnitTypeWiki}}
 					<div class="flex-item">
 						<div class="flex-item-main">
-							<div class="flex-item-title">{{.locale.Tr "repo.settings.wiki_delete"}}</div>
-							<div class="flex-item-body">{{.locale.Tr "repo.settings.wiki_delete_desc"}}</div>
+							<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</div>
+							<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.wiki_delete_desc"}}</div>
 						</div>
 						<div class="flex-item-trailing">
-							<button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.locale.Tr "repo.settings.wiki_delete"}}</button>
+							<button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{ctx.Locale.Tr "repo.settings.wiki_delete"}}</button>
 						</div>
 					</div>
 				{{end}}
 				<div class="flex-item">
 					<div class="flex-item-main">
-						<div class="flex-item-title">{{.locale.Tr "repo.settings.delete"}}</div>
-						<div class="flex-item-body">{{.locale.Tr "repo.settings.delete_desc"}}</div>
+						<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.delete"}}</div>
+						<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.delete_desc"}}</div>
 					</div>
 					<div class="flex-item-trailing">
-						<button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.locale.Tr "repo.settings.delete"}}</button>
+						<button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{ctx.Locale.Tr "repo.settings.delete"}}</button>
 					</div>
 				</div>
 				{{if not .Repository.IsMirror}}
 					<div class="flex-item gt-ac">
 						<div class="flex-item-main">
 							{{if .Repository.IsArchived}}
-								<div class="flex-item-title">{{.locale.Tr "repo.settings.unarchive.header"}}</div>
-								<div class="flex-item-body">{{.locale.Tr "repo.settings.unarchive.text"}}</div>
+								<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.unarchive.header"}}</div>
+								<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.unarchive.text"}}</div>
 							{{else}}
-								<div class="flex-item-title">{{.locale.Tr "repo.settings.archive.header"}}</div>
-								<div class="flex-item-body">{{.locale.Tr "repo.settings.archive.text"}}</div>
+								<div class="flex-item-title">{{ctx.Locale.Tr "repo.settings.archive.header"}}</div>
+								<div class="flex-item-body">{{ctx.Locale.Tr "repo.settings.archive.text"}}</div>
 							{{end}}
 						</div>
 						<div class="flex-item-trailing">
 							<button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
 								{{if .Repository.IsArchived}}
-									{{.locale.Tr "repo.settings.unarchive.button"}}
+									{{ctx.Locale.Tr "repo.settings.unarchive.button"}}
 								{{else}}
-									{{.locale.Tr "repo.settings.archive.button"}}
+									{{ctx.Locale.Tr "repo.settings.archive.button"}}
 								{{end}}
 							</button>
 						</div>
@@ -804,29 +804,29 @@
 	{{if .Repository.IsMirror}}
 		<div class="ui small modal" id="convert-mirror-repo-modal">
 			<div class="header">
-				{{.locale.Tr "repo.settings.convert"}}
+				{{ctx.Locale.Tr "repo.settings.convert"}}
 			</div>
 			<div class="content">
 				<div class="ui warning message">
-					{{.locale.Tr "repo.settings.convert_notices_1"}}
+					{{ctx.Locale.Tr "repo.settings.convert_notices_1"}}
 				</div>
 				<form class="ui form" action="{{.Link}}" method="post">
 					{{.CsrfTokenHtml}}
 					<input type="hidden" name="action" value="convert">
 					<div class="field">
 						<label>
-							{{.locale.Tr "repo.settings.transfer_form_title"}}
+							{{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
 							<span class="text red">{{.Repository.Name}}</span>
 						</label>
 					</div>
 					<div class="required field">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" required maxlength="100">
 					</div>
 
 					<div class="text right actions">
-						<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
-						<button class="ui red button">{{.locale.Tr "repo.settings.convert_confirm"}}</button>
+						<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+						<button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_confirm"}}</button>
 					</div>
 				</form>
 			</div>
@@ -835,29 +835,29 @@
 	{{if and .Repository.IsFork .Repository.Owner.CanCreateRepo}}
 		<div class="ui small modal" id="convert-fork-repo-modal">
 			<div class="header">
-				{{.locale.Tr "repo.settings.convert_fork"}}
+				{{ctx.Locale.Tr "repo.settings.convert_fork"}}
 			</div>
 			<div class="content">
 				<div class="ui warning message">
-					{{.locale.Tr "repo.settings.convert_fork_notices_1"}}
+					{{ctx.Locale.Tr "repo.settings.convert_fork_notices_1"}}
 				</div>
 				<form class="ui form" action="{{.Link}}" method="post">
 					{{.CsrfTokenHtml}}
 					<input type="hidden" name="action" value="convert_fork">
 					<div class="field">
 						<label>
-							{{.locale.Tr "repo.settings.transfer_form_title"}}
+							{{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
 							<span class="text red">{{.Repository.Name}}</span>
 						</label>
 					</div>
 					<div class="required field">
-						<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+						<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 						<input id="repo_name" name="repo_name" required>
 					</div>
 
 					<div class="text right actions">
-						<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
-						<button class="ui red button">{{.locale.Tr "repo.settings.convert_fork_confirm"}}</button>
+						<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+						<button class="ui red button">{{ctx.Locale.Tr "repo.settings.convert_fork_confirm"}}</button>
 					</div>
 				</form>
 			</div>
@@ -865,35 +865,35 @@
 	{{end}}
 	<div class="ui small modal" id="transfer-repo-modal">
 		<div class="header">
-			{{.locale.Tr "repo.settings.transfer"}}
+			{{ctx.Locale.Tr "repo.settings.transfer"}}
 		</div>
 		<div class="content">
 			<div class="ui warning message">
-				{{.locale.Tr "repo.settings.transfer_notices_1"}} <br>
-				{{.locale.Tr "repo.settings.transfer_notices_2"}} <br>
-				{{.locale.Tr "repo.settings.transfer_notices_3"}}
+				{{ctx.Locale.Tr "repo.settings.transfer_notices_1"}} <br>
+				{{ctx.Locale.Tr "repo.settings.transfer_notices_2"}} <br>
+				{{ctx.Locale.Tr "repo.settings.transfer_notices_3"}}
 			</div>
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<input type="hidden" name="action" value="transfer">
 				<div class="field">
 					<label>
-						{{.locale.Tr "repo.settings.transfer_form_title"}}
+						{{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
 						<span class="text red">{{.Repository.Name}}</span>
 					</label>
 				</div>
 				<div class="required field">
-					<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+					<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 					<input id="repo_name" name="repo_name" required>
 				</div>
 				<div class="required field">
-					<label for="new_owner_name">{{.locale.Tr "repo.settings.transfer_owner"}}</label>
+					<label for="new_owner_name">{{ctx.Locale.Tr "repo.settings.transfer_owner"}}</label>
 					<input id="new_owner_name" name="new_owner_name" required>
 				</div>
 
 				<div class="text right actions">
-					<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
-					<button class="ui red button">{{.locale.Tr "repo.settings.transfer_perform"}}</button>
+					<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+					<button class="ui red button">{{ctx.Locale.Tr "repo.settings.transfer_perform"}}</button>
 				</div>
 			</form>
 		</div>
@@ -901,14 +901,14 @@
 
 	<div class="ui small modal" id="delete-repo-modal">
 		<div class="header">
-			{{.locale.Tr "repo.settings.delete"}}
+			{{ctx.Locale.Tr "repo.settings.delete"}}
 		</div>
 		<div class="content">
 			<div class="ui warning message">
-				{{.locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
-				{{.locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}}
+				{{ctx.Locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
+				{{ctx.Locale.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}}
 				{{if .Repository.NumForks}}<br>
-				{{.locale.Tr "repo.settings.delete_notices_fork_1"}}
+				{{ctx.Locale.Tr "repo.settings.delete_notices_fork_1"}}
 				{{end}}
 			</div>
 			<form class="ui form" action="{{.Link}}" method="post">
@@ -916,18 +916,18 @@
 				<input type="hidden" name="action" value="delete">
 				<div class="field">
 					<label>
-						{{.locale.Tr "repo.settings.transfer_form_title"}}
+						{{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
 						<span class="text red">{{.Repository.Name}}</span>
 					</label>
 				</div>
 				<div class="required field">
-					<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+					<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 					<input id="repo_name" name="repo_name" required>
 				</div>
 
 				<div class="text right actions">
-					<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
-					<button class="ui red button">{{.locale.Tr "repo.settings.confirm_delete"}}</button>
+					<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+					<button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_delete"}}</button>
 				</div>
 			</form>
 		</div>
@@ -936,30 +936,30 @@
 	{{if .Repository.UnitEnabled $.Context $.UnitTypeWiki}}
 	<div class="ui small modal" id="delete-wiki-modal">
 		<div class="header">
-			{{.locale.Tr "repo.settings.wiki_delete"}}
+			{{ctx.Locale.Tr "repo.settings.wiki_delete"}}
 		</div>
 		<div class="content">
 			<div class="ui warning message">
-				{{.locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
-				{{.locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
+				{{ctx.Locale.Tr "repo.settings.delete_notices_1" | Safe}}<br>
+				{{ctx.Locale.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
 			</div>
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<input type="hidden" name="action" value="delete-wiki">
 				<div class="field">
 					<label>
-						{{.locale.Tr "repo.settings.transfer_form_title"}}
+						{{ctx.Locale.Tr "repo.settings.transfer_form_title"}}
 						<span class="text red">{{.Repository.Name}}</span>
 					</label>
 				</div>
 				<div class="required field">
-					<label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
+					<label for="repo_name">{{ctx.Locale.Tr "repo.repo_name"}}</label>
 					<input id="repo_name" name="repo_name" required>
 				</div>
 
 				<div class="text right actions">
-					<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
-					<button class="ui red button">{{.locale.Tr "repo.settings.confirm_wiki_delete"}}</button>
+					<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
+					<button class="ui red button">{{ctx.Locale.Tr "repo.settings.confirm_wiki_delete"}}</button>
 				</div>
 			</form>
 		</div>
@@ -970,17 +970,17 @@
 		<div class="ui g-modal-confirm modal" id="archive-repo-modal">
 			<div class="header">
 				{{if .Repository.IsArchived}}
-					{{.locale.Tr "repo.settings.unarchive.header"}}
+					{{ctx.Locale.Tr "repo.settings.unarchive.header"}}
 				{{else}}
-					{{.locale.Tr "repo.settings.archive.header"}}
+					{{ctx.Locale.Tr "repo.settings.archive.header"}}
 				{{end}}
 			</div>
 			<div class="content">
 				<p>
 					{{if .Repository.IsArchived}}
-						{{.locale.Tr "repo.settings.unarchive.text"}}
+						{{ctx.Locale.Tr "repo.settings.unarchive.text"}}
 					{{else}}
-						{{.locale.Tr "repo.settings.archive.text"}}
+						{{ctx.Locale.Tr "repo.settings.archive.text"}}
 					{{end}}
 				</p>
 			</div>
diff --git a/templates/repo/settings/protected_branch.tmpl b/templates/repo/settings/protected_branch.tmpl
index 74cb84aba3..6a8c8c1e35 100644
--- a/templates/repo/settings/protected_branch.tmpl
+++ b/templates/repo/settings/protected_branch.tmpl
@@ -2,56 +2,56 @@
 	<div class="repo-setting-content">
 		<form class="ui form" action="{{.Link}}" method="post">
 			<h4 class="ui top attached header">
-				{{.locale.Tr "repo.settings.branch_protection" (.Rule.RuleName|Escape) | Str2html}}
+				{{ctx.Locale.Tr "repo.settings.branch_protection" (.Rule.RuleName|Escape) | Str2html}}
 			</h4>
 			<div class="ui attached segment branch-protection">
-				<h5 class="ui dividing header">{{.locale.Tr "repo.settings.protect_patterns"}}</h5>
+				<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_patterns"}}</h5>
 				<div class="field">
-					<label>{{.locale.Tr "repo.settings.protect_branch_name_pattern"}}</label>
+					<label>{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern"}}</label>
 					<input name="rule_name" type="text" value="{{.Rule.RuleName}}">
 					<input name="rule_id" type="hidden" value="{{.Rule.ID}}">
 				</div>
 				<div class="field">
-					<label>{{.locale.Tr "repo.settings.protect_protected_file_patterns"}}</label>
+					<label>{{ctx.Locale.Tr "repo.settings.protect_protected_file_patterns"}}</label>
 					<input name="protected_file_patterns" type="text" value="{{.Rule.ProtectedFilePatterns}}">
-					<p class="help gt-ml-0">{{.locale.Tr "repo.settings.protect_protected_file_patterns_desc" | Safe}}</p>
+					<p class="help gt-ml-0">{{ctx.Locale.Tr "repo.settings.protect_protected_file_patterns_desc" | Safe}}</p>
 				</div>
 				<div class="field">
-					<label>{{.locale.Tr "repo.settings.protect_unprotected_file_patterns"}}</label>
+					<label>{{ctx.Locale.Tr "repo.settings.protect_unprotected_file_patterns"}}</label>
 					<input name="unprotected_file_patterns" type="text" value="{{.Rule.UnprotectedFilePatterns}}">
-					<p class="help gt-ml-0">{{.locale.Tr "repo.settings.protect_unprotected_file_patterns_desc" | Safe}}</p>
+					<p class="help gt-ml-0">{{ctx.Locale.Tr "repo.settings.protect_unprotected_file_patterns_desc" | Safe}}</p>
 				</div>
 
 				{{.CsrfTokenHtml}}
-				<h5 class="ui dividing header">{{.locale.Tr "repo.settings.event_push"}}</h5>
+				<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_push"}}</h5>
 				<div class="field">
 					<div class="ui radio checkbox">
 						<input name="enable_push" type="radio" value="none" class="toggle-target-disabled" data-target="#whitelist_box" {{if not .Rule.CanPush}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.protect_disable_push"}}</label>
-						<p class="help">{{.locale.Tr "repo.settings.protect_disable_push_desc"}}</p>
+						<label>{{ctx.Locale.Tr "repo.settings.protect_disable_push"}}</label>
+						<p class="help">{{ctx.Locale.Tr "repo.settings.protect_disable_push_desc"}}</p>
 					</div>
 				</div>
 				<div class="field">
 					<div class="ui radio checkbox">
 						<input name="enable_push" type="radio" value="all" class="toggle-target-disabled" data-target="#whitelist_box" {{if and (.Rule.CanPush) (not .Rule.EnableWhitelist)}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.protect_enable_push"}}</label>
-						<p class="help">{{.locale.Tr "repo.settings.protect_enable_push_desc"}}</p>
+						<label>{{ctx.Locale.Tr "repo.settings.protect_enable_push"}}</label>
+						<p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_push_desc"}}</p>
 					</div>
 				</div>
 				<div class="grouped fields">
 					<div class="field">
 						<div class="ui radio checkbox">
 							<input name="enable_push" type="radio" value="whitelist" class="toggle-target-enabled" data-target="#whitelist_box" {{if and (.Rule.CanPush) (.Rule.EnableWhitelist)}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.protect_whitelist_committers"}}</label>
-							<p class="help">{{.locale.Tr "repo.settings.protect_whitelist_committers_desc"}}</p>
+							<label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_committers"}}</label>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.protect_whitelist_committers_desc"}}</p>
 						</div>
 					</div>
 					<div id="whitelist_box" class="grouped fields {{if not .Rule.EnableWhitelist}}disabled{{end}}">
 						<div class="checkbox-sub-item field">
-							<label>{{.locale.Tr "repo.settings.protect_whitelist_users"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_users"}}</label>
 							<div class="ui multiple search selection dropdown">
 								<input type="hidden" name="whitelist_users" value="{{.whitelist_users}}">
-								<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
 								<div class="menu">
 									{{range .Users}}
 										<div class="item" data-value="{{.ID}}">
@@ -63,10 +63,10 @@
 						</div>
 						{{if .Owner.IsOrganization}}
 							<div class="checkbox-sub-item field">
-								<label>{{.locale.Tr "repo.settings.protect_whitelist_teams"}}</label>
+								<label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_teams"}}</label>
 								<div class="ui multiple search selection dropdown">
 									<input type="hidden" name="whitelist_teams" value="{{.whitelist_teams}}">
-									<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
+									<div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
 									<div class="menu">
 										{{range .Teams}}
 											<div class="item" data-value="{{.ID}}">
@@ -81,7 +81,7 @@
 						<div class="checkbox-sub-item field">
 							<div class="ui checkbox">
 								<input type="checkbox" name="whitelist_deploy_keys" {{if .Rule.WhitelistDeployKeys}}checked{{end}}>
-								<label>{{.locale.Tr "repo.settings.protect_whitelist_deploy_keys"}}</label>
+								<label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_deploy_keys"}}</label>
 							</div>
 						</div>
 					</div>
@@ -89,30 +89,30 @@
 				<div class="field">
 					<div class="ui checkbox">
 						<input name="require_signed_commits" type="checkbox" {{if .Rule.RequireSignedCommits}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.require_signed_commits"}}</label>
-						<p class="help">{{.locale.Tr "repo.settings.require_signed_commits_desc"}}</p>
+						<label>{{ctx.Locale.Tr "repo.settings.require_signed_commits"}}</label>
+						<p class="help">{{ctx.Locale.Tr "repo.settings.require_signed_commits_desc"}}</p>
 					</div>
 				</div>
-				<h5 class="ui dividing header">{{.locale.Tr "repo.settings.event_pull_request_approvals"}}</h5>
+				<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_pull_request_approvals"}}</h5>
 				<div class="field">
-					<label>{{.locale.Tr "repo.settings.protect_required_approvals"}}</label>
+					<label>{{ctx.Locale.Tr "repo.settings.protect_required_approvals"}}</label>
 					<input name="required_approvals" type="number" value="{{.Rule.RequiredApprovals}}">
-					<p class="help gt-ml-0">{{.locale.Tr "repo.settings.protect_required_approvals_desc"}}</p>
+					<p class="help gt-ml-0">{{ctx.Locale.Tr "repo.settings.protect_required_approvals_desc"}}</p>
 				</div>
 				<div class="grouped fields">
 					<div class="field">
 						<div class="ui checkbox">
 							<input name="enable_approvals_whitelist" type="checkbox" class="toggle-target-enabled" data-target="#approvals_whitelist_box" {{if .Rule.EnableApprovalsWhitelist}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.protect_approvals_whitelist_enabled"}}</label>
-							<p class="help">{{.locale.Tr "repo.settings.protect_approvals_whitelist_enabled_desc"}}</p>
+							<label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_enabled"}}</label>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_enabled_desc"}}</p>
 						</div>
 					</div>
 					<div id="approvals_whitelist_box" class="grouped fields {{if not .Rule.EnableApprovalsWhitelist}}disabled{{end}}">
 						<div class="checkbox-sub-item field">
-							<label>{{.locale.Tr "repo.settings.protect_approvals_whitelist_users"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_users"}}</label>
 							<div class="ui multiple search selection dropdown">
 								<input type="hidden" name="approvals_whitelist_users" value="{{.approvals_whitelist_users}}">
-								<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
 								<div class="menu">
 								{{range .Users}}
 									<div class="item" data-value="{{.ID}}">
@@ -124,10 +124,10 @@
 						</div>
 						{{if .Owner.IsOrganization}}
 							<div class="checkbox-sub-item field">
-								<label>{{.locale.Tr "repo.settings.protect_approvals_whitelist_teams"}}</label>
+								<label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_teams"}}</label>
 								<div class="ui multiple search selection dropdown">
 									<input type="hidden" name="approvals_whitelist_teams" value="{{.approvals_whitelist_teams}}">
-									<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
+									<div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
 									<div class="menu">
 									{{range .Teams}}
 										<div class="item" data-value="{{.ID}}">
@@ -144,26 +144,26 @@
 				<div class="field">
 					<div class="ui checkbox">
 						<input name="dismiss_stale_approvals" type="checkbox" {{if .Rule.DismissStaleApprovals}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.dismiss_stale_approvals"}}</label>
-						<p class="help">{{.locale.Tr "repo.settings.dismiss_stale_approvals_desc"}}</p>
+						<label>{{ctx.Locale.Tr "repo.settings.dismiss_stale_approvals"}}</label>
+						<p class="help">{{ctx.Locale.Tr "repo.settings.dismiss_stale_approvals_desc"}}</p>
 					</div>
 				</div>
 				<div class="grouped fields">
 					<div class="field">
 						<div class="ui checkbox">
 							<input name="enable_status_check" type="checkbox" class="toggle-target-enabled" data-target="#statuscheck_contexts_box" {{if .Rule.EnableStatusCheck}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.protect_check_status_contexts"}}</label>
-							<p class="help">{{.locale.Tr "repo.settings.protect_check_status_contexts_desc"}}</p>
+							<label>{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts"}}</label>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_desc"}}</p>
 						</div>
 					</div>
 					<div id="statuscheck_contexts_box" class="checkbox-sub-item field {{if not .Rule.EnableStatusCheck}}disabled{{end}}">
-						<label>{{.locale.Tr "repo.settings.protect_status_check_patterns"}}</label>
+						<label>{{ctx.Locale.Tr "repo.settings.protect_status_check_patterns"}}</label>
 						<textarea id="status_check_contexts" name="status_check_contexts" rows="3">{{.status_check_contexts}}</textarea>
-						<p class="help">{{.locale.Tr "repo.settings.protect_status_check_patterns_desc"}}</p>
+						<p class="help">{{ctx.Locale.Tr "repo.settings.protect_status_check_patterns_desc"}}</p>
 						<table class="ui celled table">
 							<thead>
 								<tr>
-									<th>{{.locale.Tr "repo.settings.protect_check_status_contexts_list"}}</th>
+									<th>{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_list"}}</th>
 								</tr>
 							</thead>
 							<tbody>
@@ -171,7 +171,7 @@
 								<tr>
 									<td>
 										<span>{{.}}</span>
-										<span class="status-check-matched-mark gt-hidden" data-status-check="{{.}}">{{$.locale.Tr "repo.settings.protect_status_check_matched"}}</span>
+										<span class="status-check-matched-mark gt-hidden" data-status-check="{{.}}">{{ctx.Locale.Tr "repo.settings.protect_status_check_matched"}}</span>
 									</td>
 								</tr>
 							{{else}}
@@ -181,28 +181,28 @@
 						</table>
 					</div>
 				</div>
-				<h5 class="ui dividing header">{{.locale.Tr "repo.settings.event_pull_request_merge"}}</h5>
+				<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_pull_request_merge"}}</h5>
 				<div class="grouped fields">
 					<div class="field">
 						<div class="ui radio checkbox">
 							<input name="enable_merge_whitelist" type="radio" value="false" class="toggle-target-disabled" data-target="#merge_whitelist_box" {{if not .Rule.EnableMergeWhitelist}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.protect_enable_merge"}}</label>
-							<p class="help">{{.locale.Tr "repo.settings.protect_enable_merge_desc"}}</p>
+							<label>{{ctx.Locale.Tr "repo.settings.protect_enable_merge"}}</label>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_merge_desc"}}</p>
 						</div>
 					</div>
 					<div class="field">
 						<div class="ui radio checkbox">
 							<input name="enable_merge_whitelist" type="radio" value="true" class="toggle-target-enabled" data-target="#merge_whitelist_box" {{if .Rule.EnableMergeWhitelist}}checked{{end}}>
-							<label>{{.locale.Tr "repo.settings.protect_merge_whitelist_committers"}}</label>
-							<p class="help">{{.locale.Tr "repo.settings.protect_merge_whitelist_committers_desc"}}</p>
+							<label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_committers"}}</label>
+							<p class="help">{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_committers_desc"}}</p>
 						</div>
 					</div>
 					<div id="merge_whitelist_box" class="grouped fields {{if not .Rule.EnableMergeWhitelist}}disabled{{end}}">
 						<div class="checkbox-sub-item field">
-							<label>{{.locale.Tr "repo.settings.protect_merge_whitelist_users"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_users"}}</label>
 							<div class="ui multiple search selection dropdown">
 								<input type="hidden" name="merge_whitelist_users" value="{{.merge_whitelist_users}}">
-								<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
 								<div class="menu">
 								{{range .Users}}
 									<div class="item" data-value="{{.ID}}">
@@ -214,10 +214,10 @@
 						</div>
 					{{if .Owner.IsOrganization}}
 						<div class="checkbox-sub-item field">
-							<label>{{.locale.Tr "repo.settings.protect_merge_whitelist_teams"}}</label>
+							<label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_teams"}}</label>
 							<div class="ui multiple search selection dropdown">
 								<input type="hidden" name="merge_whitelist_teams" value="{{.merge_whitelist_teams}}">
-								<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
+								<div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
 								<div class="menu">
 								{{range .Teams}}
 									<div class="item" data-value="{{.ID}}">
@@ -234,28 +234,28 @@
 				<div class="field">
 					<div class="ui checkbox">
 						<input name="block_on_rejected_reviews" type="checkbox" {{if .Rule.BlockOnRejectedReviews}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.block_rejected_reviews"}}</label>
-						<p class="help">{{.locale.Tr "repo.settings.block_rejected_reviews_desc"}}</p>
+						<label>{{ctx.Locale.Tr "repo.settings.block_rejected_reviews"}}</label>
+						<p class="help">{{ctx.Locale.Tr "repo.settings.block_rejected_reviews_desc"}}</p>
 					</div>
 				</div>
 				<div class="field">
 					<div class="ui checkbox">
 						<input name="block_on_official_review_requests" type="checkbox" {{if .Rule.BlockOnOfficialReviewRequests}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.block_on_official_review_requests"}}</label>
-						<p class="help">{{.locale.Tr "repo.settings.block_on_official_review_requests_desc"}}</p>
+						<label>{{ctx.Locale.Tr "repo.settings.block_on_official_review_requests"}}</label>
+						<p class="help">{{ctx.Locale.Tr "repo.settings.block_on_official_review_requests_desc"}}</p>
 					</div>
 				</div>
 				<div class="field">
 					<div class="ui checkbox">
 						<input name="block_on_outdated_branch" type="checkbox" {{if .Rule.BlockOnOutdatedBranch}}checked{{end}}>
-						<label>{{.locale.Tr "repo.settings.block_outdated_branch"}}</label>
-						<p class="help">{{.locale.Tr "repo.settings.block_outdated_branch_desc"}}</p>
+						<label>{{ctx.Locale.Tr "repo.settings.block_outdated_branch"}}</label>
+						<p class="help">{{ctx.Locale.Tr "repo.settings.block_outdated_branch_desc"}}</p>
 					</div>
 				</div>
 				<div class="divider"></div>
 
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "repo.settings.protected_branch.save_rule"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.protected_branch.save_rule"}}</button>
 				</div>
 			</div>
 		</form>
diff --git a/templates/repo/settings/push_mirror_sync_modal.tmpl b/templates/repo/settings/push_mirror_sync_modal.tmpl
index a04574add5..e8dad61a48 100644
--- a/templates/repo/settings/push_mirror_sync_modal.tmpl
+++ b/templates/repo/settings/push_mirror_sync_modal.tmpl
@@ -1,6 +1,6 @@
 <div class="ui small modal" id="push-mirror-edit-modal">
 	<div class="header">
-		{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}
+		{{ctx.Locale.Tr "repo.settings.mirror_settings.push_mirror.edit_sync_time"}}
 	</div>
 	<div class="content">
 		<form class="ui form ignore-dirty" method="post">
@@ -8,23 +8,23 @@
 			<input type="hidden" name="action" value="push-mirror-update">
 			<input type="hidden" name="push_mirror_id" id="push-mirror-edit-id">
 			<div class="field">
-				<label for="name">{{$.locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</label>
+				<label for="name">{{ctx.Locale.Tr "repo.settings.mirror_settings.mirrored_repository"}}</label>
 				<div class="ui small input">
 					<input id="push-mirror-edit-address" readonly>
 				</div>
 			</div>
 			<div class="inline field">
-				<label for="push-mirror-edit-interval">{{.locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
+				<label for="push-mirror-edit-interval">{{ctx.Locale.Tr "repo.mirror_interval" .MinimumMirrorInterval}}</label>
 				<input id="push-mirror-edit-interval" name="push_mirror_interval" autofocus>
 			</div>
 			<div class="actions">
 				<button class="ui small basic cancel button">
 					{{svg "octicon-x"}}
-					{{.locale.Tr "cancel"}}
+					{{ctx.Locale.Tr "cancel"}}
 				</button>
 				<button class="ui primary small approve button">
 					{{svg "fontawesome-save"}}
-					{{.locale.Tr "save"}}
+					{{ctx.Locale.Tr "save"}}
 				</button>
 			</div>
 		</form>
diff --git a/templates/repo/settings/tags.tmpl b/templates/repo/settings/tags.tmpl
index 48b67697c8..ed7762acc5 100644
--- a/templates/repo/settings/tags.tmpl
+++ b/templates/repo/settings/tags.tmpl
@@ -2,11 +2,11 @@
 	<div class="repo-setting-content">
 		{{if .Repository.IsArchived}}
 			<div class="ui warning message gt-text-center">
-				{{.locale.Tr "repo.settings.archive.tagsettings_unavailable"}}
+				{{ctx.Locale.Tr "repo.settings.archive.tagsettings_unavailable"}}
 			</div>
 		{{else}}
 			<h4 class="ui top attached header">
-				{{.locale.Tr "repo.settings.tags.protection"}}
+				{{ctx.Locale.Tr "repo.settings.tags.protection"}}
 			</h4>
 
 			<div class="ui attached segment">
@@ -16,19 +16,19 @@
 							<form class="ui form" action="{{.Link}}" method="post">
 								{{.CsrfTokenHtml}}
 								<div class="field">
-									<label>{{.locale.Tr "repo.settings.tags.protection.pattern"}}</label>
+									<label>{{ctx.Locale.Tr "repo.settings.tags.protection.pattern"}}</label>
 									<div id="search-tag-box" class="ui search">
 										<div class="ui input">
 											<input class="prompt" name="name_pattern" autocomplete="off" value="{{.name_pattern}}" placeholder="v*" autofocus required>
 										</div>
-										<div class="help">{{.locale.Tr "repo.settings.tags.protection.pattern.description" | Safe}}</div>
+										<div class="help">{{ctx.Locale.Tr "repo.settings.tags.protection.pattern.description" | Safe}}</div>
 									</div>
 								</div>
 								<div class="whitelist field">
-									<label>{{.locale.Tr "repo.settings.tags.protection.allowed.users"}}</label>
+									<label>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.users"}}</label>
 									<div class="ui multiple search selection dropdown">
 										<input type="hidden" name="allowlist_users" value="{{.allowlist_users}}">
-										<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
+										<div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
 										<div class="menu">
 											{{range .Users}}
 												<div class="item" data-value="{{.ID}}">
@@ -40,10 +40,10 @@
 								</div>
 								{{if .Owner.IsOrganization}}
 									<div class="whitelist field">
-										<label>{{.locale.Tr "repo.settings.tags.protection.allowed.teams"}}</label>
+										<label>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.teams"}}</label>
 										<div class="ui multiple search selection dropdown">
 											<input type="hidden" name="allowlist_teams" value="{{.allowlist_teams}}">
-											<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
+											<div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
 											<div class="menu">
 												{{range .Teams}}
 													<div class="item" data-value="{{.ID}}">
@@ -58,14 +58,14 @@
 								<div class="field">
 									{{if .PageIsEditProtectedTag}}
 									<button class="ui primary button">
-										{{$.locale.Tr "save"}}
+										{{ctx.Locale.Tr "save"}}
 									</button>
 									<a class="ui primary button" href="{{$.RepoLink}}/settings/tags">
-										{{$.locale.Tr "cancel"}}
+										{{ctx.Locale.Tr "cancel"}}
 									</a>
 									{{else}}
 									<button class="ui primary button">
-										{{$.locale.Tr "repo.settings.tags.protection.create"}}
+										{{ctx.Locale.Tr "repo.settings.tags.protection.create"}}
 									</button>
 									{{end}}
 								</div>
@@ -76,8 +76,8 @@
 					<div class="sixteen wide column">
 						<table class="ui single line table">
 							<thead>
-								<th>{{.locale.Tr "repo.settings.tags.protection.pattern"}}</th>
-								<th>{{.locale.Tr "repo.settings.tags.protection.allowed"}}</th>
+								<th>{{ctx.Locale.Tr "repo.settings.tags.protection.pattern"}}</th>
+								<th>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed"}}</th>
 								<th></th>
 							</thead>
 							<tbody>
@@ -101,20 +101,20 @@
 													{{end}}
 												{{end}}
 											{{else}}
-												{{$.locale.Tr "repo.settings.tags.protection.allowed.noone"}}
+												{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.noone"}}
 											{{end}}
 										</td>
 										<td class="right aligned">
-											<a class="ui tiny primary button" href="{{$.RepoLink}}/settings/tags/{{.ID}}">{{$.locale.Tr "edit"}}</a>
+											<a class="ui tiny primary button" href="{{$.RepoLink}}/settings/tags/{{.ID}}">{{ctx.Locale.Tr "edit"}}</a>
 											<form class="gt-dib" action="{{$.RepoLink}}/settings/tags/delete" method="post">
 												{{$.CsrfTokenHtml}}
 												<input type="hidden" name="id" value="{{.ID}}">
-												<button class="ui tiny red button">{{$.locale.Tr "remove"}}</button>
+												<button class="ui tiny red button">{{ctx.Locale.Tr "remove"}}</button>
 											</form>
 										</td>
 									</tr>
 								{{else}}
-									<tr class="center aligned"><td colspan="3">{{.locale.Tr "repo.settings.tags.protection.none"}}</td></tr>
+									<tr class="center aligned"><td colspan="3">{{ctx.Locale.Tr "repo.settings.tags.protection.none"}}</td></tr>
 								{{end}}
 							</tbody>
 						</table>
diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl
index b0e8ace410..ed6e670d60 100644
--- a/templates/repo/settings/webhook/base_list.tmpl
+++ b/templates/repo/settings/webhook/base_list.tmpl
@@ -2,51 +2,51 @@
 	{{.Title}}
 	<div class="ui right">
 		<div class="ui jump dropdown">
-			<div class="ui primary tiny button">{{.locale.Tr "repo.settings.add_webhook"}}</div>
+			<div class="ui primary tiny button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</div>
 			<div class="menu">
 				<a class="item" href="{{.BaseLinkNew}}/gitea/new">
 					{{template "shared/webhook/icon" (dict "HookType" "gitea" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_gitea"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_gitea"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/gogs/new">
 					{{template "shared/webhook/icon" (dict "HookType" "gogs" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_gogs"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_gogs"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/slack/new">
 					{{template "shared/webhook/icon" (dict "HookType" "slack" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_slack"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_slack"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/discord/new">
 					{{template "shared/webhook/icon" (dict "HookType" "discord" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_discord"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_discord"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/dingtalk/new">
 					{{template "shared/webhook/icon" (dict "HookType" "dingtalk" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_dingtalk"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_dingtalk"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/telegram/new">
 					{{template "shared/webhook/icon" (dict "HookType" "telegram" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_telegram"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_telegram"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/msteams/new">
 					{{template "shared/webhook/icon" (dict "HookType" "msteams" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_msteams"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_msteams"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/feishu/new">
 					{{template "shared/webhook/icon" (dict "HookType" "feishu" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/matrix/new">
 					{{template "shared/webhook/icon" (dict "HookType" "matrix" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_matrix"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_matrix"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/wechatwork/new">
 					{{template "shared/webhook/icon" (dict "HookType" "wechatwork" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_wechatwork"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_wechatwork"}}
 				</a>
 				<a class="item" href="{{.BaseLinkNew}}/packagist/new">
 					{{template "shared/webhook/icon" (dict "HookType" "packagist" "Size" 20)}}
-					{{.locale.Tr "repo.settings.web_hook_name_packagist"}}
+					{{ctx.Locale.Tr "repo.settings.web_hook_name_packagist"}}
 				</a>
 			</div>
 		</div>
diff --git a/templates/repo/settings/webhook/delete_modal.tmpl b/templates/repo/settings/webhook/delete_modal.tmpl
index b78e69e6f4..9955ed3a2f 100644
--- a/templates/repo/settings/webhook/delete_modal.tmpl
+++ b/templates/repo/settings/webhook/delete_modal.tmpl
@@ -1,10 +1,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.settings.webhook_deletion"}}
+		{{ctx.Locale.Tr "repo.settings.webhook_deletion"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.settings.webhook_deletion_desc"}}</p>
+		<p>{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/repo/settings/webhook/dingtalk.tmpl b/templates/repo/settings/webhook/dingtalk.tmpl
index 25d5adf9b9..32ca0d0807 100644
--- a/templates/repo/settings/webhook/dingtalk.tmpl
+++ b/templates/repo/settings/webhook/dingtalk.tmpl
@@ -1,9 +1,9 @@
 {{if eq .HookType "dingtalk"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://dingtalk.com" (.locale.Tr "repo.settings.web_hook_name_dingtalk") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://dingtalk.com" (ctx.Locale.Tr "repo.settings.web_hook_name_dingtalk") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/dingtalk/{{or .Webhook.ID "new"}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_PayloadURL}}error{{end}}">
-			<label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+			<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
 			<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/discord.tmpl b/templates/repo/settings/webhook/discord.tmpl
index 3d943c8219..25dc219ee1 100644
--- a/templates/repo/settings/webhook/discord.tmpl
+++ b/templates/repo/settings/webhook/discord.tmpl
@@ -1,17 +1,17 @@
 {{if eq .HookType "discord"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://discord.com" (.locale.Tr "repo.settings.web_hook_name_discord") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://discord.com" (ctx.Locale.Tr "repo.settings.web_hook_name_discord") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/discord/{{or .Webhook.ID "new"}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_PayloadURL}}error{{end}}">
-			<label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+			<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
 			<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
 		</div>
 		<div class="field">
-			<label for="username">{{.locale.Tr "repo.settings.discord_username"}}</label>
+			<label for="username">{{ctx.Locale.Tr "repo.settings.discord_username"}}</label>
 			<input id="username" name="username" value="{{.DiscordHook.Username}}" placeholder="Gitea">
 		</div>
 		<div class="field">
-			<label for="icon_url">{{.locale.Tr "repo.settings.discord_icon_url"}}</label>
+			<label for="icon_url">{{ctx.Locale.Tr "repo.settings.discord_icon_url"}}</label>
 			<input id="icon_url" name="icon_url" value="{{.DiscordHook.IconURL}}" placeholder="https://example.com/assets/img/logo.svg">
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/feishu.tmpl b/templates/repo/settings/webhook/feishu.tmpl
index 7de4430204..9683427fbf 100644
--- a/templates/repo/settings/webhook/feishu.tmpl
+++ b/templates/repo/settings/webhook/feishu.tmpl
@@ -1,10 +1,10 @@
 {{if eq .HookType "feishu"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (.locale.Tr "repo.settings.web_hook_name_feishu") | Str2html}}</p>
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (.locale.Tr "repo.settings.web_hook_name_larksuite") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (ctx.Locale.Tr "repo.settings.web_hook_name_feishu") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (ctx.Locale.Tr "repo.settings.web_hook_name_larksuite") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/feishu/{{or .Webhook.ID "new"}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_PayloadURL}}error{{end}}">
-			<label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+			<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
 			<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/gitea.tmpl b/templates/repo/settings/webhook/gitea.tmpl
index 1850c663b1..4fda6a7b39 100644
--- a/templates/repo/settings/webhook/gitea.tmpl
+++ b/templates/repo/settings/webhook/gitea.tmpl
@@ -1,14 +1,14 @@
 {{if eq .HookType "gitea"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (ctx.Locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/gitea/{{or .Webhook.ID "new"}}" method="post">
 		{{template "base/disable_form_autofill"}}
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_PayloadURL}}error{{end}}">
-			<label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+			<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
 			<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
 		</div>
 		<div class="field">
-			<label>{{.locale.Tr "repo.settings.http_method"}}</label>
+			<label>{{ctx.Locale.Tr "repo.settings.http_method"}}</label>
 			<div class="ui selection dropdown">
 				<input type="hidden" id="http_method" name="http_method" value="{{if .Webhook.HTTPMethod}}{{.Webhook.HTTPMethod}}{{else}}POST{{end}}">
 				<div class="default text"></div>
@@ -20,7 +20,7 @@
 			</div>
 		</div>
 		<div class="field">
-			<label>{{.locale.Tr "repo.settings.content_type"}}</label>
+			<label>{{ctx.Locale.Tr "repo.settings.content_type"}}</label>
 			<div class="ui selection dropdown">
 				<input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}1{{end}}">
 				<div class="default text"></div>
@@ -32,7 +32,7 @@
 			</div>
 		</div>
 		<div class="field {{if .Err_Secret}}error{{end}}">
-			<label for="secret">{{.locale.Tr "repo.settings.secret"}}</label>
+			<label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label>
 			<input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off">
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/gogs.tmpl b/templates/repo/settings/webhook/gogs.tmpl
index 176c24eb93..d2bd98c32c 100644
--- a/templates/repo/settings/webhook/gogs.tmpl
+++ b/templates/repo/settings/webhook/gogs.tmpl
@@ -1,14 +1,14 @@
 {{if eq .HookType "gogs"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (ctx.Locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/gogs/{{or .Webhook.ID "new"}}" method="post">
 		{{template "base/disable_form_autofill"}}
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_PayloadURL}}error{{end}}">
-			<label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+			<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
 			<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
 		</div>
 		<div class="field">
-			<label>{{.locale.Tr "repo.settings.content_type"}}</label>
+			<label>{{ctx.Locale.Tr "repo.settings.content_type"}}</label>
 			<div class="ui selection dropdown">
 				<input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}1{{end}}">
 				<div class="default text"></div>
@@ -20,7 +20,7 @@
 			</div>
 		</div>
 		<div class="field {{if .Err_Secret}}error{{end}}">
-			<label for="secret">{{.locale.Tr "repo.settings.secret"}}</label>
+			<label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label>
 			<input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off">
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/history.tmpl b/templates/repo/settings/webhook/history.tmpl
index 69e50989e6..3c21a42421 100644
--- a/templates/repo/settings/webhook/history.tmpl
+++ b/templates/repo/settings/webhook/history.tmpl
@@ -1,12 +1,12 @@
 {{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}}
 {{if .PageIsSettingsHooksEdit}}
 	<h4 class="ui top attached header">
-		{{.locale.Tr "repo.settings.recent_deliveries"}}
+		{{ctx.Locale.Tr "repo.settings.recent_deliveries"}}
 		{{if .Permission.IsAdmin}}
 			<div class="ui right">
 				<!-- the button is wrapped with a span because the tooltip doesn't show on hover if we put data-tooltip-content directly on the button -->
-				<span data-tooltip-content="{{if or $isNew .Webhook.IsActive}}{{.locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{.locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}">
-					<button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.locale.Tr "repo.settings.webhook.test_delivery"}}</button>
+				<span data-tooltip-content="{{if or $isNew .Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}">
+					<button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}</button>
 			</span>
 			</div>
 		{{end}}
@@ -25,14 +25,14 @@
 							<a class="ui primary sha label toggle button show-panel" data-panel="#info-{{.ID}}">{{.UUID}}</a>
 						</div>
 						<span class="text grey">
-							{{TimeSince .Delivered.AsTime $.locale}}
+							{{TimeSince .Delivered.AsTime ctx.Locale}}
 						</span>
 					</div>
 					<div class="info gt-hidden" id="info-{{.ID}}">
 						<div class="ui top attached tabular menu">
-							<a class="item active" data-tab="request-{{.ID}}">{{$.locale.Tr "repo.settings.webhook.request"}}</a>
+							<a class="item active" data-tab="request-{{.ID}}">{{ctx.Locale.Tr "repo.settings.webhook.request"}}</a>
 							<a class="item" data-tab="response-{{.ID}}">
-								{{$.locale.Tr "repo.settings.webhook.response"}}
+								{{ctx.Locale.Tr "repo.settings.webhook.response"}}
 								{{if .ResponseInfo}}
 									{{if .IsSucceed}}
 										<span class="ui green label">{{.ResponseInfo.Status}}</span>
@@ -47,7 +47,7 @@
 							<div class="right menu">
 								<form class="item" action="{{$.Link}}/replay/{{.UUID}}" method="post">
 									{{$.CsrfTokenHtml}}
-									<span data-tooltip-content="{{if $.Webhook.IsActive}}{{$.locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{$.locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}">
+									<span data-tooltip-content="{{if $.Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}">
 										<button class="ui tiny button{{if not $.Webhook.IsActive}} disabled{{end}}">{{svg "octicon-sync"}}</button>
 									</span>
 								</form>
@@ -56,12 +56,12 @@
 						</div>
 						<div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}">
 							{{if .RequestInfo}}
-								<h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5>
+								<h5>{{ctx.Locale.Tr "repo.settings.webhook.headers"}}</h5>
 								<pre class="webhook-info"><strong>Request URL:</strong> {{.RequestInfo.URL}}
 <strong>Request method:</strong> {{if .RequestInfo.HTTPMethod}}{{.RequestInfo.HTTPMethod}}{{else}}POST{{end}}
 {{range $key, $val := .RequestInfo.Headers}}<strong>{{$key}}:</strong> {{$val}}
 {{end}}</pre>
-								<h5>{{$.locale.Tr "repo.settings.webhook.payload"}}</h5>
+								<h5>{{ctx.Locale.Tr "repo.settings.webhook.payload"}}</h5>
 								<pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre>
 							{{else}}
 								-
@@ -69,10 +69,10 @@
 						</div>
 						<div class="ui bottom attached tab segment" data-tab="response-{{.ID}}">
 							{{if .ResponseInfo}}
-								<h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5>
+								<h5>{{ctx.Locale.Tr "repo.settings.webhook.headers"}}</h5>
 								<pre class="webhook-info">{{range $key, $val := .ResponseInfo.Headers}}<strong>{{$key}}:</strong> {{$val}}
 {{end}}</pre>
-								<h5>{{$.locale.Tr "repo.settings.webhook.body"}}</h5>
+								<h5>{{ctx.Locale.Tr "repo.settings.webhook.body"}}</h5>
 								<pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre>
 							{{else}}
 								-
diff --git a/templates/repo/settings/webhook/matrix.tmpl b/templates/repo/settings/webhook/matrix.tmpl
index d3ab5588bf..a2a9921d7b 100644
--- a/templates/repo/settings/webhook/matrix.tmpl
+++ b/templates/repo/settings/webhook/matrix.tmpl
@@ -1,17 +1,17 @@
 {{if eq .HookType "matrix"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://matrix.org/" (.locale.Tr "repo.settings.web_hook_name_matrix") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://matrix.org/" (ctx.Locale.Tr "repo.settings.web_hook_name_matrix") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/matrix/{{or .Webhook.ID "new"}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_HomeserverURL}}error{{end}}">
-			<label for="homeserver_url">{{.locale.Tr "repo.settings.matrix.homeserver_url"}}</label>
+			<label for="homeserver_url">{{ctx.Locale.Tr "repo.settings.matrix.homeserver_url"}}</label>
 			<input id="homeserver_url" name="homeserver_url" type="url" value="{{.MatrixHook.HomeserverURL}}" autofocus required>
 		</div>
 		<div class="required field {{if .Err_Room}}error{{end}}">
-			<label for="room_id">{{.locale.Tr "repo.settings.matrix.room_id"}}</label>
+			<label for="room_id">{{ctx.Locale.Tr "repo.settings.matrix.room_id"}}</label>
 			<input id="room_id" name="room_id" type="text" value="{{.MatrixHook.Room}}" required>
 		</div>
 		<div class="field">
-			<label>{{.locale.Tr "repo.settings.matrix.message_type"}}</label>
+			<label>{{ctx.Locale.Tr "repo.settings.matrix.message_type"}}</label>
 				<div class="ui selection dropdown">
 				<input type="hidden" id="message_type" name="message_type" value="{{if .MatrixHook.MessageType}}{{.MatrixHook.MessageType}}{{else}}1{{end}}">
 				<div class="default text"></div>
diff --git a/templates/repo/settings/webhook/msteams.tmpl b/templates/repo/settings/webhook/msteams.tmpl
index fecb4d97be..0097209db1 100644
--- a/templates/repo/settings/webhook/msteams.tmpl
+++ b/templates/repo/settings/webhook/msteams.tmpl
@@ -1,9 +1,9 @@
 {{if eq .HookType "msteams"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://teams.microsoft.com" (.locale.Tr "repo.settings.web_hook_name_msteams") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://teams.microsoft.com" (ctx.Locale.Tr "repo.settings.web_hook_name_msteams") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/msteams/{{or .Webhook.ID "new"}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_PayloadURL}}error{{end}}">
-			<label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+			<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
 			<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl
index 67a5f7296f..b04a44213a 100644
--- a/templates/repo/settings/webhook/new.tmpl
+++ b/templates/repo/settings/webhook/new.tmpl
@@ -1,7 +1,7 @@
 {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings new webhook")}}
 	<div class="repo-setting-content">
-		{{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}}
-		{{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}{{end}}
+		{{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}}
+		{{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}{{end}}
 		{{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
 	</div>
 {{template "repo/settings/layout_footer" .}}
diff --git a/templates/repo/settings/webhook/packagist.tmpl b/templates/repo/settings/webhook/packagist.tmpl
index b8033c1043..fc373951d1 100644
--- a/templates/repo/settings/webhook/packagist.tmpl
+++ b/templates/repo/settings/webhook/packagist.tmpl
@@ -1,17 +1,17 @@
 {{if eq .HookType "packagist"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://packagist.org" (.locale.Tr "repo.settings.web_hook_name_packagist") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://packagist.org" (ctx.Locale.Tr "repo.settings.web_hook_name_packagist") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/packagist/{{or .Webhook.ID "new"}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_Username}}error{{end}}">
-			<label for="username">{{.locale.Tr "repo.settings.packagist_username"}}</label>
+			<label for="username">{{ctx.Locale.Tr "repo.settings.packagist_username"}}</label>
 			<input id="username" name="username" value="{{.PackagistHook.Username}}" placeholder="Gitea" autofocus required>
 		</div>
 		<div class="required field {{if .Err_APIToken}}error{{end}}">
-			<label for="api_token">{{.locale.Tr "repo.settings.packagist_api_token"}}</label>
+			<label for="api_token">{{ctx.Locale.Tr "repo.settings.packagist_api_token"}}</label>
 			<input id="api_token" name="api_token" value="{{.PackagistHook.APIToken}}" placeholder="X5F_tZ-Wj3c1vqaU2Rky" required>
 		</div>
 		<div class="required field {{if .Err_PackageURL}}error{{end}}">
-			<label for="package_url">{{.locale.Tr "repo.settings.packagist_package_url"}}</label>
+			<label for="package_url">{{ctx.Locale.Tr "repo.settings.packagist_package_url"}}</label>
 			<input id="package_url" name="package_url" value="{{.PackagistHook.PackageURL}}" placeholder="https://packagist.org/packages/laravel/framework" required>
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/settings.tmpl b/templates/repo/settings/webhook/settings.tmpl
index a669d2c9a3..addf99d45a 100644
--- a/templates/repo/settings/webhook/settings.tmpl
+++ b/templates/repo/settings/webhook/settings.tmpl
@@ -1,23 +1,23 @@
 {{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}}
 <div class="field">
-	<h4>{{.locale.Tr "repo.settings.event_desc"}}</h4>
+	<h4>{{ctx.Locale.Tr "repo.settings.event_desc"}}</h4>
 	<div class="grouped event type fields">
 		<div class="field">
 			<div class="ui radio non-events checkbox">
 				<input name="events" type="radio" value="push_only" {{if or $isNew .Webhook.PushOnly}}checked{{end}}>
-				<label>{{.locale.Tr "repo.settings.event_push_only" | Str2html}}</label>
+				<label>{{ctx.Locale.Tr "repo.settings.event_push_only" | Str2html}}</label>
 			</div>
 		</div>
 		<div class="field">
 			<div class="ui radio non-events checkbox">
 				<input name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}>
-				<label>{{.locale.Tr "repo.settings.event_send_everything" | Str2html}}</label>
+				<label>{{ctx.Locale.Tr "repo.settings.event_send_everything" | Str2html}}</label>
 			</div>
 		</div>
 		<div class="field">
 			<div class="ui radio events checkbox">
 				<input name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}>
-				<label>{{.locale.Tr "repo.settings.event_choose" | Str2html}}</label>
+				<label>{{ctx.Locale.Tr "repo.settings.event_choose" | Str2html}}</label>
 			</div>
 		</div>
 	</div>
@@ -25,15 +25,15 @@
 	<div class="events fields ui grid {{if not .Webhook.ChooseEvents}}gt-hidden{{end}}">
 		<!-- Repository Events -->
 		<div class="fourteen wide column">
-			<label>{{.locale.Tr "repo.settings.event_header_repository"}}</label>
+			<label>{{ctx.Locale.Tr "repo.settings.event_header_repository"}}</label>
 		</div>
 		<!-- Create -->
 		<div class="seven wide column">
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="create" type="checkbox" {{if .Webhook.Create}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_create"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_create_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_create"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_create_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -42,8 +42,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="delete" type="checkbox" {{if .Webhook.Delete}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_delete"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_delete_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_delete"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_delete_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -52,8 +52,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="fork" type="checkbox" {{if .Webhook.Fork}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_fork"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_fork_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_fork"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_fork_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -62,8 +62,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="push" type="checkbox" {{if .Webhook.Push}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_push"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_push_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_push"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_push_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -72,8 +72,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="repository" type="checkbox" {{if .Webhook.Repository}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_repository"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_repository_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_repository"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_repository_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -82,8 +82,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="release" type="checkbox" {{if .Webhook.Release}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_release"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_release_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_release"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_release_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -92,8 +92,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="package" type="checkbox" {{if .Webhook.Package}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_package"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_package_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_package"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_package_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -103,23 +103,23 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="wiki" type="checkbox" {{if .Webhook.Wiki}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_wiki"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_wiki_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_wiki"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_wiki_desc"}}</span>
 				</div>
 			</div>
 		</div>
 
 		<!-- Issue Events -->
 		<div class="fourteen wide column">
-			<label>{{.locale.Tr "repo.settings.event_header_issue"}}</label>
+			<label>{{ctx.Locale.Tr "repo.settings.event_header_issue"}}</label>
 		</div>
 		<!-- Issues -->
 		<div class="seven wide column">
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="issues" type="checkbox" {{if .Webhook.Issues}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_issues"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_issues_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_issues"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_issues_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -128,8 +128,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="issue_assign" type="checkbox" {{if .Webhook.IssueAssign}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_issue_assign"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_issue_assign_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_issue_assign"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_assign_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -138,8 +138,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="issue_label" type="checkbox" {{if .Webhook.IssueLabel}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_issue_label"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_issue_label_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_issue_label"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_label_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -148,8 +148,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="issue_milestone" type="checkbox" {{if .Webhook.IssueMilestone}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_issue_milestone"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_issue_milestone_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_issue_milestone"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_milestone_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -158,23 +158,23 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="issue_comment" type="checkbox" {{if .Webhook.IssueComment}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_issue_comment"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_issue_comment_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_issue_comment"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_comment_desc"}}</span>
 				</div>
 			</div>
 		</div>
 
 		<!-- Pull Request Events -->
 		<div class="fourteen wide column">
-			<label>{{.locale.Tr "repo.settings.event_header_pull_request"}}</label>
+			<label>{{ctx.Locale.Tr "repo.settings.event_header_pull_request"}}</label>
 		</div>
 		<!-- Pull Request -->
 		<div class="seven wide column">
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="pull_request" type="checkbox" {{if .Webhook.PullRequest}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_pull_request"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_pull_request_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_pull_request"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -183,8 +183,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="pull_request_assign" type="checkbox" {{if .Webhook.PullRequestAssign}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_pull_request_assign"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_assign"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -193,8 +193,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="pull_request_label" type="checkbox" {{if .Webhook.PullRequestLabel}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_pull_request_label"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_pull_request_label_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_label"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_label_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -203,8 +203,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="pull_request_milestone" type="checkbox" {{if .Webhook.PullRequestMilestone}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_pull_request_milestone"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -213,8 +213,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="pull_request_comment" type="checkbox" {{if .Webhook.PullRequestComment}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_pull_request_comment"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_comment"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -223,8 +223,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="pull_request_review" type="checkbox" {{if .Webhook.PullRequestReview}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_pull_request_review"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_pull_request_review_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -233,8 +233,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="pull_request_sync" type="checkbox" {{if .Webhook.PullRequestSync}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_pull_request_sync"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_sync"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -243,8 +243,8 @@
 			<div class="field">
 				<div class="ui checkbox">
 					<input name="pull_request_review_request" type="checkbox" {{if .Webhook.PullRequestReviewRequest}}checked{{end}}>
-					<label>{{.locale.Tr "repo.settings.event_pull_request_review_request"}}</label>
-					<span class="help">{{.locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span>
+					<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request"}}</label>
+					<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span>
 				</div>
 			</div>
 		</div>
@@ -253,17 +253,17 @@
 
 <!-- Branch filter -->
 <div class="field">
-	<label for="branch_filter">{{.locale.Tr "repo.settings.branch_filter"}}</label>
+	<label for="branch_filter">{{ctx.Locale.Tr "repo.settings.branch_filter"}}</label>
 	<input name="branch_filter" type="text" value="{{or .Webhook.BranchFilter "*"}}">
-	<span class="help">{{.locale.Tr "repo.settings.branch_filter_desc" | Str2html}}</span>
+	<span class="help">{{ctx.Locale.Tr "repo.settings.branch_filter_desc" | Str2html}}</span>
 </div>
 
 <!-- Authorization Header -->
 <div class="field{{if eq .HookType "matrix"}} required{{end}}">
-	<label for="authorization_header">{{.locale.Tr "repo.settings.authorization_header"}}</label>
+	<label for="authorization_header">{{ctx.Locale.Tr "repo.settings.authorization_header"}}</label>
 	<input id="authorization_header" name="authorization_header" type="text" value="{{.Webhook.HeaderAuthorization}}"{{if eq .HookType "matrix"}} placeholder="Bearer $access_token" required{{end}}>
 	{{if ne .HookType "matrix"}}{{/* Matrix doesn't make the authorization optional but it is implied by the help string, should be changed.*/}}
-		<span class="help">{{.locale.Tr "repo.settings.authorization_header_desc" "<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | Str2html}}</span>
+		<span class="help">{{ctx.Locale.Tr "repo.settings.authorization_header_desc" "<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | Str2html}}</span>
 	{{end}}
 </div>
 
@@ -272,16 +272,16 @@
 <div class="inline field">
 	<div class="ui checkbox">
 		<input name="active" type="checkbox" {{if or $isNew .Webhook.IsActive}}checked{{end}}>
-		<label>{{.locale.Tr "repo.settings.active"}}</label>
-		<span class="help">{{.locale.Tr "repo.settings.active_helper"}}</span>
+		<label>{{ctx.Locale.Tr "repo.settings.active"}}</label>
+		<span class="help">{{ctx.Locale.Tr "repo.settings.active_helper"}}</span>
 	</div>
 </div>
 <div class="field">
 	{{if $isNew}}
-		<button class="ui primary button">{{.locale.Tr "repo.settings.add_webhook"}}</button>
+		<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</button>
 	{{else}}
-		<button class="ui primary button">{{.locale.Tr "repo.settings.update_webhook"}}</button>
-		<a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{.locale.Tr "repo.settings.delete_webhook"}}</a>
+		<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_webhook"}}</button>
+		<a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</a>
 	{{end}}
 </div>
 
diff --git a/templates/repo/settings/webhook/slack.tmpl b/templates/repo/settings/webhook/slack.tmpl
index 335966a6d1..b367aed5ec 100644
--- a/templates/repo/settings/webhook/slack.tmpl
+++ b/templates/repo/settings/webhook/slack.tmpl
@@ -1,26 +1,26 @@
 {{if eq .HookType "slack"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://slack.com" (.locale.Tr "repo.settings.web_hook_name_slack") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://slack.com" (ctx.Locale.Tr "repo.settings.web_hook_name_slack") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/slack/{{or .Webhook.ID "new"}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_PayloadURL}}error{{end}}">
-			<label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+			<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
 			<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
 		</div>
 		<div class="required field {{if .Err_Channel}}error{{end}}">
-			<label for="channel">{{.locale.Tr "repo.settings.slack_channel"}}</label>
+			<label for="channel">{{ctx.Locale.Tr "repo.settings.slack_channel"}}</label>
 			<input id="channel" name="channel" value="{{.SlackHook.Channel}}" placeholder="#general" required>
 		</div>
 
 		<div class="field">
-			<label for="username">{{.locale.Tr "repo.settings.slack_username"}}</label>
+			<label for="username">{{ctx.Locale.Tr "repo.settings.slack_username"}}</label>
 			<input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="Gitea">
 		</div>
 		<div class="field">
-			<label for="icon_url">{{.locale.Tr "repo.settings.slack_icon_url"}}</label>
+			<label for="icon_url">{{ctx.Locale.Tr "repo.settings.slack_icon_url"}}</label>
 			<input id="icon_url" name="icon_url" value="{{.SlackHook.IconURL}}" placeholder="https://example.com/img/favicon.png">
 		</div>
 		<div class="field">
-			<label for="color">{{.locale.Tr "repo.settings.slack_color"}}</label>
+			<label for="color">{{ctx.Locale.Tr "repo.settings.slack_color"}}</label>
 			<input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="#dd4b39, good, warning, danger">
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/telegram.tmpl b/templates/repo/settings/webhook/telegram.tmpl
index f618fea140..92bbbef3fd 100644
--- a/templates/repo/settings/webhook/telegram.tmpl
+++ b/templates/repo/settings/webhook/telegram.tmpl
@@ -1,17 +1,17 @@
 {{if eq .HookType "telegram"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (.locale.Tr "repo.settings.web_hook_name_telegram") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (ctx.Locale.Tr "repo.settings.web_hook_name_telegram") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/telegram/{{or .Webhook.ID "new"}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_BotToken}}error{{end}}">
-			<label for="bot_token">{{.locale.Tr "repo.settings.bot_token"}}</label>
+			<label for="bot_token">{{ctx.Locale.Tr "repo.settings.bot_token"}}</label>
 			<input id="bot_token" name="bot_token" type="text" value="{{.TelegramHook.BotToken}}" autofocus required>
 		</div>
 		<div class="required field {{if .Err_ChatID}}error{{end}}">
-			<label for="chat_id">{{.locale.Tr "repo.settings.chat_id"}}</label>
+			<label for="chat_id">{{ctx.Locale.Tr "repo.settings.chat_id"}}</label>
 			<input id="chat_id" name="chat_id" type="text" value="{{.TelegramHook.ChatID}}" required>
 		</div>
 		<div class="field {{if .Err_ThreadID}}error{{end}}">
-			<label for="thread_id">{{.locale.Tr "repo.settings.thread_id"}}</label>
+			<label for="thread_id">{{ctx.Locale.Tr "repo.settings.thread_id"}}</label>
 			<input id="thread_id" name="thread_id" type="text" value="{{.TelegramHook.ThreadID}}">
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/settings/webhook/wechatwork.tmpl b/templates/repo/settings/webhook/wechatwork.tmpl
index a84bbfa5e1..65f12998b1 100644
--- a/templates/repo/settings/webhook/wechatwork.tmpl
+++ b/templates/repo/settings/webhook/wechatwork.tmpl
@@ -1,9 +1,9 @@
 {{if eq .HookType "wechatwork"}}
-	<p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://work.weixin.qq.com" (.locale.Tr "repo.settings.web_hook_name_wechatwork") | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://work.weixin.qq.com" (ctx.Locale.Tr "repo.settings.web_hook_name_wechatwork") | Str2html}}</p>
 	<form class="ui form" action="{{.BaseLink}}/wechatwork/{{or .Webhook.ID "new"}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_PayloadURL}}error{{end}}">
-			<label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label>
+			<label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label>
 			<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
 		</div>
 		{{template "repo/settings/webhook/settings" .}}
diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl
index 3a1400575c..56c94f1b65 100644
--- a/templates/repo/sub_menu.tmpl
+++ b/templates/repo/sub_menu.tmpl
@@ -3,20 +3,20 @@
 	<div class="ui segment sub-menu repository-menu">
 		{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo)}}
 			<a class="item muted {{if .PageIsCommits}}active{{end}}" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}">
-				{{svg "octicon-history"}} <b>{{.locale.PrettyNumber .CommitsCount}}</b> {{.locale.TrN .CommitsCount "repo.commit" "repo.commits"}}
+				{{svg "octicon-history"}} <b>{{ctx.Locale.PrettyNumber .CommitsCount}}</b> {{ctx.Locale.TrN .CommitsCount "repo.commit" "repo.commits"}}
 			</a>
 			<a class="item muted {{if .PageIsBranches}}active{{end}}" href="{{.RepoLink}}/branches">
-				{{svg "octicon-git-branch"}} <b>{{.locale.PrettyNumber .BranchesCount}}</b> {{.locale.TrN .BranchesCount "repo.branch" "repo.branches"}}
+				{{svg "octicon-git-branch"}} <b>{{ctx.Locale.PrettyNumber .BranchesCount}}</b> {{ctx.Locale.TrN .BranchesCount "repo.branch" "repo.branches"}}
 			</a>
 			{{if $.Permission.CanRead $.UnitTypeCode}}
 				<a class="item muted {{if .PageIsTagList}}active{{end}}" href="{{.RepoLink}}/tags">
-					{{svg "octicon-tag"}} <b>{{.locale.PrettyNumber .NumTags}}</b> {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}
+					{{svg "octicon-tag"}} <b>{{ctx.Locale.PrettyNumber .NumTags}}</b> {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}
 				</a>
 			{{end}}
 			<span class="item not-mobile" {{if not (eq .Repository.Size 0)}}data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>
 				{{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}}
 				{{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}}
-				{{svg "octicon-database"}} <b>{{.locale.PrettyNumber (index $fileSizeFields 0)}}</b> {{index $fileSizeFields 1}}
+				{{svg "octicon-database"}} <b>{{ctx.Locale.PrettyNumber (index $fileSizeFields 0)}}</b> {{index $fileSizeFields 1}}
 			</span>
 		{{end}}
 	</div>
@@ -27,7 +27,7 @@
 			<i class="color-icon" style="background-color: {{.Color}}"></i>
 			<span class="gt-font-semibold">
 				{{if eq .Language "other"}}
-					{{$.locale.Tr "repo.language_other"}}
+					{{ctx.Locale.Tr "repo.language_other"}}
 				{{else}}
 					{{.Language}}
 				{{end}}
diff --git a/templates/repo/tag/list.tmpl b/templates/repo/tag/list.tmpl
index 5dfa79cd18..9f0676e395 100644
--- a/templates/repo/tag/list.tmpl
+++ b/templates/repo/tag/list.tmpl
@@ -6,7 +6,7 @@
 		{{template "repo/release_tag_header" .}}
 		<h4 class="ui top attached header">
 			<div class="five wide column gt-df gt-ac">
-				{{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.release.tags"}}
+				{{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.tags"}}
 			</div>
 		</h4>
 		{{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}}
@@ -26,7 +26,7 @@
 								<div class="download gt-df gt-ac">
 									{{if $.Permission.CanRead $.UnitTypeCode}}
 										{{if .CreatedUnix}}
-											<span class="gt-mr-3">{{svg "octicon-clock" 16 "gt-mr-2"}}{{TimeSinceUnix .CreatedUnix $.locale}}</span>
+											<span class="gt-mr-3">{{svg "octicon-clock" 16 "gt-mr-2"}}{{TimeSinceUnix .CreatedUnix ctx.Locale}}</span>
 										{{end}}
 
 										<a class="gt-mr-3 gt-mono muted" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .Sha1}}</a>
@@ -37,17 +37,17 @@
 										{{end}}
 
 										{{if (and $canReadReleases $.CanCreateRelease $release.IsTag)}}
-											<a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.new_release"}}</a>
+											<a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/new?tag={{.TagName}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.new_release"}}</a>
 										{{end}}
 
 										{{if (and ($.Permission.CanWrite $.UnitTypeCode) $release.IsTag)}}
 											<a class="ui delete-button gt-mr-3 muted" data-url="{{$.RepoLink}}/tags/delete" data-id="{{.ID}}">
-												{{svg "octicon-trash" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.delete_tag"}}
+												{{svg "octicon-trash" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.delete_tag"}}
 											</a>
 										{{end}}
 
 										{{if and $canReadReleases (not $release.IsTag)}}
-											<a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{$.locale.Tr "repo.release.detail"}}</a>
+											<a class="gt-mr-3 muted" href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{svg "octicon-tag" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.release.detail"}}</a>
 										{{end}}
 									{{end}}
 								</div>
@@ -66,10 +66,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.release.delete_tag"}}
+		{{ctx.Locale.Tr "repo.release.delete_tag"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.release.deletion_tag_desc"}}</p>
+		<p>{{ctx.Locale.Tr "repo.release.deletion_tag_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/repo/upload.tmpl b/templates/repo/upload.tmpl
index 6ab4451bcc..eef51994ab 100644
--- a/templates/repo/upload.tmpl
+++ b/templates/repo/upload.tmpl
@@ -6,10 +6,10 @@
 	data-accepts="{{.UploadAccepts}}"
 	data-max-file="{{.UploadMaxFiles}}"
 	data-max-size="{{.UploadMaxSize}}"
-	data-default-message="{{.locale.Tr "dropzone.default_message"}}"
-	data-invalid-input-type="{{.locale.Tr "dropzone.invalid_input_type"}}"
-	data-file-too-big="{{.locale.Tr "dropzone.file_too_big"}}"
-	data-remove-file="{{.locale.Tr "dropzone.remove_file"}}"
+	data-default-message="{{ctx.Locale.Tr "dropzone.default_message"}}"
+	data-invalid-input-type="{{ctx.Locale.Tr "dropzone.invalid_input_type"}}"
+	data-file-too-big="{{ctx.Locale.Tr "dropzone.file_too_big"}}"
+	data-remove-file="{{ctx.Locale.Tr "dropzone.remove_file"}}"
 >
 	<div class="files"></div>
 </div>
diff --git a/templates/repo/user_cards.tmpl b/templates/repo/user_cards.tmpl
index 61ed11366c..12fb23f067 100644
--- a/templates/repo/user_cards.tmpl
+++ b/templates/repo/user_cards.tmpl
@@ -18,7 +18,7 @@
 					{{else if .Location}}
 						{{svg "octicon-location"}} {{.Location}}
 					{{else}}
-						{{svg "octicon-calendar"}} {{$.locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}}
+						{{svg "octicon-calendar"}} {{ctx.Locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix) | Safe}}
 					{{end}}
 				</div>
 			</li>
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 0882ff4b27..0064da9632 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -21,27 +21,27 @@
 		<div class="file-header-right file-actions gt-df gt-ac gt-fw">
 			{{if .HasSourceRenderedToggle}}
 				<div class="ui compact icon buttons">
-					<a href="{{$.Link}}?display=source" class="ui mini basic button {{if .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{.locale.Tr "repo.file_view_source"}}">{{svg "octicon-code" 15}}</a>
-					<a href="{{$.Link}}" class="ui mini basic button {{if .IsDisplayingRendered}}active{{end}}" data-tooltip-content="{{.locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file" 15}}</a>
+					<a href="{{$.Link}}?display=source" class="ui mini basic button {{if .IsDisplayingSource}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_source"}}">{{svg "octicon-code" 15}}</a>
+					<a href="{{$.Link}}" class="ui mini basic button {{if .IsDisplayingRendered}}active{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.file_view_rendered"}}">{{svg "octicon-file" 15}}</a>
 				</div>
 			{{end}}
 			{{if not .ReadmeInList}}
 				<div class="ui buttons gt-mr-2">
-					<a class="ui mini basic button" href="{{$.RawFileLink}}">{{.locale.Tr "repo.file_raw"}}</a>
+					<a class="ui mini basic button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a>
 					{{if not .IsViewCommit}}
-						<a class="ui mini basic button" href="{{.RepoLink}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.file_permalink"}}</a>
+						<a class="ui mini basic button" href="{{.RepoLink}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.file_permalink"}}</a>
 					{{end}}
 					{{if .IsRepresentableAsText}}
-						<a class="ui mini basic button" href="{{.RepoLink}}/blame/{{.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.blame"}}</a>
+						<a class="ui mini basic button" href="{{.RepoLink}}/blame/{{.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.blame"}}</a>
 					{{end}}
-					<a class="ui mini basic button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.file_history"}}</a>
+					<a class="ui mini basic button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.file_history"}}</a>
 					{{if .EscapeStatus.Escaped}}
-						<button class="ui mini basic button unescape-button gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</button>
-						<button class="ui mini basic button escape-button">{{.locale.Tr "repo.escape_control_characters"}}</button>
+						<button class="ui mini basic button unescape-button gt-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
+						<button class="ui mini basic button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
 					{{end}}
 				</div>
-				<a download href="{{$.RawFileLink}}"><span class="btn-octicon" data-tooltip-content="{{.locale.Tr "repo.download_file"}}">{{svg "octicon-download"}}</span></a>
-				<a id="copy-content" class="btn-octicon {{if not .CanCopyContent}} disabled{{end}}"{{if or .IsImageFile (and .HasSourceRenderedToggle (not .IsDisplayingSource))}} data-link="{{$.RawFileLink}}"{{end}} data-tooltip-content="{{if .CanCopyContent}}{{.locale.Tr "copy_content"}}{{else}}{{.locale.Tr "copy_type_unsupported"}}{{end}}">{{svg "octicon-copy" 14}}</a>
+				<a download href="{{$.RawFileLink}}"><span class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.download_file"}}">{{svg "octicon-download"}}</span></a>
+				<a id="copy-content" class="btn-octicon {{if not .CanCopyContent}} disabled{{end}}"{{if or .IsImageFile (and .HasSourceRenderedToggle (not .IsDisplayingSource))}} data-link="{{$.RawFileLink}}"{{end}} data-tooltip-content="{{if .CanCopyContent}}{{ctx.Locale.Tr "copy_content"}}{{else}}{{ctx.Locale.Tr "copy_type_unsupported"}}{{end}}">{{svg "octicon-copy" 14}}</a>
 				{{if .EnableFeed}}
 				<a class="btn-octicon" href="{{$.FeedURL}}/rss/{{$.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{svg "octicon-rss" 14}}</a>
 				{{end}}
@@ -58,8 +58,8 @@
 					{{end}}
 				{{end}}
 			{{else if .EscapeStatus.Escaped}}
-				<button class="ui mini basic button unescape-button gt-mr-2 gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</button>
-				<button class="ui mini basic button escape-button gt-mr-2">{{.locale.Tr "repo.escape_control_characters"}}</button>
+				<button class="ui mini basic button unescape-button gt-mr-2 gt-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
+				<button class="ui mini basic button escape-button gt-mr-2">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
 			{{end}}
 		</div>
 	</h4>
@@ -78,16 +78,16 @@
 						<img src="{{$.RawFileLink}}">
 					{{else if .IsVideoFile}}
 						<video controls src="{{$.RawFileLink}}">
-							<strong>{{.locale.Tr "repo.video_not_supported_in_browser"}}</strong>
+							<strong>{{ctx.Locale.Tr "repo.video_not_supported_in_browser"}}</strong>
 						</video>
 					{{else if .IsAudioFile}}
 						<audio controls src="{{$.RawFileLink}}">
-							<strong>{{.locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
+							<strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
 						</audio>
 					{{else if .IsPDFFile}}
-						<div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{.locale.Tr "repo.diff.view_file"}}"></div>
+						<div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "repo.diff.view_file"}}"></div>
 					{{else}}
-						<a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.locale.Tr "repo.file_view_raw"}}</a>
+						<a href="{{$.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
 					{{end}}
 				</div>
 			{{else if .FileSize}}
@@ -95,7 +95,7 @@
 				<table>
 					<tbody>
 						<tr>
-							<td><strong>{{.locale.Tr "repo.file_too_large"}}</strong></td>
+							<td><strong>{{ctx.Locale.Tr "repo.file_too_large"}}</strong></td>
 						</tr>
 					</tbody>
 				</table>
@@ -107,7 +107,7 @@
 						<tr>
 							<td id="L{{$line}}" class="lines-num"><span id="L{{$line}}" data-line-number="{{$line}}"></span></td>
 							{{if $.EscapeStatus.Escaped}}
-								<td class="lines-escape">{{if (index $.LineEscapeStatus $idx).Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{if (index $.LineEscapeStatus $idx).HasInvisible}}{{$.locale.Tr "repo.invisible_runes_line"}} {{end}}{{if (index $.LineEscapeStatus $idx).HasAmbiguous}}{{$.locale.Tr "repo.ambiguous_runes_line"}}{{end}}"></button>{{end}}</td>
+								<td class="lines-escape">{{if (index $.LineEscapeStatus $idx).Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{if (index $.LineEscapeStatus $idx).HasInvisible}}{{ctx.Locale.Tr "repo.invisible_runes_line"}} {{end}}{{if (index $.LineEscapeStatus $idx).HasAmbiguous}}{{ctx.Locale.Tr "repo.ambiguous_runes_line"}}{{end}}"></button>{{end}}</td>
 							{{end}}
 							<td rel="L{{$line}}" class="lines-code chroma"><code class="code-inner">{{$code | Safe}}</code></td>
 						</tr>
@@ -116,10 +116,10 @@
 				</table>
 				<div class="code-line-menu ui vertical pointing menu tippy-target">
 					{{if $.Permission.CanRead $.UnitTypeIssues}}
-						<a class="item ref-in-new-issue" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{.locale.Tr "repo.issues.context.reference_issue"}}</a>
+						<a class="item ref-in-new-issue" data-url-issue-new="{{.RepoLink}}/issues/new" data-url-param-body-link="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}" rel="nofollow noindex">{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}</a>
 					{{end}}
-					<a class="item view_git_blame" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.view_git_blame"}}</a>
-					<a class="item copy-line-permalink" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{.locale.Tr "repo.file_copy_permalink"}}</a>
+					<a class="item view_git_blame" href="{{.Repository.Link}}/blame/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.view_git_blame"}}</a>
+					<a class="item copy-line-permalink" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a>
 				</div>
 				{{end}}
 			{{end}}
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl
index 7be2455779..bfd59839f5 100644
--- a/templates/repo/view_list.tmpl
+++ b/templates/repo/view_list.tmpl
@@ -34,7 +34,7 @@
 					</span>
 				{{end}}
 			</th>
-			<th class="text grey right age">{{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When $.locale}}{{end}}{{end}}</th>
+			<th class="text grey right age">{{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When ctx.Locale}}{{end}}{{end}}</th>
 		</tr>
 	</thead>
 	<tbody>
@@ -89,7 +89,7 @@
 						{{end}}
 					</span>
 				</td>
-				<td class="text right age three wide">{{if $commit}}{{TimeSince $commit.Committer.When $.locale}}{{end}}</td>
+				<td class="text right age three wide">{{if $commit}}{{TimeSince $commit.Committer.When ctx.Locale}}{{end}}</td>
 			</tr>
 		{{end}}
 	</tbody>
diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl
index 291089d5a6..ff31df0c32 100644
--- a/templates/repo/wiki/new.tmpl
+++ b/templates/repo/wiki/new.tmpl
@@ -4,40 +4,40 @@
 	<div class="ui container">
 		{{template "base/alert" .}}
 		<div class="ui header flex-text-block gt-sb">
-			{{.locale.Tr "repo.wiki.new_page"}}
+			{{ctx.Locale.Tr "repo.wiki.new_page"}}
 			{{if .PageIsWikiEdit}}
-				<a class="ui tiny primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
+				<a class="ui tiny primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a>
 			{{end}}
 		</div>
 		<form class="ui form" action="{{.Link}}?action={{if .PageIsWikiEdit}}_edit{{else}}_new{{end}}" method="post">
 			{{.CsrfTokenHtml}}
 			<div class="field {{if .Err_Title}}error{{end}}">
-				<input name="title" value="{{.title}}" aria-label="{{.locale.Tr "repo.wiki.page_title"}}" placeholder="{{.locale.Tr "repo.wiki.page_title"}}" autofocus required>
+				<input name="title" value="{{.title}}" aria-label="{{ctx.Locale.Tr "repo.wiki.page_title"}}" placeholder="{{ctx.Locale.Tr "repo.wiki.page_title"}}" autofocus required>
 			</div>
 			<div class="help">
-				{{.locale.Tr "repo.wiki.page_name_desc"}}
+				{{ctx.Locale.Tr "repo.wiki.page_name_desc"}}
 			</div>
 
 			{{$content := .content}}
 			{{if not .PageIsWikiEdit}}
-				{{$content = .locale.Tr "repo.wiki.welcome"}}
+				{{$content = ctx.Locale.Tr "repo.wiki.welcome"}}
 			{{end}}
 			{{template "shared/combomarkdowneditor" (dict
 				"MarkdownPreviewUrl" (print .Repository.Link "/markup")
 				"MarkdownPreviewContext" .RepoLink
 				"TextareaName" "content"
-				"TextareaPlaceholder" (.locale.Tr "repo.wiki.page_content")
-				"TextareaAriaLabel" (.locale.Tr "repo.wiki.page_content")
+				"TextareaPlaceholder" (ctx.Locale.Tr "repo.wiki.page_content")
+				"TextareaAriaLabel" (ctx.Locale.Tr "repo.wiki.page_content")
 				"TextareaContent" $content
 			)}}
 
 			<div class="field gt-mt-4">
-				<input name="message" aria-label="{{.locale.Tr "repo.wiki.default_commit_message"}}" placeholder="{{.locale.Tr "repo.wiki.default_commit_message"}}">
+				<input name="message" aria-label="{{ctx.Locale.Tr "repo.wiki.default_commit_message"}}" placeholder="{{ctx.Locale.Tr "repo.wiki.default_commit_message"}}">
 			</div>
 			<div class="divider"></div>
 			<div class="text right">
 				<button class="ui primary button">
-					{{.locale.Tr "repo.wiki.save_page"}}
+					{{ctx.Locale.Tr "repo.wiki.save_page"}}
 				</button>
 			</div>
 		</form>
diff --git a/templates/repo/wiki/pages.tmpl b/templates/repo/wiki/pages.tmpl
index c778933e8b..a1bf13287c 100644
--- a/templates/repo/wiki/pages.tmpl
+++ b/templates/repo/wiki/pages.tmpl
@@ -3,10 +3,10 @@
 	{{template "repo/header" .}}
 	<div class="ui container">
 		<h2 class="ui header gt-df gt-ac gt-sb">
-			<span>{{.locale.Tr "repo.wiki.pages"}}</span>
+			<span>{{ctx.Locale.Tr "repo.wiki.pages"}}</span>
 			<span>
 				{{if and .CanWriteWiki (not .Repository.IsMirror)}}
-					<a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
+					<a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a>
 				{{end}}
 			</span>
 		</h2>
@@ -17,10 +17,10 @@
 						<td>
 							{{svg "octicon-file"}}
 							<a href="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</a>
-							<a class="wiki-git-entry" href="{{$.RepoLink}}/wiki/{{.GitEntryName | PathEscape}}" data-tooltip-content="{{$.locale.Tr "repo.wiki.original_git_entry_tooltip"}}">{{svg "octicon-chevron-right"}}</a>
+							<a class="wiki-git-entry" href="{{$.RepoLink}}/wiki/{{.GitEntryName | PathEscape}}" data-tooltip-content="{{ctx.Locale.Tr "repo.wiki.original_git_entry_tooltip"}}">{{svg "octicon-chevron-right"}}</a>
 						</td>
-						{{$timeSince := TimeSinceUnix .UpdatedUnix $.locale}}
-						<td class="text right">{{$.locale.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td>
+						{{$timeSince := TimeSinceUnix .UpdatedUnix ctx.Locale}}
+						<td class="text right">{{ctx.Locale.Tr "repo.wiki.last_updated" $timeSince | Safe}}</td>
 					</tr>
 				{{end}}
 			</tbody>
diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl
index b2c6ccf900..95b3cd0920 100644
--- a/templates/repo/wiki/revision.tmpl
+++ b/templates/repo/wiki/revision.tmpl
@@ -6,11 +6,11 @@
 		<div class="ui stackable grid">
 			<div class="ui eight wide column">
 				<div class="ui header">
-					<a class="file-revisions-btn ui basic button" title="{{.locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}"><span>{{.revision}}</span> {{svg "octicon-home"}}</a>
+					<a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}"><span>{{.revision}}</span> {{svg "octicon-home"}}</a>
 					{{$title}}
 					<div class="ui sub header gt-word-break">
-						{{$timeSince := TimeSince .Author.When $.locale}}
-						{{.locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}}
+						{{$timeSince := TimeSince .Author.When ctx.Locale}}
+						{{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}}
 					</div>
 				</div>
 			</div>
@@ -21,12 +21,12 @@
 				</div>
 			</div>
 		</div>
-		<h2 class="ui top header">{{.locale.Tr "repo.wiki.wiki_page_revisions"}}</h2>
+		<h2 class="ui top header">{{ctx.Locale.Tr "repo.wiki.wiki_page_revisions"}}</h2>
 		<div class="gt-mt-4">
 			<h4 class="ui top attached header">
 				<div class="ui stackable grid">
 					<div class="sixteen wide column">
-						{{.CommitCount}} {{.locale.Tr "repo.commits.commits"}}
+						{{.CommitCount}} {{ctx.Locale.Tr "repo.commits.commits"}}
 					</div>
 				</div>
 			</h4>
diff --git a/templates/repo/wiki/start.tmpl b/templates/repo/wiki/start.tmpl
index dbe625c568..dca7a074aa 100644
--- a/templates/repo/wiki/start.tmpl
+++ b/templates/repo/wiki/start.tmpl
@@ -4,10 +4,10 @@
 	<div class="ui container">
 		<div class="ui center segment gt-py-5">
 			{{svg "octicon-book" 48}}
-			<h2>{{.locale.Tr "repo.wiki.welcome"}}</h2>
-			<p>{{.locale.Tr "repo.wiki.welcome_desc"}}</p>
+			<h2>{{ctx.Locale.Tr "repo.wiki.welcome"}}</h2>
+			<p>{{ctx.Locale.Tr "repo.wiki.welcome_desc"}}</p>
 			{{if and .CanWriteWiki (not .Repository.IsMirror)}}
-				<a class="ui primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.create_first_page"}}</a>
+				<a class="ui primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a>
 			{{end}}
 		</div>
 	</div>
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
index 4427a986df..039ff3f179 100644
--- a/templates/repo/wiki/view.tmpl
+++ b/templates/repo/wiki/view.tmpl
@@ -5,10 +5,10 @@
 	<div class="ui container">
 		<div class="repo-button-row">
 			<div class="gt-df gt-ac">
-				<div class="ui floating filter dropdown" data-no-results="{{.locale.Tr "repo.pulls.no_results"}}">
+				<div class="ui floating filter dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}">
 					<div class="ui basic small button">
 						<span class="text">
-							{{.locale.Tr "repo.wiki.page"}}:
+							{{ctx.Locale.Tr "repo.wiki.page"}}:
 							<strong>{{$title}}</strong>
 						</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
@@ -16,10 +16,10 @@
 					<div class="menu">
 						<div class="ui icon search input">
 							<i class="icon">{{svg "octicon-filter" 16}}</i>
-							<input name="search" placeholder="{{.locale.Tr "repo.wiki.filter_page"}}...">
+							<input name="search" placeholder="{{ctx.Locale.Tr "repo.wiki.filter_page"}}...">
 						</div>
 						<div class="scrolling menu">
-							<a class="item muted" href="{{.RepoLink}}/wiki/?action=_pages">{{.locale.Tr "repo.wiki.pages"}}</a>
+							<a class="item muted" href="{{.RepoLink}}/wiki/?action=_pages">{{ctx.Locale.Tr "repo.wiki.pages"}}</a>
 							<div class="divider"></div>
 							{{range .Pages}}
 								<a class="item {{if eq $.Title .Name}}selected{{end}}" href="{{$.RepoLink}}/wiki/{{.SubURL}}">{{.Name}}</a>
@@ -36,23 +36,23 @@
 		<div class="ui dividing header">
 			<div class="ui stackable grid">
 				<div class="eight wide column">
-					<a class="file-revisions-btn ui basic button" title="{{.locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" ><span>{{.CommitCount}}</span> {{svg "octicon-history"}}</a>
+					<a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" ><span>{{.CommitCount}}</span> {{svg "octicon-history"}}</a>
 					{{$title}}
 					<div class="ui sub header">
-						{{$timeSince := TimeSince .Author.When $.locale}}
-						{{.locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}}
+						{{$timeSince := TimeSince .Author.When ctx.Locale}}
+						{{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince | Safe}}
 					</div>
 				</div>
 				<div class="eight wide right aligned column">
 					{{if .EscapeStatus.Escaped}}
-						<a class="ui small button unescape-button gt-hidden">{{.locale.Tr "repo.unescape_control_characters"}}</a>
-						<a class="ui small button escape-button">{{.locale.Tr "repo.escape_control_characters"}}</a>
+						<a class="ui small button unescape-button gt-hidden">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</a>
+						<a class="ui small button escape-button">{{ctx.Locale.Tr "repo.escape_control_characters"}}</a>
 					{{end}}
 					{{if and .CanWriteWiki (not .Repository.IsMirror)}}
 						<div class="ui right">
-							<a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_edit">{{.locale.Tr "repo.wiki.edit_page_button"}}</a>
-							<a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
-							<a class="ui small red button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}?action=_delete" data-id="{{.PageURL}}">{{.locale.Tr "repo.wiki.delete_page_button"}}</a>
+							<a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_edit">{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}</a>
+							<a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.new_page_button"}}</a>
+							<a class="ui small red button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}?action=_delete" data-id="{{.PageURL}}">{{ctx.Locale.Tr "repo.wiki.delete_page_button"}}</a>
 						</div>
 					{{end}}
 				</div>
@@ -79,7 +79,7 @@
 			{{if .sidebarPresent}}
 			<div class="markup wiki-content-sidebar">
 				{{if and .CanWriteWiki (not .Repository.IsMirror)}}
-					<a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{.locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
+					<a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
 				{{end}}
 				{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .sidebarEscapeStatus "root" $}}
 				{{.sidebarContent | Safe}}
@@ -91,7 +91,7 @@
 			{{if .footerPresent}}
 			<div class="markup wiki-content-footer">
 				{{if and .CanWriteWiki (not .Repository.IsMirror)}}
-					<a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{.locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
+					<a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
 				{{end}}
 				{{template "repo/unicode_escape_prompt" dict "footerEscapeStatus" .sidebarEscapeStatus "root" $}}
 				{{.footerContent | Safe}}
@@ -104,10 +104,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "repo.wiki.delete_page_button"}}
+		{{ctx.Locale.Tr "repo.wiki.delete_page_button"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "repo.wiki.delete_page_notice_1" ($title|Escape) | Safe}}</p>
+		<p>{{ctx.Locale.Tr "repo.wiki.delete_page_notice_1" ($title|Escape) | Safe}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/shared/actions/runner_edit.tmpl b/templates/shared/actions/runner_edit.tmpl
index 46bd981999..c10901501d 100644
--- a/templates/shared/actions/runner_edit.tmpl
+++ b/templates/shared/actions/runner_edit.tmpl
@@ -1,6 +1,6 @@
 <div class="runner-container">
 	<h4 class="ui top attached header">
-		{{.locale.Tr "actions.runners.runner_title"}} {{.Runner.ID}} {{.Runner.Name}}
+		{{ctx.Locale.Tr "actions.runners.runner_title"}} {{.Runner.ID}} {{.Runner.Name}}
 	</h4>
 	<div class="ui attached segment">
 		<form class="ui form" method="post">
@@ -8,15 +8,15 @@
 			{{.CsrfTokenHtml}}
 			<div class="runner-basic-info">
 				<div class="field gt-dib gt-mr-4">
-					<label>{{.locale.Tr "actions.runners.status"}}</label>
-					<span class="ui {{if .Runner.IsOnline}}green{{else}}basic{{end}} label">{{.Runner.StatusLocaleName $.locale}}</span>
+					<label>{{ctx.Locale.Tr "actions.runners.status"}}</label>
+					<span class="ui {{if .Runner.IsOnline}}green{{else}}basic{{end}} label">{{.Runner.StatusLocaleName ctx.Locale}}</span>
 				</div>
 				<div class="field gt-dib gt-mr-4">
-					<label>{{.locale.Tr "actions.runners.last_online"}}</label>
-					<span>{{if .Runner.LastOnline}}{{TimeSinceUnix .Runner.LastOnline $.locale}}{{else}}{{$.locale.Tr "never"}}{{end}}</span>
+					<label>{{ctx.Locale.Tr "actions.runners.last_online"}}</label>
+					<span>{{if .Runner.LastOnline}}{{TimeSinceUnix .Runner.LastOnline ctx.Locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</span>
 				</div>
 				<div class="field gt-dib gt-mr-4">
-					<label>{{.locale.Tr "actions.runners.labels"}}</label>
+					<label>{{ctx.Locale.Tr "actions.runners.labels"}}</label>
 					<span>
 						{{range .Runner.AgentLabels}}
 						<span class="ui label">{{.}}</span>
@@ -24,59 +24,59 @@
 					</span>
 				</div>
 				<div class="field gt-dib gt-mr-4">
-					<label>{{.locale.Tr "actions.runners.owner_type"}}</label>
-					<span data-tooltip-content="{{.Runner.BelongsToOwnerName}}">{{.Runner.BelongsToOwnerType.LocaleString $.locale}}</span>
+					<label>{{ctx.Locale.Tr "actions.runners.owner_type"}}</label>
+					<span data-tooltip-content="{{.Runner.BelongsToOwnerName}}">{{.Runner.BelongsToOwnerType.LocaleString ctx.Locale}}</span>
 				</div>
 			</div>
 
 			<div class="divider"></div>
 
 			<div class="field">
-				<label for="description">{{.locale.Tr "actions.runners.description"}}</label>
+				<label for="description">{{ctx.Locale.Tr "actions.runners.description"}}</label>
 				<input id="description" name="description" value="{{.Runner.Description}}">
 			</div>
 
 			<div class="divider"></div>
 
 			<div class="field">
-				<button class="ui primary button" data-url="{{.Link}}">{{.locale.Tr "actions.runners.update_runner"}}</button>
+				<button class="ui primary button" data-url="{{.Link}}">{{ctx.Locale.Tr "actions.runners.update_runner"}}</button>
 				<button class="ui red button delete-button show-modal" data-url="{{.Link}}/delete" data-modal="#runner-delete-modal">
-					{{.locale.Tr "actions.runners.delete_runner"}}</button>
+					{{ctx.Locale.Tr "actions.runners.delete_runner"}}</button>
 			</div>
 		</form>
 	</div>
 
 	<h4 class="ui top attached header">
-		{{.locale.Tr "actions.runners.task_list"}}
+		{{ctx.Locale.Tr "actions.runners.task_list"}}
 	</h4>
 	<div class="ui attached segment">
 		<table class="ui very basic striped table unstackable">
 			<thead>
 				<tr>
-					<th>{{.locale.Tr "actions.runners.task_list.run"}}</th>
-					<th>{{.locale.Tr "actions.runners.task_list.status"}}</th>
-					<th>{{.locale.Tr "actions.runners.task_list.repository"}}</th>
-					<th>{{.locale.Tr "actions.runners.task_list.commit"}}</th>
-					<th>{{.locale.Tr "actions.runners.task_list.done_at"}}</th>
+					<th>{{ctx.Locale.Tr "actions.runners.task_list.run"}}</th>
+					<th>{{ctx.Locale.Tr "actions.runners.task_list.status"}}</th>
+					<th>{{ctx.Locale.Tr "actions.runners.task_list.repository"}}</th>
+					<th>{{ctx.Locale.Tr "actions.runners.task_list.commit"}}</th>
+					<th>{{ctx.Locale.Tr "actions.runners.task_list.done_at"}}</th>
 				</tr>
 			</thead>
 			<tbody>
 				{{range .Tasks}}
 				<tr>
 					<td><a href="{{.GetRunLink}}" target="_blank">{{.ID}}</a></td>
-					<td><span class="ui label task-status-{{.Status.String}}">{{.Status.LocaleString $.locale}}</span></td>
+					<td><span class="ui label task-status-{{.Status.String}}">{{.Status.LocaleString ctx.Locale}}</span></td>
 					<td><a href="{{.GetRepoLink}}" target="_blank">{{.GetRepoName}}</a></td>
 					<td>
 						<strong><a href="{{.GetCommitLink}}" target="_blank">{{ShortSha .CommitSHA}}</a></strong>
 					</td>
 					<td>{{if .IsStopped}}
-						<span>{{TimeSinceUnix .Stopped $.locale}}</span>
+						<span>{{TimeSinceUnix .Stopped ctx.Locale}}</span>
 						{{else}}-{{end}}</td>
 				</tr>
 				{{end}}
 				{{if not .Tasks}}
 				<tr>
-					<td colspan="5">{{.locale.Tr "actions.runners.task_list.no_tasks"}}</td>
+					<td colspan="5">{{ctx.Locale.Tr "actions.runners.task_list.no_tasks"}}</td>
 				</tr>
 				{{end}}
 			</tbody>
@@ -86,10 +86,10 @@
 	<div class="ui g-modal-confirm delete modal" id="runner-delete-modal">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "actions.runners.delete_runner_header"}}
+			{{ctx.Locale.Tr "actions.runners.delete_runner_header"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "actions.runners.delete_runner_notice" | Safe}}</p>
+			<p>{{ctx.Locale.Tr "actions.runners.delete_runner_notice" | Safe}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/shared/actions/runner_list.tmpl b/templates/shared/actions/runner_list.tmpl
index dc81c76ee2..589edbc957 100644
--- a/templates/shared/actions/runner_list.tmpl
+++ b/templates/shared/actions/runner_list.tmpl
@@ -68,16 +68,16 @@
 					{{range .Runners}}
 					<tr>
 						<td>
-							<span class="ui {{if .IsOnline}}green{{else}}basic{{end}} label">{{.StatusLocaleName $.locale}}</span>
+							<span class="ui {{if .IsOnline}}green{{else}}basic{{end}} label">{{.StatusLocaleName ctx.Locale}}</span>
 						</td>
 						<td>{{.ID}}</td>
 						<td><p data-tooltip-content="{{.Description}}">{{.Name}}</p></td>
 						<td>{{if .Version}}{{.Version}}{{else}}{{ctx.Locale.Tr "unknown"}}{{end}}</td>
-						<td><span data-tooltip-content="{{.BelongsToOwnerName}}">{{.BelongsToOwnerType.LocaleString $.locale}}</span></td>
+						<td><span data-tooltip-content="{{.BelongsToOwnerName}}">{{.BelongsToOwnerType.LocaleString ctx.Locale}}</span></td>
 						<td class="runner-tags">
 							{{range .AgentLabels}}<span class="ui label">{{.}}</span>{{end}}
 						</td>
-						<td>{{if .LastOnline}}{{TimeSinceUnix .LastOnline $.locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</td>
+						<td>{{if .LastOnline}}{{TimeSinceUnix .LastOnline ctx.Locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</td>
 						<td class="runner-ops">
 							{{if .Editable $.RunnerOwnerID $.RunnerRepoID}}
 							<a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl
index 80d4e3dd85..834de64fc5 100644
--- a/templates/shared/issuelist.tmpl
+++ b/templates/shared/issuelist.tmpl
@@ -5,7 +5,7 @@
 
 			<div class="flex-item-icon">
 				{{if $.CanWriteIssuesOrPulls}}
-				<input type="checkbox" autocomplete="off" class="issue-checkbox gt-mr-4" data-issue-id={{.ID}} aria-label="{{$.locale.Tr "repo.issues.action_check"}} &quot;{{.Title}}&quot;">
+				<input type="checkbox" autocomplete="off" class="issue-checkbox gt-mr-4" data-issue-id={{.ID}} aria-label="{{ctx.Locale.Tr "repo.issues.action_check"}} &quot;{{.Title}}&quot;">
 				{{end}}
 				{{template "shared/issueicon" .}}
 			</div>
@@ -60,13 +60,13 @@
 							#{{.Index}}
 						{{end}}
 					</a>
-					{{$timeStr := TimeSinceUnix .GetLastEventTimestamp $.locale}}
+					{{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}}
 					{{if .OriginalAuthor}}
-						{{$.locale.Tr .GetLastEventLabelFake $timeStr (.OriginalAuthor|Escape) | Safe}}
+						{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr (.OriginalAuthor|Escape) | Safe}}
 					{{else if gt .Poster.ID 0}}
-						{{$.locale.Tr .GetLastEventLabel $timeStr (.Poster.HomeLink|Escape) (.Poster.GetDisplayName | Escape) | Safe}}
+						{{ctx.Locale.Tr .GetLastEventLabel $timeStr (.Poster.HomeLink|Escape) (.Poster.GetDisplayName | Escape) | Safe}}
 					{{else}}
-						{{$.locale.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape) | Safe}}
+						{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape) | Safe}}
 					{{end}}
 					{{if .IsPull}}
 						<div class="branches flex-text-inline">
@@ -111,7 +111,7 @@
 						</span>
 					{{end}}
 					{{if ne .DeadlineUnix 0}}
-						<span class="due-date flex-text-inline" data-tooltip-content="{{$.locale.Tr "repo.issues.due_date"}}">
+						<span class="due-date flex-text-inline" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.due_date"}}">
 							<span{{if .IsOverdue}} class="text red"{{end}}>
 								{{svg "octicon-calendar" 14}}
 								{{DateTime "short" .DeadlineUnix}}
@@ -125,25 +125,25 @@
 						{{if gt $approveOfficial 0}}
 							<span class="approvals green flex-text-inline">
 								{{svg "octicon-check" 14}}
-								{{$.locale.TrN $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n" $approveOfficial}}
+								{{ctx.Locale.TrN $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n" $approveOfficial}}
 							</span>
 						{{end}}
 						{{if gt $rejectOfficial 0}}
 							<span class="rejects red flex-text-inline">
 								{{svg "octicon-diff" 14}}
-								{{$.locale.TrN $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n" $rejectOfficial}}
+								{{ctx.Locale.TrN $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n" $rejectOfficial}}
 							</span>
 						{{end}}
 						{{if gt $waitingOfficial 0}}
 							<span class="waiting flex-text-inline">
 								{{svg "octicon-eye" 14}}
-								{{$.locale.TrN $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n" $waitingOfficial}}
+								{{ctx.Locale.TrN $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n" $waitingOfficial}}
 							</span>
 						{{end}}
 						{{if and (not .PullRequest.HasMerged) (gt (len .PullRequest.ConflictedFiles) 0)}}
 							<span class="conflicting flex-text-inline">
 								{{svg "octicon-x" 14}}
-								{{$.locale.TrN (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n" (len .PullRequest.ConflictedFiles)}}
+								{{ctx.Locale.TrN (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n" (len .PullRequest.ConflictedFiles)}}
 							</span>
 						{{end}}
 					{{end}}
@@ -153,7 +153,7 @@
 	{{end}}
 	{{if .IssueIndexerUnavailable}}
 		<div class="ui error message">
-			<p>{{$.locale.Tr "repo.issues.keyword_search_unavailable"}}</p>
+			<p>{{ctx.Locale.Tr "repo.issues.keyword_search_unavailable"}}</p>
 		</div>
 	{{end}}
 </div>
diff --git a/templates/shared/searchbottom.tmpl b/templates/shared/searchbottom.tmpl
index cce82721cd..55b6cb2909 100644
--- a/templates/shared/searchbottom.tmpl
+++ b/templates/shared/searchbottom.tmpl
@@ -6,7 +6,7 @@
 		</div>
 		<div class="gt-mr-4">
 			{{if not .result.UpdatedUnix.IsZero}}
-					<span class="ui grey text">{{.root.locale.Tr "explore.code_last_indexed_at" (TimeSinceUnix .result.UpdatedUnix .root.locale) | Safe}}</span>
+					<span class="ui grey text">{{ctx.Locale.Tr "explore.code_last_indexed_at" (TimeSinceUnix .result.UpdatedUnix ctx.Locale) | Safe}}</span>
 			{{end}}
 		</div>
 </div>
diff --git a/templates/shared/secrets/add_list.tmpl b/templates/shared/secrets/add_list.tmpl
index 4e003d3f27..7192f31fb2 100644
--- a/templates/shared/secrets/add_list.tmpl
+++ b/templates/shared/secrets/add_list.tmpl
@@ -1,12 +1,12 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "secrets.management"}}
+	{{ctx.Locale.Tr "secrets.management"}}
 	<div class="ui right">
 		<button class="ui primary tiny button show-modal"
 			data-modal="#add-secret-modal"
 			data-modal-form.action="{{.Link}}"
-			data-modal-header="{{.locale.Tr "secrets.creation"}}"
+			data-modal-header="{{ctx.Locale.Tr "secrets.creation"}}"
 		>
-			{{.locale.Tr "secrets.creation"}}
+			{{ctx.Locale.Tr "secrets.creation"}}
 		</button>
 	</div>
 </h4>
@@ -28,12 +28,12 @@
 			</div>
 			<div class="flex-item-trailing">
 				<span class="color-text-light-2">
-					{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}}
+					{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}}
 				</span>
 				<button class="ui btn interact-bg link-action gt-p-3"
 					data-url="{{$.Link}}/delete?id={{.ID}}"
-					data-modal-confirm="{{$.locale.Tr "secrets.deletion.description"}}"
-					data-tooltip-content="{{$.locale.Tr "secrets.deletion"}}"
+					data-modal-confirm="{{ctx.Locale.Tr "secrets.deletion.description"}}"
+					data-tooltip-content="{{ctx.Locale.Tr "secrets.deletion"}}"
 				>
 					{{svg "octicon-trash"}}
 				</button>
@@ -42,7 +42,7 @@
 		{{end}}
 	</div>
 	{{else}}
-		{{.locale.Tr "secrets.none"}}
+		{{ctx.Locale.Tr "secrets.none"}}
 	{{end}}
 </div>
 
@@ -55,24 +55,24 @@
 		<div class="content">
 			{{.CsrfTokenHtml}}
 			<div class="field">
-				{{.locale.Tr "secrets.description"}}
+				{{ctx.Locale.Tr "secrets.description"}}
 			</div>
 			<div class="field">
-				<label for="secret-name">{{.locale.Tr "name"}}</label>
+				<label for="secret-name">{{ctx.Locale.Tr "name"}}</label>
 				<input autofocus required
 					id="secret-name"
 					name="name"
 					value="{{.name}}"
 					pattern="^(?!GITEA_|GITHUB_)[a-zA-Z_][a-zA-Z0-9_]*$"
-					placeholder="{{.locale.Tr "secrets.creation.name_placeholder"}}"
+					placeholder="{{ctx.Locale.Tr "secrets.creation.name_placeholder"}}"
 				>
 			</div>
 			<div class="field">
-				<label for="secret-data">{{.locale.Tr "value"}}</label>
+				<label for="secret-data">{{ctx.Locale.Tr "value"}}</label>
 				<textarea required
 					id="secret-data"
 					name="data"
-					placeholder="{{.locale.Tr "secrets.creation.value_placeholder"}}"
+					placeholder="{{ctx.Locale.Tr "secrets.creation.value_placeholder"}}"
 				></textarea>
 			</div>
 		</div>
diff --git a/templates/shared/user/org_profile_avatar.tmpl b/templates/shared/user/org_profile_avatar.tmpl
index 9c94930511..b9ade23d05 100644
--- a/templates/shared/user/org_profile_avatar.tmpl
+++ b/templates/shared/user/org_profile_avatar.tmpl
@@ -6,8 +6,8 @@
 					{{ctx.AvatarUtils.Avatar . 100}}
 					<span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span>
 					<span class="org-visibility">
-						{{if .Visibility.IsLimited}}<div class="ui medium basic horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
-						{{if .Visibility.IsPrivate}}<div class="ui medium basic horizontal label">{{$.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
+						{{if .Visibility.IsLimited}}<div class="ui medium basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
+						{{if .Visibility.IsPrivate}}<div class="ui medium basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
 					</span>
 				</div>
 			</div>
diff --git a/templates/shared/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl
index e328c26e1f..598c194f19 100644
--- a/templates/shared/user/profile_big_avatar.tmpl
+++ b/templates/shared/user/profile_big_avatar.tmpl
@@ -1,7 +1,7 @@
 <div class="ui card">
 	<div id="profile-avatar" class="content gt-df">
 	{{if eq .SignedUserID .ContextUser.ID}}
-		<a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{.locale.Tr "user.change_avatar"}}">
+		<a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{ctx.Locale.Tr "user.change_avatar"}}">
 			{{/* the size doesn't take affect (and no need to take affect), image size(width) should be controlled by the parent container since this is not a flex layout*/}}
 			{{ctx.AvatarUtils.Avatar .ContextUser 256}}
 		</a>
@@ -15,9 +15,9 @@
 		{{if .ContextUser.FullName}}<span class="header text center">{{.ContextUser.FullName}}</span>{{end}}
 		<span class="username text center">{{.ContextUser.Name}}</span>
 		<div class="gt-mt-3">
-			<a class="muted" href="{{.ContextUser.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{.locale.Tr "user.followers"}}</a> · <a class="muted" href="{{.ContextUser.HomeLink}}?tab=following">{{.NumFollowing}} {{.locale.Tr "user.following"}}</a>
+			<a class="muted" href="{{.ContextUser.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{ctx.Locale.Tr "user.followers"}}</a> · <a class="muted" href="{{.ContextUser.HomeLink}}?tab=following">{{.NumFollowing}} {{ctx.Locale.Tr "user.following"}}</a>
 			{{if .EnableFeed}}
-				<a href="{{.ContextUser.HomeLink}}.rss"><i class="ui text grey gt-ml-3" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a>
+				<a href="{{.ContextUser.HomeLink}}.rss"><i class="ui text grey gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a>
 			{{end}}
 		</div>
 	</div>
@@ -29,7 +29,7 @@
 					<span class="gt-f1">{{.ContextUser.Location}}</span>
 					{{if .UserLocationMapURL}}
 						{{/* We presume that the UserLocationMapURL is safe, as it is provided by the site administrator. */}}
-						<a href="{{.UserLocationMapURL | Safe}}{{.ContextUser.Location | QueryEscape}}" rel="nofollow noreferrer" data-tooltip-content="{{.locale.Tr "user.show_on_map"}}">
+						<a href="{{.UserLocationMapURL | Safe}}{{.ContextUser.Location | QueryEscape}}" rel="nofollow noreferrer" data-tooltip-content="{{ctx.Locale.Tr "user.show_on_map"}}">
 							{{svg "octicon-link-external"}}
 						</a>
 					{{end}}
@@ -41,11 +41,11 @@
 					<a class="gt-f1" href="mailto:{{.ContextUser.Email}}" rel="nofollow">{{.ContextUser.Email}}</a>
 					<a href="{{AppSubUrl}}/user/settings#privacy-user-settings">
 						{{if .ShowUserEmail}}
-							<i data-tooltip-content="{{.locale.Tr "user.email_visibility.limited"}}">
+							<i data-tooltip-content="{{ctx.Locale.Tr "user.email_visibility.limited"}}">
 								{{svg "octicon-unlock"}}
 							</i>
 						{{else}}
-							<i data-tooltip-content="{{.locale.Tr "user.email_visibility.private"}}">
+							<i data-tooltip-content="{{ctx.Locale.Tr "user.email_visibility.private"}}">
 								{{svg "octicon-lock"}}
 							</i>
 						{{end}}
@@ -78,7 +78,7 @@
 					</li>
 				{{end}}
 			{{end}}
-			<li>{{svg "octicon-calendar"}} <span>{{.locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix) | Safe}}</span></li>
+			<li>{{svg "octicon-calendar"}} <span>{{ctx.Locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix) | Safe}}</span></li>
 			{{if and .Orgs .HasOrgsVisible}}
 			<li>
 				<ul class="user-orgs">
@@ -109,11 +109,11 @@
 			<li class="follow">
 				{{if $.IsFollowing}}
 					<button class="ui basic red button link-action" data-url="{{.ContextUser.HomeLink}}?action=unfollow">
-						{{svg "octicon-person"}} {{.locale.Tr "user.unfollow"}}
+						{{svg "octicon-person"}} {{ctx.Locale.Tr "user.unfollow"}}
 					</button>
 				{{else}}
 					<button class="ui basic primary button link-action" data-url="{{.ContextUser.HomeLink}}?action=follow">
-						{{svg "octicon-person"}} {{.locale.Tr "user.follow"}}
+						{{svg "octicon-person"}} {{ctx.Locale.Tr "user.follow"}}
 					</button>
 				{{end}}
 			</li>
diff --git a/templates/shared/variables/variable_list.tmpl b/templates/shared/variables/variable_list.tmpl
index d3fcec63d7..790e270417 100644
--- a/templates/shared/variables/variable_list.tmpl
+++ b/templates/shared/variables/variable_list.tmpl
@@ -1,14 +1,14 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "actions.variables.management"}}
+	{{ctx.Locale.Tr "actions.variables.management"}}
 	<div class="ui right">
 		<button class="ui primary tiny button show-modal"
 			data-modal="#edit-variable-modal"
 			data-modal-form.action="{{.Link}}/new"
-			data-modal-header="{{.locale.Tr "actions.variables.creation"}}"
+			data-modal-header="{{ctx.Locale.Tr "actions.variables.creation"}}"
 			data-modal-dialog-variable-name=""
 			data-modal-dialog-variable-data=""
 		>
-			{{.locale.Tr "actions.variables.creation"}}
+			{{ctx.Locale.Tr "actions.variables.creation"}}
 		</button>
 	</div>
 </h4>
@@ -30,22 +30,22 @@
 			</div>
 			<div class="flex-item-trailing">
 				<span class="color-text-light-2">
-					{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}}
+					{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}}
 				</span>
 				<button class="btn interact-bg gt-p-3 show-modal"
-					data-tooltip-content="{{$.locale.Tr "variables.edit"}}"
+					data-tooltip-content="{{ctx.Locale.Tr "variables.edit"}}"
 					data-modal="#edit-variable-modal"
 					data-modal-form.action="{{$.Link}}/{{.ID}}/edit"
-					data-modal-header="{{$.locale.Tr "actions.variables.edit"}}"
+					data-modal-header="{{ctx.Locale.Tr "actions.variables.edit"}}"
 					data-modal-dialog-variable-name="{{.Name}}"
 					data-modal-dialog-variable-data="{{.Data}}"
 				>
 					{{svg "octicon-pencil"}}
 				</button>
 				<button class="btn interact-bg gt-p-3 link-action"
-					data-tooltip-content="{{$.locale.Tr "actions.variables.deletion"}}"
+					data-tooltip-content="{{ctx.Locale.Tr "actions.variables.deletion"}}"
 					data-url="{{$.Link}}/{{.ID}}/delete"
-					data-modal-confirm="{{$.locale.Tr "actions.variables.deletion.description"}}"
+					data-modal-confirm="{{ctx.Locale.Tr "actions.variables.deletion.description"}}"
 				>
 					{{svg "octicon-trash"}}
 				</button>
@@ -54,7 +54,7 @@
 		{{end}}
 	</div>
 	{{else}}
-		{{.locale.Tr "actions.variables.none"}}
+		{{ctx.Locale.Tr "actions.variables.none"}}
 	{{end}}
 </div>
 
@@ -65,24 +65,24 @@
 		<div class="content">
 			{{.CsrfTokenHtml}}
 			<div class="field">
-				{{.locale.Tr "actions.variables.description"}}
+				{{ctx.Locale.Tr "actions.variables.description"}}
 			</div>
 			<div class="field">
-				<label for="dialog-variable-name">{{.locale.Tr "name"}}</label>
+				<label for="dialog-variable-name">{{ctx.Locale.Tr "name"}}</label>
 				<input autofocus required
 					name="name"
 					id="dialog-variable-name"
 					value="{{.name}}"
 					pattern="^(?!GITEA_|GITHUB_)[a-zA-Z_][a-zA-Z0-9_]*$"
-					placeholder="{{.locale.Tr "secrets.creation.name_placeholder"}}"
+					placeholder="{{ctx.Locale.Tr "secrets.creation.name_placeholder"}}"
 				>
 			</div>
 			<div class="field">
-				<label for="dialog-variable-data">{{.locale.Tr "value"}}</label>
+				<label for="dialog-variable-data">{{ctx.Locale.Tr "value"}}</label>
 				<textarea required
 					name="data"
 					id="dialog-variable-data"
-					placeholder="{{.locale.Tr "secrets.creation.value_placeholder"}}"
+					placeholder="{{ctx.Locale.Tr "secrets.creation.value_placeholder"}}"
 				></textarea>
 			</div>
 		</div>
diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl
index 382f22520b..8e63b30522 100644
--- a/templates/status/404.tmpl
+++ b/templates/status/404.tmpl
@@ -5,8 +5,8 @@
 		<p style="margin-top: 100px"><img src="{{AssetUrlPrefix}}/img/404.png" alt="404"></p>
 		<div class="divider"></div>
 		<br>
-		<p>{{.locale.Tr "error404" | Safe}}</p>
-		{{if .ShowFooterVersion}}<p>{{.locale.Tr "admin.config.app_ver"}}: {{AppVer}}</p>{{end}}
+		<p>{{ctx.Locale.Tr "error404" | Safe}}</p>
+		{{if .ShowFooterVersion}}<p>{{ctx.Locale.Tr "admin.config.app_ver"}}: {{AppVer}}</p>{{end}}
 	</div>
 </div>
 {{template "base/footer" .}}
diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl
index e2324f9b5b..9935ab9c5a 100644
--- a/templates/swagger/ui.tmpl
+++ b/templates/swagger/ui.tmpl
@@ -5,7 +5,7 @@
 		<link href="{{AssetUrlPrefix}}/css/swagger.css?v={{AssetVersion}}" rel="stylesheet">
 	</head>
 	<body>
-		<a class="swagger-back-link" href="{{AppSubUrl}}/">{{svg "octicon-reply"}}{{.locale.Tr "return_to_gitea"}}</a>
+		<a class="swagger-back-link" href="{{AppSubUrl}}/">{{svg "octicon-reply"}}{{ctx.Locale.Tr "return_to_gitea"}}</a>
 		<div id="swagger-ui" data-source="{{AppSubUrl}}/swagger.{{.APIJSONVersion}}.json"></div>
 		<script src="{{AssetUrlPrefix}}/js/swagger.js?v={{AssetVersion}}"></script>
 	</body>
diff --git a/templates/user/auth/activate.tmpl b/templates/user/auth/activate.tmpl
index 3261836ee0..1b06719753 100644
--- a/templates/user/auth/activate.tmpl
+++ b/templates/user/auth/activate.tmpl
@@ -5,42 +5,42 @@
 			<form class="ui form ignore-dirty" action="{{AppSubUrl}}/user/activate" method="post">
 				{{.CsrfTokenHtml}}
 				<h2 class="ui top attached header">
-					{{.locale.Tr "auth.active_your_account"}}
+					{{ctx.Locale.Tr "auth.active_your_account"}}
 				</h2>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					{{if .IsActivatePage}}
 						{{if .ServiceNotEnabled}}
-							<p class="center">{{.locale.Tr "auth.disable_register_mail"}}</p>
+							<p class="center">{{ctx.Locale.Tr "auth.disable_register_mail"}}</p>
 						{{else if .ResendLimited}}
-							<p class="center">{{.locale.Tr "auth.resent_limit_prompt"}}</p>
+							<p class="center">{{ctx.Locale.Tr "auth.resent_limit_prompt"}}</p>
 						{{else}}
-							<p>{{.locale.Tr "auth.confirmation_mail_sent_prompt" (.SignedUser.Email|Escape) .ActiveCodeLives | Str2html}}</p>
+							<p>{{ctx.Locale.Tr "auth.confirmation_mail_sent_prompt" (.SignedUser.Email|Escape) .ActiveCodeLives | Str2html}}</p>
 						{{end}}
 					{{else}}
 						{{if .NeedsPassword}}
 							<div class="required inline field">
-								<label for="password">{{.locale.Tr "password"}}</label>
+								<label for="password">{{ctx.Locale.Tr "password"}}</label>
 								<input id="password" name="password" type="password" autocomplete="off" required>
 							</div>
 							<div class="inline field">
 								<label></label>
-								<button class="ui primary button">{{.locale.Tr "install.confirm_password"}}</button>
+								<button class="ui primary button">{{ctx.Locale.Tr "install.confirm_password"}}</button>
 							</div>
 							<input id="code" name="code" type="hidden" value="{{.Code}}">
 						{{else if .IsSendRegisterMail}}
-							<p>{{.locale.Tr "auth.confirmation_mail_sent_prompt" (.Email|Escape) .ActiveCodeLives | Str2html}}</p>
+							<p>{{ctx.Locale.Tr "auth.confirmation_mail_sent_prompt" (.Email|Escape) .ActiveCodeLives | Str2html}}</p>
 						{{else if .IsCodeInvalid}}
-							<p>{{.locale.Tr "auth.invalid_code"}}</p>
+							<p>{{ctx.Locale.Tr "auth.invalid_code"}}</p>
 						{{else if .IsPasswordInvalid}}
-							<p>{{.locale.Tr "auth.invalid_password"}}</p>
+							<p>{{ctx.Locale.Tr "auth.invalid_password"}}</p>
 						{{else if .ManualActivationOnly}}
-							<p class="center">{{.locale.Tr "auth.manual_activation_only"}}</p>
+							<p class="center">{{ctx.Locale.Tr "auth.manual_activation_only"}}</p>
 						{{else}}
-							<p>{{.locale.Tr "auth.has_unconfirmed_mail" (.SignedUser.Name|Escape) (.SignedUser.Email|Escape) | Str2html}}</p>
+							<p>{{ctx.Locale.Tr "auth.has_unconfirmed_mail" (.SignedUser.Name|Escape) (.SignedUser.Email|Escape) | Str2html}}</p>
 							<div class="divider"></div>
 							<div class="text right">
-								<button class="ui primary button">{{.locale.Tr "auth.resend_mail"}}</button>
+								<button class="ui primary button">{{ctx.Locale.Tr "auth.resend_mail"}}</button>
 							</div>
 						{{end}}
 					{{end}}
diff --git a/templates/user/auth/captcha.tmpl b/templates/user/auth/captcha.tmpl
index f864aa1d37..c4e58d0134 100644
--- a/templates/user/auth/captcha.tmpl
+++ b/templates/user/auth/captcha.tmpl
@@ -4,7 +4,7 @@
 		{{.Captcha.CreateHTML}}
 	</div>
 	<div class="required inline field {{if .Err_Captcha}}error{{end}}">
-		<label for="captcha">{{.locale.Tr "captcha"}}</label>
+		<label for="captcha">{{ctx.Locale.Tr "captcha"}}</label>
 		<input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
 	</div>
 {{else if eq .CaptchaType "recaptcha"}}
diff --git a/templates/user/auth/change_passwd_inner.tmpl b/templates/user/auth/change_passwd_inner.tmpl
index 317a031f6b..cffc798a64 100644
--- a/templates/user/auth/change_passwd_inner.tmpl
+++ b/templates/user/auth/change_passwd_inner.tmpl
@@ -2,22 +2,22 @@
 		{{template "base/alert" .}}
 		{{end}}
 		<h4 class="ui top attached header center">
-			{{.locale.Tr "settings.change_password"}}
+			{{ctx.Locale.Tr "settings.change_password"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="{{.ChangePasscodeLink}}" method="post">
 			{{.CsrfTokenHtml}}
 			<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
-				<label for="password">{{.locale.Tr "password"}}</label>
+				<label for="password">{{ctx.Locale.Tr "password"}}</label>
 				<input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" required>
 			</div>
 			<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
-				<label for="retype">{{.locale.Tr "re_type"}}</label>
+				<label for="retype">{{ctx.Locale.Tr "re_type"}}</label>
 				<input id="retype" name="retype" type="password" autocomplete="new-password" required>
 			</div>
 			<div class="inline field">
 				<label></label>
-				<button class="ui primary button">{{.locale.Tr "settings.change_password"}}</button>
+				<button class="ui primary button">{{ctx.Locale.Tr "settings.change_password"}}</button>
 			</div>
 			</form>
 		</div>
diff --git a/templates/user/auth/finalize_openid.tmpl b/templates/user/auth/finalize_openid.tmpl
index e81a565507..7449e3beda 100644
--- a/templates/user/auth/finalize_openid.tmpl
+++ b/templates/user/auth/finalize_openid.tmpl
@@ -6,36 +6,36 @@
 			<div class="twelve wide column content">
 				{{template "base/alert" .}}
 				<h4 class="ui top attached header">
-					{{.locale.Tr "auth.login_userpass"}}
+					{{ctx.Locale.Tr "auth.login_userpass"}}
 				</h4>
 				<div class="ui attached segment">
 					<form class="ui form" action="{{.Link}}" method="post">
 					{{.CsrfTokenHtml}}
 					<div class="required inline field {{if .Err_UserName}}error{{end}}">
-						<label for="user_name">{{.locale.Tr "home.uname_holder"}}</label>
+						<label for="user_name">{{ctx.Locale.Tr "home.uname_holder"}}</label>
 						<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
 					</div>
 					<div class="required inline field {{if .Err_Password}}error{{end}}">
-						<label for="password">{{.locale.Tr "password"}}</label>
+						<label for="password">{{ctx.Locale.Tr "password"}}</label>
 						<input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" required>
 					</div>
 					<div class="inline field">
 						<label></label>
 						<div class="ui checkbox">
-							<label>{{.locale.Tr "auth.remember_me"}}</label>
+							<label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
 							<input name="remember" type="checkbox">
 						</div>
 					</div>
 
 					<div class="inline field">
 						<label></label>
-						<button class="ui primary button">{{.locale.Tr "sign_in"}}</button>
-						<a href="{{AppSubUrl}}/user/forget_password">{{.locale.Tr "auth.forget_password"}}</a>
+						<button class="ui primary button">{{ctx.Locale.Tr "sign_in"}}</button>
+						<a href="{{AppSubUrl}}/user/forget_password">{{ctx.Locale.Tr "auth.forget_password"}}</a>
 					</div>
 					{{if .ShowRegistrationButton}}
 						<div class="inline field">
 							<label></label>
-							<a href="{{AppSubUrl}}/user/sign_up">{{.locale.Tr "auth.sign_up_now" | Str2html}}</a>
+							<a href="{{AppSubUrl}}/user/sign_up">{{ctx.Locale.Tr "auth.sign_up_now" | Str2html}}</a>
 						</div>
 					{{end}}
 					</form>
diff --git a/templates/user/auth/forgot_passwd.tmpl b/templates/user/auth/forgot_passwd.tmpl
index 38d15c20d3..dde4c8f6fe 100644
--- a/templates/user/auth/forgot_passwd.tmpl
+++ b/templates/user/auth/forgot_passwd.tmpl
@@ -5,32 +5,32 @@
 			<form class="ui form ignore-dirty" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h2 class="ui top attached header">
-					{{.locale.Tr "auth.forgot_password_title"}}
+					{{ctx.Locale.Tr "auth.forgot_password_title"}}
 				</h2>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					{{if .IsResetSent}}
-						<p>{{.locale.Tr "auth.reset_password_mail_sent_prompt" (Escape .Email) .ResetPwdCodeLives | Str2html}}</p>
+						<p>{{ctx.Locale.Tr "auth.reset_password_mail_sent_prompt" (Escape .Email) .ResetPwdCodeLives | Str2html}}</p>
 					{{else if .IsResetRequest}}
 						<div class="required inline field {{if .Err_Email}}error{{end}}">
-							<label for="email">{{.locale.Tr "email"}}</label>
+							<label for="email">{{ctx.Locale.Tr "email"}}</label>
 							<input id="email" name="email" type="email"  value="{{.Email}}" autofocus required>
 						</div>
 						<div class="divider"></div>
 						<div class="inline field">
 							<label></label>
-							<button class="ui primary button">{{.locale.Tr "auth.send_reset_mail"}}</button>
+							<button class="ui primary button">{{ctx.Locale.Tr "auth.send_reset_mail"}}</button>
 						</div>
 					{{else if .IsResetDisable}}
 						<p class="center">
 							{{if $.IsAdmin}}
-								{{.locale.Tr "auth.disable_forgot_password_mail_admin"}}
+								{{ctx.Locale.Tr "auth.disable_forgot_password_mail_admin"}}
 							{{else}}
-								{{.locale.Tr "auth.disable_forgot_password_mail"}}
+								{{ctx.Locale.Tr "auth.disable_forgot_password_mail"}}
 							{{end}}
 						</p>
 					{{else if .ResendLimited}}
-						<p class="center">{{.locale.Tr "auth.resent_limit_prompt"}}</p>
+						<p class="center">{{ctx.Locale.Tr "auth.resent_limit_prompt"}}</p>
 					{{end}}
 				</div>
 			</form>
diff --git a/templates/user/auth/grant.tmpl b/templates/user/auth/grant.tmpl
index 28c5740be0..9c0bf33e28 100644
--- a/templates/user/auth/grant.tmpl
+++ b/templates/user/auth/grant.tmpl
@@ -3,17 +3,17 @@
 	<div class="column seven wide">
 		<div class="ui middle centered raised segments">
 			<h3 class="ui top attached header">
-				{{.locale.Tr "auth.authorize_title" .Application.Name}}
+				{{ctx.Locale.Tr "auth.authorize_title" .Application.Name}}
 			</h3>
 			<div class="ui attached segment">
 				{{template "base/alert" .}}
 				<p>
-					<b>{{.locale.Tr "auth.authorize_application_description"}}</b><br>
-					{{.locale.Tr "auth.authorize_application_created_by" .ApplicationCreatorLinkHTML | Str2html}}
+					<b>{{ctx.Locale.Tr "auth.authorize_application_description"}}</b><br>
+					{{ctx.Locale.Tr "auth.authorize_application_created_by" .ApplicationCreatorLinkHTML | Str2html}}
 				</p>
 			</div>
 			<div class="ui attached segment">
-				<p>{{.locale.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}</p>
+				<p>{{ctx.Locale.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}</p>
 			</div>
 			<div class="ui attached segment">
 				<form method="post" action="{{AppSubUrl}}/login/oauth/grant">
@@ -23,7 +23,7 @@
 					<input type="hidden" name="scope" value="{{.Scope}}">
 					<input type="hidden" name="nonce" value="{{.Nonce}}">
 					<input type="hidden" name="redirect_uri" value="{{.RedirectURI}}">
-					<button type="submit" id="authorize-app" value="{{.locale.Tr "auth.authorize_application"}}" class="ui red inline button">{{.locale.Tr "auth.authorize_application"}}</button>
+					<button type="submit" id="authorize-app" value="{{ctx.Locale.Tr "auth.authorize_application"}}" class="ui red inline button">{{ctx.Locale.Tr "auth.authorize_application"}}</button>
 					<a href="{{.RedirectURI}}" class="ui basic primary inline button">Cancel</a>
 				</form>
 			</div>
diff --git a/templates/user/auth/grant_error.tmpl b/templates/user/auth/grant_error.tmpl
index cfb7e8663b..b2e077960c 100644
--- a/templates/user/auth/grant_error.tmpl
+++ b/templates/user/auth/grant_error.tmpl
@@ -4,11 +4,11 @@
 	<div class="column seven wide">
 		<div class="ui middle centered raised segments">
 			<h1 class="ui top attached header">
-				{{.locale.Tr "auth.authorization_failed"}}
+				{{ctx.Locale.Tr "auth.authorization_failed"}}
 			</h1>
 			<h3 class="ui attached segment">{{.Error.ErrorDescription}}</h3>
 			<div class="ui attached segment">
-				<p>{{.locale.Tr "auth.authorization_failed_desc"}}</p>
+				<p>{{ctx.Locale.Tr "auth.authorization_failed_desc"}}</p>
 			</div>
 		</div>
 	</div>
diff --git a/templates/user/auth/link_account.tmpl b/templates/user/auth/link_account.tmpl
index 1e059f6814..5235cbf69f 100644
--- a/templates/user/auth/link_account.tmpl
+++ b/templates/user/auth/link_account.tmpl
@@ -6,12 +6,12 @@
 			{{if not .AllowOnlyInternalRegistration}}
 				<a class="item {{if not .user_exists}}active{{end}}"
 					data-tab="auth-link-signup-tab">
-					{{.locale.Tr "auth.oauth_signup_tab"}}
+					{{ctx.Locale.Tr "auth.oauth_signup_tab"}}
 				</a>
 			{{end}}
 			<a class="item {{if .user_exists}}active{{end}}"
 				data-tab="auth-link-signin-tab">
-				{{.locale.Tr "auth.oauth_signin_tab"}}
+				{{ctx.Locale.Tr "auth.oauth_signin_tab"}}
 			</a>
 		</div>
 	</div>
diff --git a/templates/user/auth/prohibit_login.tmpl b/templates/user/auth/prohibit_login.tmpl
index ddb16a7f26..668aa20e71 100644
--- a/templates/user/auth/prohibit_login.tmpl
+++ b/templates/user/auth/prohibit_login.tmpl
@@ -4,10 +4,10 @@
 		<div class="column">
 			<form class="ui form">
 				<h2 class="ui top attached header">
-					{{.locale.Tr "auth.prohibit_login"}}
+					{{ctx.Locale.Tr "auth.prohibit_login"}}
 				</h2>
 				<div class="ui attached segment">
-					<p>{{.locale.Tr "auth.prohibit_login_desc"}}</p>
+					<p>{{ctx.Locale.Tr "auth.prohibit_login_desc"}}</p>
 				</div>
 			</form>
 		</div>
diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl
index d7734bc57f..2f470df441 100644
--- a/templates/user/auth/reset_passwd.tmpl
+++ b/templates/user/auth/reset_passwd.tmpl
@@ -6,44 +6,44 @@
 				{{.CsrfTokenHtml}}
 				<input name="code" type="hidden" value="{{.Code}}">
 				<h2 class="ui top attached header">
-					{{.locale.Tr "auth.reset_password"}}
+					{{ctx.Locale.Tr "auth.reset_password"}}
 				</h2>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					{{if .user_email}}
 						<div class="inline field">
-							<label for="user_name">{{.locale.Tr "email"}}</label>
+							<label for="user_name">{{ctx.Locale.Tr "email"}}</label>
 							<input id="user_name" type="text" value="{{.user_email}}" disabled>
 						</div>
 					{{end}}
 					{{if .IsResetForm}}
 						<div class="required inline field {{if .Err_Password}}error{{end}}">
-							<label for="password">{{.locale.Tr "settings.new_password"}}</label>
+							<label for="password">{{ctx.Locale.Tr "settings.new_password"}}</label>
 							<input id="password" name="password" type="password"  value="{{.password}}" autocomplete="new-password" autofocus required>
 						</div>
 						{{if not .user_signed_in}}
 						<div class="inline field">
 							<label></label>
 							<div class="ui checkbox">
-								<label>{{.locale.Tr "auth.remember_me"}}</label>
+								<label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
 								<input name="remember" type="checkbox">
 							</div>
 						</div>
 						{{end}}
 						{{if .has_two_factor}}
 						<h4 class="ui dividing header">
-							{{.locale.Tr "twofa"}}
+							{{ctx.Locale.Tr "twofa"}}
 						</h4>
-						<div class="ui warning visible message">{{.locale.Tr "settings.twofa_is_enrolled" | Str2html}}</div>
+						<div class="ui warning visible message">{{ctx.Locale.Tr "settings.twofa_is_enrolled" | Str2html}}</div>
 						{{if .scratch_code}}
 						<div class="required inline field {{if .Err_Token}}error{{end}}">
-							<label for="token">{{.locale.Tr "auth.scratch_code"}}</label>
+							<label for="token">{{ctx.Locale.Tr "auth.scratch_code"}}</label>
 							<input id="token" name="token" type="text" autocomplete="off" autofocus required>
 						</div>
 						<input type="hidden" name="scratch_code" value="true">
 						{{else}}
 						<div class="required inline field {{if .Err_Passcode}}error{{end}}">
-							<label for="passcode">{{.locale.Tr "passcode"}}</label>
+							<label for="passcode">{{ctx.Locale.Tr "passcode"}}</label>
 							<input id="passcode" name="passcode" type="number" autocomplete="off" autofocus required>
 						</div>
 						{{end}}
@@ -51,13 +51,13 @@
 						<div class="divider"></div>
 						<div class="inline field">
 							<label></label>
-							<button class="ui primary button">{{.locale.Tr "auth.reset_password_helper"}}</button>
+							<button class="ui primary button">{{ctx.Locale.Tr "auth.reset_password_helper"}}</button>
 							{{if and .has_two_factor (not .scratch_code)}}
-								<a href="{{.Link}}?code={{.Code}}&amp;scratch_code=true">{{.locale.Tr "auth.use_scratch_code" | Str2html}}</a>
+								<a href="{{.Link}}?code={{.Code}}&amp;scratch_code=true">{{ctx.Locale.Tr "auth.use_scratch_code" | Str2html}}</a>
 							{{end}}
 						</div>
 					{{else}}
-						<p class="center">{{.locale.Tr "auth.invalid_code_forgot_password" (printf "%s/user/forgot_password" AppSubUrl) | Str2html}}</p>
+						<p class="center">{{ctx.Locale.Tr "auth.invalid_code_forgot_password" (printf "%s/user/forgot_password" AppSubUrl) | Str2html}}</p>
 					{{end}}
 				</div>
 			</form>
diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl
index 2b72f119cb..f38b0a2608 100644
--- a/templates/user/auth/signin_inner.tmpl
+++ b/templates/user/auth/signin_inner.tmpl
@@ -3,21 +3,21 @@
 {{end}}
 <h4 class="ui top attached header center">
 	{{if .LinkAccountMode}}
-		{{.locale.Tr "auth.oauth_signin_title"}}
+		{{ctx.Locale.Tr "auth.oauth_signin_title"}}
 	{{else}}
-		{{.locale.Tr "auth.login_userpass"}}
+		{{ctx.Locale.Tr "auth.login_userpass"}}
 	{{end}}
 </h4>
 <div class="ui attached segment">
 	<form class="ui form" action="{{.SignInLink}}" method="post">
 	{{.CsrfTokenHtml}}
 	<div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
-		<label for="user_name">{{.locale.Tr "home.uname_holder"}}</label>
+		<label for="user_name">{{ctx.Locale.Tr "home.uname_holder"}}</label>
 		<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
 	</div>
 	{{if or (not .DisablePassword) .LinkAccountMode}}
 	<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
-		<label for="password">{{.locale.Tr "password"}}</label>
+		<label for="password">{{ctx.Locale.Tr "password"}}</label>
 		<input id="password" name="password" type="password" value="{{.password}}" autocomplete="current-password" required>
 	</div>
 	{{end}}
@@ -25,7 +25,7 @@
 	<div class="inline field">
 		<label></label>
 		<div class="ui checkbox">
-			<label>{{.locale.Tr "auth.remember_me"}}</label>
+			<label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
 			<input name="remember" type="checkbox">
 		</div>
 	</div>
@@ -37,24 +37,24 @@
 		<label></label>
 		<button class="ui primary button">
 			{{if .LinkAccountMode}}
-				{{.locale.Tr "auth.oauth_signin_submit"}}
+				{{ctx.Locale.Tr "auth.oauth_signin_submit"}}
 			{{else}}
-				{{.locale.Tr "sign_in"}}
+				{{ctx.Locale.Tr "sign_in"}}
 			{{end}}
 		</button>
-		<a href="{{AppSubUrl}}/user/forgot_password">{{.locale.Tr "auth.forgot_password"}}</a>
+		<a href="{{AppSubUrl}}/user/forgot_password">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
 	</div>
 
 	{{if .ShowRegistrationButton}}
 		<div class="inline field">
 			<label></label>
-			<a href="{{AppSubUrl}}/user/sign_up">{{.locale.Tr "auth.sign_up_now" | Str2html}}</a>
+			<a href="{{AppSubUrl}}/user/sign_up">{{ctx.Locale.Tr "auth.sign_up_now" | Str2html}}</a>
 		</div>
 	{{end}}
 
 	{{if and .OrderedOAuth2Names .OAuth2Providers}}
 	<div class="divider divider-text">
-		{{.locale.Tr "sign_in_or"}}
+		{{ctx.Locale.Tr "sign_in_or"}}
 	</div>
 	<div id="oauth2-login-navigator" class="gt-py-2">
 		<div class="gt-df gt-fc gt-jc">
@@ -63,7 +63,7 @@
 					{{$provider := index $.OAuth2Providers $key}}
 					<a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
 						{{$provider.IconHTML 28}}
-						{{$.locale.Tr "sign_in_with_provider" $provider.DisplayName}}
+						{{ctx.Locale.Tr "sign_in_with_provider" $provider.DisplayName}}
 					</a>
 				{{end}}
 			</div>
diff --git a/templates/user/auth/signin_navbar.tmpl b/templates/user/auth/signin_navbar.tmpl
index 84574aa2c2..bc7fd03e13 100644
--- a/templates/user/auth/signin_navbar.tmpl
+++ b/templates/user/auth/signin_navbar.tmpl
@@ -2,10 +2,10 @@
 <div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
 	<div class="new-menu-inner">
 		<a class="{{if .PageIsLogin}}active {{end}}item" rel="nofollow" href="{{AppSubUrl}}/user/login">
-			{{.locale.Tr "auth.login_userpass"}}
+			{{ctx.Locale.Tr "auth.login_userpass"}}
 		</a>
 		<a class="{{if .PageIsSignUp}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/sign_up">
-			{{.locale.Tr "auth.create_new_account"}}
+			{{ctx.Locale.Tr "auth.create_new_account"}}
 		</a>
 		{{if .EnableOpenIDSignIn}}
 		<a class="{{if .PageIsLoginOpenID}}active {{end}}item" rel="nofollow" href="{{AppSubUrl}}/user/login/openid">
diff --git a/templates/user/auth/signin_openid.tmpl b/templates/user/auth/signin_openid.tmpl
index e1017dca28..0428026aa8 100644
--- a/templates/user/auth/signin_openid.tmpl
+++ b/templates/user/auth/signin_openid.tmpl
@@ -11,7 +11,7 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 			{{.CsrfTokenHtml}}
 			<div class="inline field">
-				{{.locale.Tr "auth.openid_signin_desc"}}
+				{{ctx.Locale.Tr "auth.openid_signin_desc"}}
 			</div>
 			<div class="required inline field {{if .Err_OpenID}}error{{end}}">
 				<label for="openid">
@@ -23,13 +23,13 @@
 			<div class="inline field">
 				<label></label>
 				<div class="ui checkbox">
-					<label>{{.locale.Tr "auth.remember_me"}}</label>
+					<label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
 					<input name="remember" type="checkbox">
 				</div>
 			</div>
 			<div class="inline field">
 				<label></label>
-				<button class="ui primary button">{{.locale.Tr "sign_in"}}</button>
+				<button class="ui primary button">{{ctx.Locale.Tr "sign_in"}}</button>
 			</div>
 			</form>
 		</div>
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl
index e3dd337837..068ccbc618 100644
--- a/templates/user/auth/signup_inner.tmpl
+++ b/templates/user/auth/signup_inner.tmpl
@@ -1,9 +1,9 @@
 <div class="ui container column fluid{{if .LinkAccountMode}} icon{{end}}">
 	<h4 class="ui top attached header center">
 		{{if .LinkAccountMode}}
-			{{.locale.Tr "auth.oauth_signup_title"}}
+			{{ctx.Locale.Tr "auth.oauth_signup_title"}}
 		{{else}}
-			{{.locale.Tr "sign_up"}}
+			{{ctx.Locale.Tr "sign_up"}}
 		{{end}}
 	</h4>
 	<div class="ui attached segment">
@@ -13,24 +13,24 @@
 			{{template "base/alert" .}}
 			{{end}}
 			{{if .DisableRegistration}}
-				<p>{{.locale.Tr "auth.disable_register_prompt"}}</p>
+				<p>{{ctx.Locale.Tr "auth.disable_register_prompt"}}</p>
 			{{else}}
 				<div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
-					<label for="user_name">{{.locale.Tr "username"}}</label>
+					<label for="user_name">{{ctx.Locale.Tr "username"}}</label>
 					<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
 				</div>
 				<div class="required inline field {{if .Err_Email}}error{{end}}">
-					<label for="email">{{.locale.Tr "email"}}</label>
+					<label for="email">{{ctx.Locale.Tr "email"}}</label>
 					<input id="email" name="email" type="email" value="{{.email}}" required>
 				</div>
 
 				{{if not .DisablePassword}}
 					<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
-						<label for="password">{{.locale.Tr "password"}}</label>
+						<label for="password">{{ctx.Locale.Tr "password"}}</label>
 						<input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" required>
 					</div>
 					<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
-						<label for="retype">{{.locale.Tr "re_type"}}</label>
+						<label for="retype">{{ctx.Locale.Tr "re_type"}}</label>
 						<input id="retype" name="retype" type="password" value="{{.retype}}" autocomplete="new-password" required>
 					</div>
 				{{end}}
@@ -41,9 +41,9 @@
 					<label></label>
 					<button class="ui primary button">
 						{{if .LinkAccountMode}}
-							{{.locale.Tr "auth.oauth_signup_submit"}}
+							{{ctx.Locale.Tr "auth.oauth_signup_submit"}}
 						{{else}}
-							{{.locale.Tr "auth.create_new_account"}}
+							{{ctx.Locale.Tr "auth.create_new_account"}}
 						{{end}}
 					</button>
 				</div>
@@ -51,14 +51,14 @@
 				{{if not .LinkAccountMode}}
 				<div class="inline field">
 					<label></label>
-					<a href="{{AppSubUrl}}/user/login">{{.locale.Tr "auth.register_helper_msg"}}</a>
+					<a href="{{AppSubUrl}}/user/login">{{ctx.Locale.Tr "auth.register_helper_msg"}}</a>
 				</div>
 				{{end}}
 			{{end}}
 
 			{{if and .OrderedOAuth2Names .OAuth2Providers}}
 			<div class="divider divider-text">
-				{{.locale.Tr "sign_in_or"}}
+				{{ctx.Locale.Tr "sign_in_or"}}
 			</div>
 			<div id="oauth2-login-navigator" class="gt-py-2">
 				<div class="gt-df gt-fc gt-jc">
@@ -67,7 +67,7 @@
 							{{$provider := index $.OAuth2Providers $key}}
 							<a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
 								{{$provider.IconHTML 28}}
-								{{$.locale.Tr "sign_in_with_provider" $provider.DisplayName}}
+								{{ctx.Locale.Tr "sign_in_with_provider" $provider.DisplayName}}
 							</a>
 						{{end}}
 					</div>
diff --git a/templates/user/auth/signup_openid_connect.tmpl b/templates/user/auth/signup_openid_connect.tmpl
index 1a470415c6..e4b7936374 100644
--- a/templates/user/auth/signup_openid_connect.tmpl
+++ b/templates/user/auth/signup_openid_connect.tmpl
@@ -4,20 +4,20 @@
 	<div class="ui container">
 				{{template "base/alert" .}}
 				<h4 class="ui top attached header">
-					{{.locale.Tr "auth.openid_connect_title"}}
+					{{ctx.Locale.Tr "auth.openid_connect_title"}}
 				</h4>
 				<div class="ui attached segment">
 					<p>
-						{{.locale.Tr "auth.openid_connect_desc"}}
+						{{ctx.Locale.Tr "auth.openid_connect_desc"}}
 					</p>
 					<form class="ui form" action="{{.Link}}" method="post">
 					{{.CsrfTokenHtml}}
 					<div class="required inline field {{if .Err_UserName}}error{{end}}">
-						<label for="user_name">{{.locale.Tr "home.uname_holder"}}</label>
+						<label for="user_name">{{ctx.Locale.Tr "home.uname_holder"}}</label>
 						<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
 					</div>
 					<div class="required inline field {{if .Err_Password}}error{{end}}">
-						<label for="password">{{.locale.Tr "password"}}</label>
+						<label for="password">{{ctx.Locale.Tr "password"}}</label>
 						<input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" required>
 					</div>
 					<div class="inline field">
@@ -26,8 +26,8 @@
 					</div>
 					<div class="inline field">
 						<label></label>
-						<button class="ui primary button">{{.locale.Tr "auth.openid_connect_submit"}}</button>
-						<a href="{{AppSubUrl}}/user/forgot_password">{{.locale.Tr "auth.forgot_password"}}</a>
+						<button class="ui primary button">{{ctx.Locale.Tr "auth.openid_connect_submit"}}</button>
+						<a href="{{AppSubUrl}}/user/forgot_password">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
 					</div>
 					</form>
 				</div>
diff --git a/templates/user/auth/signup_openid_navbar.tmpl b/templates/user/auth/signup_openid_navbar.tmpl
index f52c3ed6a0..075f2e4d7b 100644
--- a/templates/user/auth/signup_openid_navbar.tmpl
+++ b/templates/user/auth/signup_openid_navbar.tmpl
@@ -1,11 +1,11 @@
 <div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
 	<div class="new-menu-inner">
 		<a class="{{if .PageIsOpenIDConnect}}active {{end}}item" href="{{AppSubUrl}}/user/openid/connect">
-			{{.locale.Tr "auth.openid_connect_title"}}
+			{{ctx.Locale.Tr "auth.openid_connect_title"}}
 		</a>
 		{{if and .EnableOpenIDSignUp (not .AllowOnlyInternalRegistration)}}
 			<a class="{{if .PageIsOpenIDRegister}}active {{end}}item" href="{{AppSubUrl}}/user/openid/register">
-				{{.locale.Tr "auth.openid_register_title"}}
+				{{ctx.Locale.Tr "auth.openid_register_title"}}
 			</a>
 		{{end}}
 	</div>
diff --git a/templates/user/auth/signup_openid_register.tmpl b/templates/user/auth/signup_openid_register.tmpl
index 9736c53ed8..81c36957d1 100644
--- a/templates/user/auth/signup_openid_register.tmpl
+++ b/templates/user/auth/signup_openid_register.tmpl
@@ -4,20 +4,20 @@
 	<div class="ui container">
 				{{template "base/alert" .}}
 				<h4 class="ui top attached header">
-					{{.locale.Tr "auth.openid_register_title"}}
+					{{ctx.Locale.Tr "auth.openid_register_title"}}
 				</h4>
 				<div class="ui attached segment">
 					<p>
-						{{.locale.Tr "auth.openid_register_desc"}}
+						{{ctx.Locale.Tr "auth.openid_register_desc"}}
 					</p>
 					<form class="ui form" action="{{.Link}}" method="post">
 					{{.CsrfTokenHtml}}
 					<div class="required inline field {{if .Err_UserName}}error{{end}}">
-						<label for="user_name">{{.locale.Tr "username"}}</label>
+						<label for="user_name">{{ctx.Locale.Tr "username"}}</label>
 						<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
 					</div>
 					<div class="required inline field {{if .Err_Email}}error{{end}}">
-						<label for="email">{{.locale.Tr "email"}}</label>
+						<label for="email">{{ctx.Locale.Tr "email"}}</label>
 						<input id="email" name="email" type="email" value="{{.email}}" required>
 					</div>
 
@@ -29,7 +29,7 @@
 					</div>
 					<div class="inline field">
 						<label></label>
-						<button class="ui primary button">{{.locale.Tr "auth.create_new_account"}}</button>
+						<button class="ui primary button">{{ctx.Locale.Tr "auth.create_new_account"}}</button>
 					</div>
 					</form>
 				</div>
diff --git a/templates/user/auth/twofa.tmpl b/templates/user/auth/twofa.tmpl
index e303580956..d325114155 100644
--- a/templates/user/auth/twofa.tmpl
+++ b/templates/user/auth/twofa.tmpl
@@ -5,19 +5,19 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "twofa"}}
+					{{ctx.Locale.Tr "twofa"}}
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="required inline field">
-						<label for="passcode">{{.locale.Tr "passcode"}}</label>
+						<label for="passcode">{{ctx.Locale.Tr "passcode"}}</label>
 						<input id="passcode" name="passcode" type="text" autocomplete="one-time-code" inputmode="numeric" pattern="[0-9]*" autofocus required>
 					</div>
 
 					<div class="inline field">
 						<label></label>
-						<button class="ui primary button">{{.locale.Tr "auth.verify"}}</button>
-						<a href="{{AppSubUrl}}/user/two_factor/scratch">{{.locale.Tr "auth.use_scratch_code" | Str2html}}</a>
+						<button class="ui primary button">{{ctx.Locale.Tr "auth.verify"}}</button>
+						<a href="{{AppSubUrl}}/user/two_factor/scratch">{{ctx.Locale.Tr "auth.use_scratch_code" | Str2html}}</a>
 					</div>
 				</div>
 			</form>
diff --git a/templates/user/auth/twofa_scratch.tmpl b/templates/user/auth/twofa_scratch.tmpl
index 58942050f5..1aa044b4a5 100644
--- a/templates/user/auth/twofa_scratch.tmpl
+++ b/templates/user/auth/twofa_scratch.tmpl
@@ -5,18 +5,18 @@
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<h3 class="ui top attached header">
-					{{.locale.Tr "twofa_scratch"}}
+					{{ctx.Locale.Tr "twofa_scratch"}}
 				</h3>
 				<div class="ui attached segment">
 					{{template "base/alert" .}}
 					<div class="required inline field">
-						<label for="token">{{.locale.Tr "auth.scratch_code"}}</label>
+						<label for="token">{{ctx.Locale.Tr "auth.scratch_code"}}</label>
 						<input id="token" name="token" type="text" autocomplete="off" autofocus required>
 					</div>
 
 					<div class="inline field">
 						<label></label>
-						<button class="ui primary button">{{.locale.Tr "auth.verify"}}</button>
+						<button class="ui primary button">{{ctx.Locale.Tr "auth.verify"}}</button>
 					</div>
 				</div>
 			</form>
diff --git a/templates/user/auth/webauthn.tmpl b/templates/user/auth/webauthn.tmpl
index c689f9c6d4..f738937025 100644
--- a/templates/user/auth/webauthn.tmpl
+++ b/templates/user/auth/webauthn.tmpl
@@ -3,19 +3,19 @@
 	<div class="ui page grid">
 		<div class="column center aligned">
 			{{template "user/auth/webauthn_error" .}}
-			<h3 class="ui top attached header">{{.locale.Tr "twofa"}}</h3>
+			<h3 class="ui top attached header">{{ctx.Locale.Tr "twofa"}}</h3>
 			<div class="ui attached segment">
 				{{svg "octicon-key" 56}}
-				<h3>{{.locale.Tr "webauthn_insert_key"}}</h3>
+				<h3>{{ctx.Locale.Tr "webauthn_insert_key"}}</h3>
 				{{template "base/alert" .}}
-				<p>{{.locale.Tr "webauthn_sign_in"}}</p>
+				<p>{{ctx.Locale.Tr "webauthn_sign_in"}}</p>
 			</div>
 			<div class="ui attached segment gt-df gt-ac gt-jc gt-gap-2 gt-py-3">
 				<div class="is-loading" style="width: 40px; height: 40px"></div>
-				{{.locale.Tr "webauthn_press_button"}}
+				{{ctx.Locale.Tr "webauthn_press_button"}}
 			</div>
 			<div class="ui attached segment">
-				<a href="{{AppSubUrl}}/user/two_factor">{{.locale.Tr "webauthn_use_twofa"}}</a>
+				<a href="{{AppSubUrl}}/user/two_factor">{{ctx.Locale.Tr "webauthn_use_twofa"}}</a>
 			</div>
 		</div>
 	</div>
diff --git a/templates/user/auth/webauthn_error.tmpl b/templates/user/auth/webauthn_error.tmpl
index 59029bbf91..fc6064db76 100644
--- a/templates/user/auth/webauthn_error.tmpl
+++ b/templates/user/auth/webauthn_error.tmpl
@@ -1,13 +1,13 @@
 <div id="webauthn-error" class="ui negative message gt-hidden">
-	<div class="header">{{.locale.Tr "webauthn_error"}}</div>
+	<div class="header">{{ctx.Locale.Tr "webauthn_error"}}</div>
 	<div id="webauthn-error-msg" class="gt-pt-3"></div>
 	<div class="gt-hidden">
-		<div data-webauthn-error-msg="browser">{{.locale.Tr "webauthn_unsupported_browser"}}</div>
-		<div data-webauthn-error-msg="unknown">{{.locale.Tr "webauthn_error_unknown"}}</div>
-		<div data-webauthn-error-msg="insecure">{{.locale.Tr "webauthn_error_insecure"}}</div>
-		<div data-webauthn-error-msg="unable-to-process">{{.locale.Tr "webauthn_error_unable_to_process"}}</div>
-		<div data-webauthn-error-msg="duplicated">{{.locale.Tr "webauthn_error_duplicated"}}</div>
-		<div data-webauthn-error-msg="empty">{{.locale.Tr "webauthn_error_empty"}}</div>
-		<div data-webauthn-error-msg="timeout">{{.locale.Tr "webauthn_error_timeout"}}</div>
+		<div data-webauthn-error-msg="browser">{{ctx.Locale.Tr "webauthn_unsupported_browser"}}</div>
+		<div data-webauthn-error-msg="unknown">{{ctx.Locale.Tr "webauthn_error_unknown"}}</div>
+		<div data-webauthn-error-msg="insecure">{{ctx.Locale.Tr "webauthn_error_insecure"}}</div>
+		<div data-webauthn-error-msg="unable-to-process">{{ctx.Locale.Tr "webauthn_error_unable_to_process"}}</div>
+		<div data-webauthn-error-msg="duplicated">{{ctx.Locale.Tr "webauthn_error_duplicated"}}</div>
+		<div data-webauthn-error-msg="empty">{{ctx.Locale.Tr "webauthn_error_empty"}}</div>
+		<div data-webauthn-error-msg="timeout">{{ctx.Locale.Tr "webauthn_error_timeout"}}</div>
 	</div>
 </div>
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl
index 1c5a5f3237..a03da1072d 100644
--- a/templates/user/dashboard/feeds.tmpl
+++ b/templates/user/dashboard/feeds.tmpl
@@ -12,71 +12,71 @@
 						{{.ShortActUserName}}
 					{{end}}
 					{{if .GetOpType.InActions "create_repo"}}
-						{{$.locale.Tr "action.create_repo" (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.create_repo" (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "rename_repo"}}
-						{{$.locale.Tr "action.rename_repo" (.GetContent|Escape) (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.rename_repo" (.GetContent|Escape) (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "commit_repo"}}
 						{{if .Content}}
-							{{$.locale.Tr "action.commit_repo" (.GetRepoLink|Escape) (.GetRefLink|Escape) (Escape .GetBranch) (.ShortRepoPath|Escape) | Str2html}}
+							{{ctx.Locale.Tr "action.commit_repo" (.GetRepoLink|Escape) (.GetRefLink|Escape) (Escape .GetBranch) (.ShortRepoPath|Escape) | Str2html}}
 						{{else}}
-							{{$.locale.Tr "action.create_branch" (.GetRepoLink|Escape) (.GetRefLink|Escape) (Escape .GetBranch) (.ShortRepoPath|Escape) | Str2html}}
+							{{ctx.Locale.Tr "action.create_branch" (.GetRepoLink|Escape) (.GetRefLink|Escape) (Escape .GetBranch) (.ShortRepoPath|Escape) | Str2html}}
 						{{end}}
 					{{else if .GetOpType.InActions "create_issue"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.create_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.create_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "create_pull_request"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.create_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.create_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "transfer_repo"}}
-						{{$.locale.Tr "action.transfer_repo" .GetContent (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.transfer_repo" .GetContent (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "push_tag"}}
-						{{$.locale.Tr "action.push_tag" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetTag|Escape) (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.push_tag" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetTag|Escape) (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "comment_issue"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.comment_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.comment_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "merge_pull_request"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.merge_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.merge_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "close_issue"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.close_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.close_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "reopen_issue"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.reopen_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.reopen_issue" ((printf "%s/issues/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "close_pull_request"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.close_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.close_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "reopen_pull_request"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.reopen_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.reopen_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "delete_tag"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.delete_tag" (.GetRepoLink|Escape) (.GetTag|Escape) (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.delete_tag" (.GetRepoLink|Escape) (.GetTag|Escape) (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "delete_branch"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.delete_branch" (.GetRepoLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.delete_branch" (.GetRepoLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "mirror_sync_push"}}
-						{{$.locale.Tr "action.mirror_sync_push" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.mirror_sync_push" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "mirror_sync_create"}}
-						{{$.locale.Tr "action.mirror_sync_create" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.mirror_sync_create" (.GetRepoLink|Escape) (.GetRefLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "mirror_sync_delete"}}
-						{{$.locale.Tr "action.mirror_sync_delete" (.GetRepoLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.mirror_sync_delete" (.GetRepoLink|Escape) (.GetBranch|Escape) (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "approve_pull_request"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.approve_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.approve_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "reject_pull_request"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.reject_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.reject_pull_request" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "comment_pull"}}
 						{{$index := index .GetIssueInfos 0}}
-						{{$.locale.Tr "action.comment_pull" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
+						{{ctx.Locale.Tr "action.comment_pull" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}}
 					{{else if .GetOpType.InActions "publish_release"}}
 						{{$linkText := .Content | RenderEmoji $.Context}}
-						{{$.locale.Tr "action.publish_release" (.GetRepoLink|Escape) ((printf "%s/releases/tag/%s" .GetRepoLink .GetTag)|Escape) (.ShortRepoPath|Escape) $linkText | Str2html}}
+						{{ctx.Locale.Tr "action.publish_release" (.GetRepoLink|Escape) ((printf "%s/releases/tag/%s" .GetRepoLink .GetTag)|Escape) (.ShortRepoPath|Escape) $linkText | Str2html}}
 					{{else if .GetOpType.InActions "review_dismissed"}}
 						{{$index := index .GetIssueInfos 0}}
 						{{$reviewer := index .GetIssueInfos 1}}
-						{{$.locale.Tr "action.review_dismissed" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) $reviewer | Str2html}}
+						{{ctx.Locale.Tr "action.review_dismissed" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) $reviewer | Str2html}}
 					{{end}}
 				</div>
 				{{if .GetOpType.InActions "commit_repo" "mirror_sync_push"}}
@@ -93,7 +93,7 @@
 						</div>
 					{{end}}
 					{{if and (gt $push.Len 1) $push.CompareURL}}
-						<a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{$.locale.Tr "action.compare_commits" $push.Len}} »</a>
+						<a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{ctx.Locale.Tr "action.compare_commits" $push.Len}} »</a>
 					{{end}}
 				{{else if .GetOpType.InActions "create_issue"}}
 					<span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji $.Context | RenderCodeBlock}}</span>
@@ -110,10 +110,10 @@
 				{{else if .GetOpType.InActions "close_issue" "reopen_issue" "close_pull_request" "reopen_pull_request"}}
 					<span class="text truncate issue title">{{.GetIssueTitle | RenderEmoji $.Context | RenderCodeBlock}}</span>
 				{{else if .GetOpType.InActions "pull_review_dismissed"}}
-				<div class="flex-item-body">{{$.locale.Tr "action.review_dismissed_reason"}}</div>
+				<div class="flex-item-body">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</div>
 				<div class="flex-item-body">{{index .GetIssueInfos 2 | RenderEmoji $.Context}}</div>
 				{{end}}
-				<div class="flex-item-body">{{TimeSince .GetCreate $.locale}}</div>
+				<div class="flex-item-body">{{TimeSince .GetCreate ctx.Locale}}</div>
 			</div>
 			<div class="flex-item-trailing">
 				{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32 "text grey gt-mr-2"}}
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
index 769461cca8..269ef39f84 100644
--- a/templates/user/dashboard/issues.tmpl
+++ b/templates/user/dashboard/issues.tmpl
@@ -6,34 +6,34 @@
 			<div class="four wide column">
 				<div class="ui secondary vertical filter menu gt-bg-transparent">
 					<a class="{{if eq .ViewType "your_repositories"}}active{{end}} item" href="{{.Link}}?type=your_repositories&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
-						{{.locale.Tr "home.issues.in_your_repos"}}
+						{{ctx.Locale.Tr "home.issues.in_your_repos"}}
 						<strong>{{CountFmt .IssueStats.YourRepositoriesCount}}</strong>
 					</a>
 					<a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{.Link}}?type=assigned&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
-						{{.locale.Tr "repo.issues.filter_type.assigned_to_you"}}
+						{{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}
 						<strong>{{CountFmt .IssueStats.AssignCount}}</strong>
 					</a>
 					<a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{.Link}}?type=created_by&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
-						{{.locale.Tr "repo.issues.filter_type.created_by_you"}}
+						{{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}
 						<strong>{{CountFmt .IssueStats.CreateCount}}</strong>
 					</a>
 					{{if .PageIsPulls}}
 						<a class="{{if eq .ViewType "review_requested"}}active{{end}} item" href="{{.Link}}?type=review_requested&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
-							{{.locale.Tr "repo.issues.filter_type.review_requested"}}
+							{{ctx.Locale.Tr "repo.issues.filter_type.review_requested"}}
 							<strong>{{CountFmt .IssueStats.ReviewRequestedCount}}</strong>
 						</a>
 						<a class="{{if eq .ViewType "reviewed_by"}}active{{end}} item" href="{{.Link}}?type=reviewed_by&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
-							{{.locale.Tr "repo.issues.filter_type.reviewed_by_you"}}
+							{{ctx.Locale.Tr "repo.issues.filter_type.reviewed_by_you"}}
 							<strong>{{CountFmt .IssueStats.ReviewedCount}}</strong>
 						</a>
 					{{end}}
 					<a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{.Link}}?type=mentioned&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
-						{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}
+						{{ctx.Locale.Tr "repo.issues.filter_type.mentioning_you"}}
 						<strong>{{CountFmt .IssueStats.MentionCount}}</strong>
 					</a>
 					<div class="divider"></div>
 					<a class="{{if not $.RepoIDs}}active{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}">
-						<span class="text truncate">{{.locale.Tr "all"}}</span>
+						<span class="text truncate">{{ctx.Locale.Tr "all"}}</span>
 						<span>{{CountFmt .TotalIssueCount}}</span>
 					</a>
 					{{range .Repos}}
@@ -64,11 +64,11 @@
 					<div class="small-menu-items ui compact tiny menu list-header-toggle">
 						<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">
 							{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
-							{{.locale.PrettyNumber .IssueStats.OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}
+							{{ctx.Locale.PrettyNumber .IssueStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
 						</a>
 						<a class="item{{if .IsShowClosed}} active{{end}}" href="{{.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=closed&q={{$.Keyword}}">
 							{{svg "octicon-issue-closed" 16 "gt-mr-3"}}
-							{{.locale.PrettyNumber .IssueStats.ClosedCount}}&nbsp;{{.locale.Tr "repo.issues.closed_title"}}
+							{{ctx.Locale.PrettyNumber .IssueStats.ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
 						</a>
 					</div>
 					<form class="list-header-search ui form ignore-dirty">
@@ -78,32 +78,32 @@
 							<input type="hidden" name="sort" value="{{$.SortType}}">
 							<input type="hidden" name="state" value="{{$.State}}">
 							{{template "shared/searchinput" dict "Value" $.Keyword}}
-							<button id="issue-list-quick-goto" class="ui small icon button gt-hidden" data-tooltip-content="{{.locale.Tr "explore.go_to"}}">{{svg "octicon-hash"}}</button>
-							<button class="ui small icon button" aria-label="{{.locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button>
+							<button id="issue-list-quick-goto" class="ui small icon button gt-hidden" data-tooltip-content="{{ctx.Locale.Tr "explore.go_to"}}">{{svg "octicon-hash"}}</button>
+							<button class="ui small icon button" aria-label="{{ctx.Locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button>
 						</div>
 					</form>
 					<!-- Sort -->
 					<div class="list-header-sort ui small dropdown type jump item">
 						<span class="text gt-whitespace-nowrap">
-							{{.locale.Tr "repo.issues.filter_sort"}}
+							{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 							{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						</span>
 						<div class="menu">
-							<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=recentupdate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
-							<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastupdate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
-							<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=latest&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a>
-							<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=oldest&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a>
-							<a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=mostcomment&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
-							<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastcomment&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
-							<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=nearduedate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
-							<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=farduedate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
+							<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=recentupdate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+							<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastupdate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+							<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=latest&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
+							<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=oldest&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+							<a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=mostcomment&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
+							<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastcomment&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
+							<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=nearduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
+							<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=farduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
 						</div>
 					</div>
 					{{if .SingleRepoLink}}
 						{{if eq .SingleRepoAction "issue"}}
-							<a class="ui primary button gt-ml-4" href="{{.SingleRepoLink}}/issues/new/choose">{{.locale.Tr "repo.issues.new"}}</a>
+							<a class="ui primary button gt-ml-4" href="{{.SingleRepoLink}}/issues/new/choose">{{ctx.Locale.Tr "repo.issues.new"}}</a>
 						{{else if eq .SingleRepoAction "pull"}}
-							<a class="ui primary button gt-ml-4" href="{{.SingleRepoLink}}/compare">{{.locale.Tr "repo.pulls.new"}}</a>
+							<a class="ui primary button gt-ml-4" href="{{.SingleRepoLink}}/compare">{{ctx.Locale.Tr "repo.pulls.new"}}</a>
 						{{end}}
 					{{end}}
 				</div>
diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl
index bb63994de4..90be082f0f 100644
--- a/templates/user/dashboard/milestones.tmpl
+++ b/templates/user/dashboard/milestones.tmpl
@@ -6,7 +6,7 @@
 			<div class="four wide column">
 				<div class="ui secondary vertical filter menu gt-bg-transparent">
 					<div class="item">
-						{{.locale.Tr "home.issues.in_your_repos"}}
+						{{ctx.Locale.Tr "home.issues.in_your_repos"}}
 						<strong>{{.Total}}</strong>
 					</div>
 					<div class="divider"></div>
@@ -38,11 +38,11 @@
 					<div class="small-menu-items ui compact tiny menu list-header-toggle">
 						<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">
 							{{svg "octicon-milestone" 16 "gt-mr-3"}}
-							{{.locale.PrettyNumber .MilestoneStats.OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}
+							{{ctx.Locale.PrettyNumber .MilestoneStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
 						</a>
 						<a class="item{{if .IsShowClosed}} active{{end}}" href="{{.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=closed&q={{$.Keyword}}">
 							{{svg "octicon-check" 16 "gt-mr-3"}}
-							{{.locale.PrettyNumber .MilestoneStats.ClosedCount}}&nbsp;{{.locale.Tr "repo.issues.closed_title"}}
+							{{ctx.Locale.PrettyNumber .MilestoneStats.ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
 						</a>
 					</div>
 					<form class="list-header-search ui form ignore-dirty">
@@ -52,22 +52,22 @@
 							<input type="hidden" name="sort" value="{{$.SortType}}">
 							<input type="hidden" name="state" value="{{$.State}}">
 							{{template "shared/searchinput" dict "Value" $.Keyword}}
-							<button class="ui small icon button" type="submit" aria-label="{{.locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button>
+							<button class="ui small icon button" type="submit" aria-label="{{ctx.Locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button>
 						</div>
 					</form>
 					<!-- Sort -->
 					<div class="list-header-sort ui dropdown type jump item">
 						<span class="text">
-							{{.locale.Tr "repo.issues.filter_sort"}}
+							{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 						</span>
 						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 						<div class="menu">
-							<a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=closestduedate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.closest_due_date"}}</a>
-							<a class="{{if eq .SortType "furthestduedate"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=furthestduedate&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.furthest_due_date"}}</a>
-							<a class="{{if eq .SortType "leastcomplete"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastcomplete&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.least_complete"}}</a>
-							<a class="{{if eq .SortType "mostcomplete"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=mostcomplete&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.most_complete"}}</a>
-							<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=mostissues&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
-							<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastissues&state={{$.State}}&q={{$.Keyword}}">{{.locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
+							<a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=closestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.closest_due_date"}}</a>
+							<a class="{{if eq .SortType "furthestduedate"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=furthestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.furthest_due_date"}}</a>
+							<a class="{{if eq .SortType "leastcomplete"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_complete"}}</a>
+							<a class="{{if eq .SortType "mostcomplete"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=mostcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_complete"}}</a>
+							<a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=mostissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
+							<a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="{{$.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
 						</div>
 					</div>
 				</div>
@@ -91,11 +91,11 @@
 								<div class="group">
 									<div class="flex-text-block">
 										{{svg "octicon-issue-opened" 14}}
-										{{$.locale.PrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
+										{{ctx.Locale.PrettyNumber .NumOpenIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
 									</div>
 									<div class="flex-text-block">
 										{{svg "octicon-check" 14}}
-										{{$.locale.PrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
+										{{ctx.Locale.PrettyNumber .NumClosedIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
 									</div>
 									{{if .TotalTrackedTime}}
 										<div class="flex-text-block">
@@ -106,14 +106,14 @@
 									{{if .UpdatedUnix}}
 										<div class="flex-text-block">
 											{{svg "octicon-clock"}}
-											{{$.locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix $.locale) | Safe}}
+											{{ctx.Locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix ctx.Locale) | Safe}}
 										</div>
 									{{end}}
 									<div class="flex-text-block">
 										{{if .IsClosed}}
-											{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
+											{{$closedDate:= TimeSinceUnix .ClosedDateUnix ctx.Locale}}
 											{{svg "octicon-clock" 14}}
-											{{$.locale.Tr "repo.milestones.closed" $closedDate | Safe}}
+											{{ctx.Locale.Tr "repo.milestones.closed" $closedDate | Safe}}
 										{{else}}
 											{{if .DeadlineString}}
 												<span{{if .IsOverdue}} class="text red"{{end}}>
@@ -122,20 +122,20 @@
 												</span>
 											{{else}}
 												{{svg "octicon-calendar" 14}}
-												{{$.locale.Tr "repo.milestones.no_due_date"}}
+												{{ctx.Locale.Tr "repo.milestones.no_due_date"}}
 											{{end}}
 										{{end}}
 									</div>
 								</div>
 								{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
 									<div class="group">
-										<a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{$.locale.Tr "repo.issues.label_edit"}}</a>
+										<a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
 										{{if .IsClosed}}
-											<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{$.locale.Tr "repo.milestones.open"}}</a>
+											<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{ctx.Locale.Tr "repo.milestones.open"}}</a>
 										{{else}}
-											<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{$.locale.Tr "repo.milestones.close"}}</a>
+											<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{ctx.Locale.Tr "repo.milestones.close"}}</a>
 										{{end}}
-										<a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a>
+										<a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
 									</div>
 								{{end}}
 							</div>
diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl
index f9c6a29513..af07897e2c 100644
--- a/templates/user/dashboard/navbar.tmpl
+++ b/templates/user/dashboard/navbar.tmpl
@@ -6,22 +6,22 @@
 					{{ctx.AvatarUtils.Avatar .ContextUser}}
 					<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
 					<span class="org-visibility">
-						{{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
-						{{if .ContextUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
+						{{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
+						{{if .ContextUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
 					</span>
 					{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 				</span>
 				<div class="context user overflow menu">
 					<div class="ui header">
-						{{.locale.Tr "home.switch_dashboard_context"}}
+						{{ctx.Locale.Tr "home.switch_dashboard_context"}}
 					</div>
 					<div class="scrolling menu items">
 						<a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item truncated-item-container" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}">
 							{{ctx.AvatarUtils.Avatar .SignedUser}}
 							<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
 							<span class="org-visibility">
-								{{if .SignedUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
-								{{if .SignedUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
+								{{if .SignedUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
+								{{if .SignedUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
 							</span>
 						</a>
 						{{range .Orgs}}
@@ -29,15 +29,15 @@
 								{{ctx.AvatarUtils.Avatar .}}
 								<span class="truncated-item-name">{{.ShortName 40}}</span>
 								<span class="org-visibility">
-									{{if .Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
-									{{if .Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
+									{{if .Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
+									{{if .Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
 								</span>
 							</a>
 						{{end}}
 					</div>
 					{{if .SignedUser.CanCreateOrganization}}
 					<a class="item" href="{{AppSubUrl}}/org/create">
-						{{svg "octicon-plus"}}&nbsp;&nbsp;&nbsp;{{.locale.Tr "new_org"}}
+						{{svg "octicon-plus"}}&nbsp;&nbsp;&nbsp;{{ctx.Locale.Tr "new_org"}}
 					</a>
 					{{end}}
 				</div>
@@ -51,17 +51,17 @@
 						{{if .Team}}
 							{{.Team.Name}}
 						{{else}}
-							{{.locale.Tr "org.teams"}}
+							{{ctx.Locale.Tr "org.teams"}}
 						{{end}}
 					</span>
 					{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 					<div class="context user overflow menu">
 						<div class="ui header">
-							{{.locale.Tr "home.filter_by_team_repositories"}}
+							{{ctx.Locale.Tr "home.filter_by_team_repositories"}}
 						</div>
 						<div class="scrolling menu items">
-							<a class="{{if not $.Team}}active selected{{end}} item" title="{{.locale.Tr "all"}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
-								{{.locale.Tr "all"}}
+							<a class="{{if not $.Team}}active selected{{end}} item" title="{{ctx.Locale.Tr "all"}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
+								{{ctx.Locale.Tr "all"}}
 							</a>
 							{{range .Teams}}
 								{{if not .IncludesAllRepositories}}
@@ -79,26 +79,26 @@
 	{{if .ContextUser.IsOrganization}}
 		<div class="right menu">
 			<a class="{{if .PageIsNews}}active {{end}}item gt-ml-auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
-				{{svg "octicon-rss"}}&nbsp;{{.locale.Tr "activities"}}
+				{{svg "octicon-rss"}}&nbsp;{{ctx.Locale.Tr "activities"}}
 			</a>
 			{{if not .UnitIssuesGlobalDisabled}}
 			<a class="{{if .PageIsIssues}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/issues{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
-				{{svg "octicon-issue-opened"}}&nbsp;{{.locale.Tr "issues"}}
+				{{svg "octicon-issue-opened"}}&nbsp;{{ctx.Locale.Tr "issues"}}
 			</a>
 			{{end}}
 			{{if not .UnitPullsGlobalDisabled}}
 			<a class="{{if .PageIsPulls}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/pulls{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
-				{{svg "octicon-git-pull-request"}}&nbsp;{{.locale.Tr "pull_requests"}}
+				{{svg "octicon-git-pull-request"}}&nbsp;{{ctx.Locale.Tr "pull_requests"}}
 			</a>
 			{{end}}
 			{{if and .ShowMilestonesDashboardPage (not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled))}}
 			<a class="{{if .PageIsMilestonesDashboard}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/milestones{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
-				{{svg "octicon-milestone"}}&nbsp;{{.locale.Tr "milestones"}}
+				{{svg "octicon-milestone"}}&nbsp;{{ctx.Locale.Tr "milestones"}}
 			</a>
 			{{end}}
 			<div class="item">
-				<a class="ui primary basic button" href="{{.ContextUser.HomeLink}}" title="{{.locale.Tr "home.view_home" .ContextUser.Name}}">
-					{{.locale.Tr "home.view_home" (.ContextUser.ShortName 40)}}
+				<a class="ui primary basic button" href="{{.ContextUser.HomeLink}}" title="{{ctx.Locale.Tr "home.view_home" .ContextUser.Name}}">
+					{{ctx.Locale.Tr "home.view_home" (.ContextUser.ShortName 40)}}
 				</a>
 			</div>
 		</div>
diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl
index 44542d579d..ed6f906822 100644
--- a/templates/user/dashboard/repolist.tmpl
+++ b/templates/user/dashboard/repolist.tmpl
@@ -5,39 +5,39 @@ const data = {
 	isMirrorsEnabled: {{.MirrorsEnabled}},
 	isStarsEnabled: {{not .IsDisableStars}},
 
-	textRepository: {{.locale.Tr "repository"}},
-	textOrganization: {{.locale.Tr "organization"}},
-	textMyRepos: {{.locale.Tr "home.my_repos"}},
-	textNewRepo: {{.locale.Tr "new_repo"}},
-	textSearchRepos: {{.locale.Tr "home.search_repos"}},
-	textFilter: {{.locale.Tr "home.filter"}},
-	textShowArchived: {{.locale.Tr "home.show_archived"}},
-	textShowPrivate: {{.locale.Tr "home.show_private"}},
+	textRepository: {{ctx.Locale.Tr "repository"}},
+	textOrganization: {{ctx.Locale.Tr "organization"}},
+	textMyRepos: {{ctx.Locale.Tr "home.my_repos"}},
+	textNewRepo: {{ctx.Locale.Tr "new_repo"}},
+	textSearchRepos: {{ctx.Locale.Tr "home.search_repos"}},
+	textFilter: {{ctx.Locale.Tr "home.filter"}},
+	textShowArchived: {{ctx.Locale.Tr "home.show_archived"}},
+	textShowPrivate: {{ctx.Locale.Tr "home.show_private"}},
 
-	textShowBothArchivedUnarchived: {{.locale.Tr "home.show_both_archived_unarchived"}},
-	textShowOnlyUnarchived: {{.locale.Tr "home.show_only_unarchived"}},
-	textShowOnlyArchived: {{.locale.Tr "home.show_only_archived"}},
+	textShowBothArchivedUnarchived: {{ctx.Locale.Tr "home.show_both_archived_unarchived"}},
+	textShowOnlyUnarchived: {{ctx.Locale.Tr "home.show_only_unarchived"}},
+	textShowOnlyArchived: {{ctx.Locale.Tr "home.show_only_archived"}},
 
-	textShowBothPrivatePublic: {{.locale.Tr "home.show_both_private_public"}},
-	textShowOnlyPublic: {{.locale.Tr "home.show_only_public"}},
-	textShowOnlyPrivate: {{.locale.Tr "home.show_only_private"}},
+	textShowBothPrivatePublic: {{ctx.Locale.Tr "home.show_both_private_public"}},
+	textShowOnlyPublic: {{ctx.Locale.Tr "home.show_only_public"}},
+	textShowOnlyPrivate: {{ctx.Locale.Tr "home.show_only_private"}},
 
-	textAll: {{.locale.Tr "all"}},
-	textSources: {{.locale.Tr "sources"}},
-	textForks: {{.locale.Tr "forks"}},
-	textMirrors: {{.locale.Tr "mirrors"}},
-	textCollaborative: {{.locale.Tr "collaborative"}},
+	textAll: {{ctx.Locale.Tr "all"}},
+	textSources: {{ctx.Locale.Tr "sources"}},
+	textForks: {{ctx.Locale.Tr "forks"}},
+	textMirrors: {{ctx.Locale.Tr "mirrors"}},
+	textCollaborative: {{ctx.Locale.Tr "collaborative"}},
 
-	textFirstPage: {{.locale.Tr "admin.first_page"}},
-	textPreviousPage: {{.locale.Tr "repo.issues.previous"}},
-	textNextPage: {{.locale.Tr "repo.issues.next"}},
-	textLastPage: {{.locale.Tr "admin.last_page"}},
+	textFirstPage: {{ctx.Locale.Tr "admin.first_page"}},
+	textPreviousPage: {{ctx.Locale.Tr "repo.issues.previous"}},
+	textNextPage: {{ctx.Locale.Tr "repo.issues.next"}},
+	textLastPage: {{ctx.Locale.Tr "admin.last_page"}},
 
-	textMyOrgs: {{.locale.Tr "home.my_orgs"}},
-	textNewOrg: {{.locale.Tr "new_org"}},
+	textMyOrgs: {{ctx.Locale.Tr "home.my_orgs"}},
+	textNewOrg: {{ctx.Locale.Tr "new_org"}},
 
-	textOrgVisibilityLimited: {{.locale.Tr "org.settings.visibility.limited_shortname"}},
-	textOrgVisibilityPrivate: {{.locale.Tr "org.settings.visibility.private_shortname"}},
+	textOrgVisibilityLimited: {{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}},
+	textOrgVisibilityPrivate: {{ctx.Locale.Tr "org.settings.visibility.private_shortname"}},
 };
 
 {{if .Team}}
diff --git a/templates/user/heatmap.tmpl b/templates/user/heatmap.tmpl
index 3bf7e6cbbc..b604b929a3 100644
--- a/templates/user/heatmap.tmpl
+++ b/templates/user/heatmap.tmpl
@@ -1,10 +1,10 @@
 {{if .HeatmapData}}
 	<div id="user-heatmap" class="is-loading"
 		data-heatmap-data="{{JsonUtils.EncodeToString .HeatmapData}}"
-		data-locale-total-contributions="{{$.locale.Tr "heatmap.number_of_contributions_in_the_last_12_months" ($.locale.PrettyNumber .HeatmapTotalContributions)}}"
-		data-locale-no-contributions="{{.locale.Tr "heatmap.no_contributions"}}"
-		data-locale-more="{{.locale.Tr "heatmap.more"}}"
-		data-locale-less="{{.locale.Tr "heatmap.less"}}"
+		data-locale-total-contributions="{{ctx.Locale.Tr "heatmap.number_of_contributions_in_the_last_12_months" (ctx.Locale.PrettyNumber .HeatmapTotalContributions)}}"
+		data-locale-no-contributions="{{ctx.Locale.Tr "heatmap.no_contributions"}}"
+		data-locale-more="{{ctx.Locale.Tr "heatmap.more"}}"
+		data-locale-less="{{ctx.Locale.Tr "heatmap.less"}}"
 	></div>
 	<div class="divider"></div>
 {{end}}
diff --git a/templates/user/notification/notification_div.tmpl b/templates/user/notification/notification_div.tmpl
index 415051ae95..a07f44a065 100644
--- a/templates/user/notification/notification_div.tmpl
+++ b/templates/user/notification/notification_div.tmpl
@@ -4,18 +4,18 @@
 		<div class="gt-df gt-ac gt-sb gt-mb-4">
 			<div class="small-menu-items ui compact tiny menu">
 				<a class="{{if eq .Status 1}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=unread">
-					{{.locale.Tr "notification.unread"}}
+					{{ctx.Locale.Tr "notification.unread"}}
 					<div class="notifications-unread-count ui label {{if not $notificationUnreadCount}}gt-hidden{{end}}">{{$notificationUnreadCount}}</div>
 				</a>
 				<a class="{{if eq .Status 2}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=read">
-					{{.locale.Tr "notification.read"}}
+					{{ctx.Locale.Tr "notification.read"}}
 				</a>
 			</div>
 			{{if and (eq .Status 1)}}
 				<form action="{{AppSubUrl}}/notifications/purge" method="post">
 					{{$.CsrfTokenHtml}}
 					<div class="{{if not $notificationUnreadCount}}gt-hidden{{end}}">
-						<button class="ui mini button primary gt-mr-0" title="{{$.locale.Tr "notification.mark_all_as_read"}}">
+						<button class="ui mini button primary gt-mr-0" title="{{ctx.Locale.Tr "notification.mark_all_as_read"}}">
 							{{svg "octicon-checklist"}}
 						</button>
 					</div>
@@ -28,13 +28,12 @@
 					<div class="gt-df gt-ac gt-fc gt-p-4">
 						{{svg "octicon-inbox" 56 "gt-mb-4"}}
 						{{if eq .Status 1}}
-							{{.locale.Tr "notification.no_unread"}}
+							{{ctx.Locale.Tr "notification.no_unread"}}
 						{{else}}
-							{{.locale.Tr "notification.no_read"}}
+							{{ctx.Locale.Tr "notification.no_read"}}
 						{{end}}
 					</div>
 				{{else}}
-					{{$locale := .locale}}
 					{{range $notification := .Notifications}}
 						<div class="notifications-item gt-df gt-ac gt-fw gt-gap-3 gt-p-3" id="notification_{{.ID}}" data-status="{{.Status}}">
 							<div class="notifications-icon gt-ml-3 gt-mr-2 gt-self-start gt-mt-2">
@@ -63,9 +62,9 @@
 							</a>
 							<div class="notifications-updated gt-ac gt-mr-3">
 								{{if .Issue}}
-									{{TimeSinceUnix .Issue.UpdatedUnix $locale}}
+									{{TimeSinceUnix .Issue.UpdatedUnix ctx.Locale}}
 								{{else}}
-									{{TimeSinceUnix .UpdatedUnix $locale}}
+									{{TimeSinceUnix .UpdatedUnix ctx.Locale}}
 								{{end}}
 							</div>
 							<div class="notifications-buttons gt-ac gt-je gt-gap-2 gt-px-2">
@@ -74,7 +73,7 @@
 										{{$.CsrfTokenHtml}}
 										<input type="hidden" name="notification_id" value="{{.ID}}">
 										<input type="hidden" name="status" value="pinned">
-										<button class="btn interact-bg gt-p-3" title="{{$.locale.Tr "notification.pin"}}"
+										<button class="btn interact-bg gt-p-3" title="{{ctx.Locale.Tr "notification.pin"}}"
 											data-url="{{AppSubUrl}}/notifications/status"
 											data-status="pinned"
 											data-page="{{$.Page.Paginater.Current}}"
@@ -90,7 +89,7 @@
 										<input type="hidden" name="notification_id" value="{{.ID}}">
 										<input type="hidden" name="status" value="read">
 										<input type="hidden" name="page" value="{{$.Page.Paginater.Current}}">
-										<button class="btn interact-bg gt-p-3" title="{{$.locale.Tr "notification.mark_as_read"}}"
+										<button class="btn interact-bg gt-p-3" title="{{ctx.Locale.Tr "notification.mark_as_read"}}"
 											data-url="{{AppSubUrl}}/notifications/status"
 											data-status="read"
 											data-page="{{$.Page.Paginater.Current}}"
@@ -105,7 +104,7 @@
 										<input type="hidden" name="notification_id" value="{{.ID}}">
 										<input type="hidden" name="status" value="unread">
 										<input type="hidden" name="page" value="{{$.Page.Paginater.Current}}">
-										<button class="btn interact-bg gt-p-3" title="{{$.locale.Tr "notification.mark_as_unread"}}"
+										<button class="btn interact-bg gt-p-3" title="{{ctx.Locale.Tr "notification.mark_as_unread"}}"
 											data-url="{{AppSubUrl}}/notifications/status"
 											data-status="unread"
 											data-page="{{$.Page.Paginater.Current}}"
diff --git a/templates/user/notification/notification_subscriptions.tmpl b/templates/user/notification/notification_subscriptions.tmpl
index 6d3f9759f8..03dbd7c3a7 100644
--- a/templates/user/notification/notification_subscriptions.tmpl
+++ b/templates/user/notification/notification_subscriptions.tmpl
@@ -3,10 +3,10 @@
 	<div class="ui container">
 		<div class="ui top attached tabular menu">
 			<a href="{{AppSubUrl}}/notifications/subscriptions" class="{{if eq .Status 1}}active {{end}}item">
-				{{.locale.Tr "notification.subscriptions"}}
+				{{ctx.Locale.Tr "notification.subscriptions"}}
 			</a>
 			<a href="{{AppSubUrl}}/notifications/watching" class="{{if eq .Status 2}}active {{end}}item">
-				{{.locale.Tr "notification.watching"}}
+				{{ctx.Locale.Tr "notification.watching"}}
 			</a>
 		</div>
 		<div class="ui bottom attached active tab segment">
@@ -15,15 +15,15 @@
 					<div class="gt-df">
 						<div class="small-menu-items ui compact tiny menu">
 							<a class="{{if eq .State "all"}}active {{end}}item" href="{{$.Link}}?sort={{$.SortType}}&state=all&issueType={{$.IssueType}}&labels={{$.Labels}}">
-								{{.locale.Tr "all"}}
+								{{ctx.Locale.Tr "all"}}
 							</a>
 							<a class="{{if eq .State "open"}}active {{end}}item" href="{{$.Link}}?sort={{$.SortType}}&state=open&issueType={{$.IssueType}}&labels={{$.Labels}}">
 								{{svg "octicon-issue-opened" 16 "gt-mr-3"}}
-								{{.locale.Tr "repo.issues.open_title"}}
+								{{ctx.Locale.Tr "repo.issues.open_title"}}
 							</a>
 							<a class="{{if eq .State "closed"}}active {{end}}item" href="{{$.Link}}?sort={{$.SortType}}&state=closed&issueType={{$.IssueType}}&labels={{$.Labels}}">
 								{{svg "octicon-issue-closed" 16 "gt-mr-3"}}
-								{{.locale.Tr "repo.issues.closed_title"}}
+								{{ctx.Locale.Tr "repo.issues.closed_title"}}
 							</a>
 						</div>
 					</div>
@@ -32,31 +32,31 @@
 							<!-- Type -->
 								<div class="ui dropdown type jump item">
 									<span class="text">
-										{{.locale.Tr "repo.issues.filter_type"}}
+										{{ctx.Locale.Tr "repo.issues.filter_type"}}
 									</span>
 									{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 									<div class="menu">
-										<a class="{{if or (eq .IssueType "all") (not .IssueType)}}active {{end}}item" href="{{$.Link}}?sort={{$.SortType}}&state={{$.State}}&issueType=all&labels={{$.Labels}}">{{.locale.Tr "all"}}</a>
-										<a class="{{if eq .IssueType "issues"}}active {{end}}item" href="{{$.Link}}?sort={{$.SortType}}&state={{$.State}}&issueType=issues&labels={{$.Labels}}">{{.locale.Tr "issues"}}</a>
-										<a class="{{if eq .IssueType "pulls"}}active {{end}}item" href="{{$.Link}}?sort={{$.SortType}}&state={{$.State}}&issueType=pulls&labels={{$.Labels}}">{{.locale.Tr "pull_requests"}}</a>
+										<a class="{{if or (eq .IssueType "all") (not .IssueType)}}active {{end}}item" href="{{$.Link}}?sort={{$.SortType}}&state={{$.State}}&issueType=all&labels={{$.Labels}}">{{ctx.Locale.Tr "all"}}</a>
+										<a class="{{if eq .IssueType "issues"}}active {{end}}item" href="{{$.Link}}?sort={{$.SortType}}&state={{$.State}}&issueType=issues&labels={{$.Labels}}">{{ctx.Locale.Tr "issues"}}</a>
+										<a class="{{if eq .IssueType "pulls"}}active {{end}}item" href="{{$.Link}}?sort={{$.SortType}}&state={{$.State}}&issueType=pulls&labels={{$.Labels}}">{{ctx.Locale.Tr "pull_requests"}}</a>
 									</div>
 								</div>
 
 							<!-- Sort -->
 							<div class="ui dropdown type jump item">
 								<span class="text">
-									{{.locale.Tr "repo.issues.filter_sort"}}
+									{{ctx.Locale.Tr "repo.issues.filter_sort"}}
 								</span>
 								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 								<div class="menu">
-									<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=latest&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a>
-									<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?sort=oldest&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a>
-									<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
-									<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
-									<a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?sort=mostcomment&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{.locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
-									<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?sort=leastcomment&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{.locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
-									<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?sort=nearduedate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{.locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
-									<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?sort=farduedate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{.locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
+									<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=latest&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
+									<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?sort=oldest&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+									<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+									<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+									<a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?sort=mostcomment&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
+									<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?sort=leastcomment&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
+									<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?sort=nearduedate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
+									<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?sort=farduedate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
 								</div>
 							</div>
 						</div>
@@ -64,7 +64,7 @@
 				</div>
 				{{if eq (len .Issues) 0}}
 					<div class="divider"></div>
-					{{.locale.Tr "notification.no_subscriptions"}}
+					{{ctx.Locale.Tr "notification.no_subscriptions"}}
 				{{else}}
 					{{template "shared/issuelist" dict "." . "listType" "dashboard"}}
 				{{end}}
diff --git a/templates/user/overview/header.tmpl b/templates/user/overview/header.tmpl
index 895f1efb38..69a4e9a856 100644
--- a/templates/user/overview/header.tmpl
+++ b/templates/user/overview/header.tmpl
@@ -1,41 +1,41 @@
 <div class="ui secondary stackable pointing menu">
 	{{if .HasProfileReadme}}
 	<a class="{{if eq .TabName "overview"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=overview">
-		{{svg "octicon-info"}} {{.locale.Tr "user.overview"}}
+		{{svg "octicon-info"}} {{ctx.Locale.Tr "user.overview"}}
 	</a>
 	{{end}}
 	<a class="{{if eq .TabName "repositories"}}active {{end}} item" href="{{.ContextUser.HomeLink}}?tab=repositories">
-		{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
+		{{svg "octicon-repo"}} {{ctx.Locale.Tr "user.repositories"}}
 		{{if .RepoCount}}
 			<div class="ui small label">{{.RepoCount}}</div>
 		{{end}}
 	</a>
 	{{if or .ContextUser.IsIndividual (and .ContextUser.IsOrganization .CanReadProjects)}}
 	<a href="{{.ContextUser.HomeLink}}/-/projects" class="{{if .PageIsViewProjects}}active {{end}}item">
-		{{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
+		{{svg "octicon-project-symlink"}} {{ctx.Locale.Tr "user.projects"}}
 	</a>
 	{{end}}
 	{{if and .IsPackageEnabled (or .ContextUser.IsIndividual (and .ContextUser.IsOrganization .CanReadPackages))}}
 		<a href="{{.ContextUser.HomeLink}}/-/packages" class="{{if .IsPackagesPage}}active {{end}}item">
-			{{svg "octicon-package"}} {{.locale.Tr "packages.title"}}
+			{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
 		</a>
 	{{end}}
 	{{if and .IsRepoIndexerEnabled (or .ContextUser.IsIndividual (and .ContextUser.IsOrganization .CanReadCode))}}
 		<a href="{{.ContextUser.HomeLink}}/-/code" class="{{if .IsCodePage}}active {{end}}item">
-			{{svg "octicon-code"}} {{.locale.Tr "user.code"}}
+			{{svg "octicon-code"}} {{ctx.Locale.Tr "user.code"}}
 		</a>
 	{{end}}
 
 	{{if .ContextUser.IsOrganization}}
 		{{if .IsOrganizationMember}}
 			<a class="item" href="{{$.OrgLink}}/members">
-				{{svg "octicon-person"}}&nbsp;{{$.locale.Tr "org.members"}}
+				{{svg "octicon-person"}}&nbsp;{{ctx.Locale.Tr "org.members"}}
 				{{if .NumMembers}}
 					<div class="ui small label">{{.NumMembers}}</div>
 				{{end}}
 			</a>
 			<a class="item" href="{{$.OrgLink}}/teams">
-				{{svg "octicon-people"}}&nbsp;{{$.locale.Tr "org.teams"}}
+				{{svg "octicon-people"}}&nbsp;{{ctx.Locale.Tr "org.teams"}}
 				{{if .NumTeams}}
 					<div class="ui small label">{{.NumTeams}}</div>
 				{{end}}
@@ -45,24 +45,24 @@
 		{{if .IsOrganizationOwner}}
 			<div class="right menu">
 				<a class="item" href="{{.OrgLink}}/settings">
-				{{svg "octicon-tools"}} {{.locale.Tr "repo.settings"}}
+				{{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
 				</a>
 			</div>
 		{{end}}
 	{{else}}
 		<a class="{{if eq .TabName "activity"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=activity">
-			{{svg "octicon-rss"}} {{.locale.Tr "user.activity"}}
+			{{svg "octicon-rss"}} {{ctx.Locale.Tr "user.activity"}}
 		</a>
 		{{if not .DisableStars}}
 			<a class="{{if eq .TabName "stars"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=stars">
-				{{svg "octicon-star"}} {{.locale.Tr "user.starred"}}
+				{{svg "octicon-star"}} {{ctx.Locale.Tr "user.starred"}}
 				{{if .ContextUser.NumStars}}
 					<div class="ui small label">{{.ContextUser.NumStars}}</div>
 				{{end}}
 			</a>
 		{{else}}
 			<a class="{{if eq .TabName "watching"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=watching">
-				{{svg "octicon-eye"}} {{.locale.Tr "user.watched"}}
+				{{svg "octicon-eye"}} {{ctx.Locale.Tr "user.watched"}}
 			</a>
 		{{end}}
 	{{end}}
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index 2b81a23492..426b5f042a 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -13,7 +13,7 @@
 				{{if eq .TabName "activity"}}
 					{{if .ContextUser.KeepActivityPrivate}}
 						<div class="ui info message">
-							<p>{{.locale.Tr "user.disabled_public_activity"}}</p>
+							<p>{{ctx.Locale.Tr "user.disabled_public_activity"}}</p>
 						</div>
 					{{end}}
 					{{template "user/heatmap" .}}
diff --git a/templates/user/settings/account.tmpl b/templates/user/settings/account.tmpl
index 173cd5e991..6e8386988a 100644
--- a/templates/user/settings/account.tmpl
+++ b/templates/user/settings/account.tmpl
@@ -1,7 +1,7 @@
 {{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings account")}}
 	<div class="user-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.password"}}
+			{{ctx.Locale.Tr "settings.password"}}
 		</h4>
 		<div class="ui attached segment">
 			{{if or (.SignedUser.IsLocal) (.SignedUser.IsOAuth2)}}
@@ -10,39 +10,39 @@
 				{{.CsrfTokenHtml}}
 				{{if .SignedUser.IsPasswordSet}}
 				<div class="required field {{if .Err_OldPassword}}error{{end}}">
-					<label for="old_password">{{.locale.Tr "settings.old_password"}}</label>
+					<label for="old_password">{{ctx.Locale.Tr "settings.old_password"}}</label>
 					<input id="old_password" name="old_password" type="password" autocomplete="current-password" autofocus required>
 				</div>
 				{{end}}
 				<div class="required field {{if .Err_Password}}error{{end}}">
-					<label for="password">{{.locale.Tr "settings.new_password"}}</label>
+					<label for="password">{{ctx.Locale.Tr "settings.new_password"}}</label>
 					<input id="password" name="password" type="password" autocomplete="new-password" required>
 				</div>
 				<div class="required field {{if .Err_Password}}error{{end}}">
-					<label for="retype">{{.locale.Tr "settings.retype_new_password"}}</label>
+					<label for="retype">{{ctx.Locale.Tr "settings.retype_new_password"}}</label>
 					<input id="retype" name="retype" type="password" autocomplete="new-password" required>
 				</div>
 
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "settings.change_password"}}</button>
-					<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.locale.Tr "auth.forgot_password"}}</a>
+					<button class="ui primary button">{{ctx.Locale.Tr "settings.change_password"}}</button>
+					<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
 				</div>
 			</form>
 			{{else}}
 			<div class="ui info message">
-				<p class="text left">{{$.locale.Tr "settings.password_change_disabled"}}</p>
+				<p class="text left">{{ctx.Locale.Tr "settings.password_change_disabled"}}</p>
 			</div>
 			{{end}}
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.manage_emails"}}
+			{{ctx.Locale.Tr "settings.manage_emails"}}
 		</h4>
 		<div class="ui attached segment">
 			<div class="ui list">
 				{{if $.EnableNotifyMail}}
 				<div class="item">
-					<div class="gt-mb-3">{{.locale.Tr "settings.email_desc"}}</div>
+					<div class="gt-mb-3">{{ctx.Locale.Tr "settings.email_desc"}}</div>
 					<form action="{{AppSubUrl}}/user/settings/account/email" class="ui form" method="post">
 						{{$.CsrfTokenHtml}}
 						<input name="_method" type="hidden" value="NOTIFICATION">
@@ -52,13 +52,13 @@
 								{{svg "octicon-triangle-down" 14 "dropdown icon"}}
 								<div class="text"></div>
 								<div class="menu">
-									<div data-value="enabled" class="{{if eq .EmailNotificationsPreference "enabled"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.enable"}}</div>
-									<div data-value="andyourown" class="{{if eq .EmailNotificationsPreference "andyourown"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.andyourown"}}</div>
-									<div data-value="onmention" class="{{if eq .EmailNotificationsPreference "onmention"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.onmention"}}</div>
-									<div data-value="disabled" class="{{if eq .EmailNotificationsPreference "disabled"}}active selected {{end}}item">{{$.locale.Tr "settings.email_notifications.disable"}}</div>
+									<div data-value="enabled" class="{{if eq .EmailNotificationsPreference "enabled"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.enable"}}</div>
+									<div data-value="andyourown" class="{{if eq .EmailNotificationsPreference "andyourown"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.andyourown"}}</div>
+									<div data-value="onmention" class="{{if eq .EmailNotificationsPreference "onmention"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.onmention"}}</div>
+									<div data-value="disabled" class="{{if eq .EmailNotificationsPreference "disabled"}}active selected {{end}}item">{{ctx.Locale.Tr "settings.email_notifications.disable"}}</div>
 								</div>
 							</div>
-							<button class="ui primary button">{{$.locale.Tr "settings.email_notifications.submit"}}</button>
+							<button class="ui primary button">{{ctx.Locale.Tr "settings.email_notifications.submit"}}</button>
 						</div>
 					</form>
 				</div>
@@ -68,7 +68,7 @@
 						{{if not .IsPrimary}}
 							<div class="right floated content">
 								<button class="ui red tiny button delete-button" data-modal-id="delete-email" data-url="{{AppSubUrl}}/user/settings/account/email/delete" data-id="{{.ID}}">
-									{{$.locale.Tr "settings.delete_email"}}
+									{{ctx.Locale.Tr "settings.delete_email"}}
 								</button>
 							</div>
 							{{if .CanBePrimary}}
@@ -77,7 +77,7 @@
 										{{$.CsrfTokenHtml}}
 										<input name="_method" type="hidden" value="PRIMARY">
 										<input name="id" type="hidden" value="{{.ID}}">
-										<button class="ui primary tiny button">{{$.locale.Tr "settings.primary_email"}}</button>
+										<button class="ui primary tiny button">{{ctx.Locale.Tr "settings.primary_email"}}</button>
 									</form>
 								</div>
 							{{end}}
@@ -89,9 +89,9 @@
 									<input name="_method" type="hidden" value="SENDACTIVATION">
 									<input name="id" type="hidden" value="{{.ID}}">
 									{{if $.ActivationsPending}}
-										<button disabled class="ui primary tiny button">{{$.locale.Tr "settings.activations_pending"}}</button>
+										<button disabled class="ui primary tiny button">{{ctx.Locale.Tr "settings.activations_pending"}}</button>
 									{{else}}
-										<button class="ui primary tiny button">{{$.locale.Tr "settings.activate_email"}}</button>
+										<button class="ui primary tiny button">{{ctx.Locale.Tr "settings.activate_email"}}</button>
 									{{end}}
 								</form>
 							</div>
@@ -99,12 +99,12 @@
 						<div class="content gt-py-3">
 							<strong>{{.Email}}</strong>
 							{{if .IsPrimary}}
-								<div class="ui primary label">{{$.locale.Tr "settings.primary"}}</div>
+								<div class="ui primary label">{{ctx.Locale.Tr "settings.primary"}}</div>
 							{{end}}
 							{{if .IsActivated}}
-								<div class="ui green label">{{$.locale.Tr "settings.activated"}}</div>
+								<div class="ui green label">{{ctx.Locale.Tr "settings.activated"}}</div>
 							{{else}}
-								<div class="ui label">{{$.locale.Tr "settings.requires_activation"}}</div>
+								<div class="ui label">{{ctx.Locale.Tr "settings.requires_activation"}}</div>
 							{{end}}
 						</div>
 					</div>
@@ -115,41 +115,41 @@
 			<form class="ui form" action="{{AppSubUrl}}/user/settings/account/email" method="post">
 				{{.CsrfTokenHtml}}
 				<div class="required field {{if .Err_Email}}error{{end}}">
-					<label for="email">{{.locale.Tr "settings.add_new_email"}}</label>
+					<label for="email">{{ctx.Locale.Tr "settings.add_new_email"}}</label>
 					<input id="email" name="email" type="email" required {{if not .CanAddEmails}}disabled{{end}}>
 				</div>
 				<button class="ui primary button" {{if not .CanAddEmails}}disabled{{end}}>
-					{{.locale.Tr "settings.add_email"}}
+					{{ctx.Locale.Tr "settings.add_email"}}
 				</button>
 			</form>
 			{{/* if ActivationsPending is false, then CanAddEmails must be true, so if CanAddEmails is false, ActivationsPending must be true */}}
 			{{if not .CanAddEmails}}
-				<div class="ui warning message">{{.locale.Tr "settings.can_not_add_email_activations_pending"}}</div>
+				<div class="ui warning message">{{ctx.Locale.Tr "settings.can_not_add_email_activations_pending"}}</div>
 			{{end}}
 		</div>
 
 		<h4 class="ui top attached error header">
-			{{.locale.Tr "settings.delete_account"}}
+			{{ctx.Locale.Tr "settings.delete_account"}}
 		</h4>
 		<div class="ui attached error segment">
 			<div class="ui red message">
-				<p class="text left">{{svg "octicon-alert"}} {{.locale.Tr "settings.delete_prompt" | Str2html}}</p>
+				<p class="text left">{{svg "octicon-alert"}} {{ctx.Locale.Tr "settings.delete_prompt" | Str2html}}</p>
 				{{if .UserDeleteWithComments}}
-				<p class="text left gt-font-semibold">{{.locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime | Str2html}}</p>
+				<p class="text left gt-font-semibold">{{ctx.Locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime | Str2html}}</p>
 				{{end}}
 			</div>
 			<form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post">
 				{{template "base/disable_form_autofill"}}
 				{{.CsrfTokenHtml}}
 				<div class="required field {{if .Err_Password}}error{{end}}">
-					<label for="password-confirmation">{{.locale.Tr "password"}}</label>
+					<label for="password-confirmation">{{ctx.Locale.Tr "password"}}</label>
 					<input id="password-confirmation" name="password" type="password" autocomplete="off" required>
 				</div>
 				<div class="field">
 					<button class="ui red button delete-button" data-modal-id="delete-account" data-type="form" data-form="#delete-form">
-						{{.locale.Tr "settings.confirm_delete_account"}}
+						{{ctx.Locale.Tr "settings.confirm_delete_account"}}
 					</button>
-					<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.locale.Tr "auth.forgot_password"}}</a>
+					<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
 				</div>
 			</form>
 		</div>
@@ -158,10 +158,10 @@
 <div class="ui g-modal-confirm delete modal" id="delete-email">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "settings.email_deletion"}}
+		{{ctx.Locale.Tr "settings.email_deletion"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "settings.email_deletion_desc"}}</p>
+		<p>{{ctx.Locale.Tr "settings.email_deletion_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
@@ -169,10 +169,10 @@
 <div class="ui g-modal-confirm delete modal" id="delete-account">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "settings.delete_account_title"}}
+		{{ctx.Locale.Tr "settings.delete_account_title"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "settings.delete_account_desc"}}</p>
+		<p>{{ctx.Locale.Tr "settings.delete_account_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/user/settings/appearance.tmpl b/templates/user/settings/appearance.tmpl
index ca7ef15de5..0997d721e1 100644
--- a/templates/user/settings/appearance.tmpl
+++ b/templates/user/settings/appearance.tmpl
@@ -3,18 +3,18 @@
 
 		<!-- Theme -->
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.manage_themes"}}
+			{{ctx.Locale.Tr "settings.manage_themes"}}
 		</h4>
 		<div class="ui attached segment">
 			<div class="ui email list">
 				<div class="item">
-					{{.locale.Tr "settings.theme_desc"}}
+					{{ctx.Locale.Tr "settings.theme_desc"}}
 				</div>
 
 			<form class="ui form" action="{{.Link}}/theme" method="post">
 				{{.CsrfTokenHtml}}
 					<div class="field">
-						<label for="ui">{{.locale.Tr "settings.ui"}}</label>
+						<label for="ui">{{ctx.Locale.Tr "settings.ui"}}</label>
 						<div class="ui selection dropdown" id="ui">
 							<input name="theme" type="hidden" value="{{.SignedUser.Theme}}">
 							{{svg "octicon-triangle-down" 14 "dropdown icon"}}
@@ -35,7 +35,7 @@
 					</div>
 
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "settings.update_theme"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "settings.update_theme"}}</button>
 				</div>
 			</form>
 			</div>
@@ -43,7 +43,7 @@
 
 		<!-- Language -->
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.language"}}
+			{{ctx.Locale.Tr "settings.language"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="{{.Link}}/language" method="post">
@@ -61,108 +61,108 @@
 					</div>
 				</div>
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "settings.update_language"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "settings.update_language"}}</button>
 				</div>
 			</form>
 		</div>
 
 		<!-- Shown comment event types -->
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.hidden_comment_types"}}
+			{{ctx.Locale.Tr "settings.hidden_comment_types"}}
 		</h4>
 		<div class="ui attached segment">
 			<p class="help">
-				{{.locale.Tr "settings.hidden_comment_types_description"}}
+				{{ctx.Locale.Tr "settings.hidden_comment_types_description"}}
 			</p>
 			<form class="ui form" action="{{.Link}}/hidden_comments" method="post">
 				{{.CsrfTokenHtml}}
 				<div class="inline field">
-					<div class="ui checkbox" data-tooltip-content="{{.locale.Tr "settings.hidden_comment_types.ref_tooltip"}}">
+					<div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "settings.hidden_comment_types.ref_tooltip"}}">
 						<input name="reference" type="checkbox" {{if(call .IsCommentTypeGroupChecked "reference")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_reference"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_reference"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="label" type="checkbox" {{if (call .IsCommentTypeGroupChecked "label")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_label"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_label"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="milestone" type="checkbox" {{if (call .IsCommentTypeGroupChecked "milestone")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_milestone"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_milestone"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="assignee" type="checkbox" {{if (call .IsCommentTypeGroupChecked "assignee")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_assignee"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_assignee"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="title" type="checkbox" {{if (call .IsCommentTypeGroupChecked "title")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_title"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_title"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="branch" type="checkbox" {{if (call .IsCommentTypeGroupChecked "branch")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_branch"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_branch"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="time_tracking" type="checkbox" {{if (call .IsCommentTypeGroupChecked "time_tracking")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_time_tracking"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_time_tracking"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="deadline" type="checkbox" {{if (call .IsCommentTypeGroupChecked "deadline")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_deadline"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_deadline"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="dependency" type="checkbox" {{if (call .IsCommentTypeGroupChecked "dependency")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_dependency"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_dependency"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="lock" type="checkbox" {{if (call .IsCommentTypeGroupChecked "lock")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_lock"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_lock"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="review_request" type="checkbox" {{if (call .IsCommentTypeGroupChecked "review_request")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_review_request"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_review_request"}}</label>
 					</div>
 				</div>
 
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="pull_request_push" type="checkbox" {{if (call .IsCommentTypeGroupChecked "pull_request_push")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_pull_request_push"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_pull_request_push"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
 					<div class="ui checkbox">
 						<input name="project" type="checkbox" {{if (call .IsCommentTypeGroupChecked "project")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_project"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_project"}}</label>
 					</div>
 				</div>
 				<div class="inline field">
-					<div class="ui checkbox" data-tooltip-content="{{.locale.Tr "settings.hidden_comment_types.issue_ref_tooltip"}}">
+					<div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "settings.hidden_comment_types.issue_ref_tooltip"}}">
 						<input name="issue_ref" type="checkbox" {{if (call .IsCommentTypeGroupChecked "issue_ref")}}checked{{end}}>
-						<label>{{.locale.Tr "settings.comment_type_group_issue_ref"}}</label>
+						<label>{{ctx.Locale.Tr "settings.comment_type_group_issue_ref"}}</label>
 					</div>
 				</div>
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "save"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
 				</div>
 			</form>
 		</div>
diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl
index 0d37e717e6..7553c798dc 100644
--- a/templates/user/settings/applications.tmpl
+++ b/templates/user/settings/applications.tmpl
@@ -1,17 +1,17 @@
 {{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings applications")}}
 	<div class="user-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.manage_access_token"}}
+			{{ctx.Locale.Tr "settings.manage_access_token"}}
 		</h4>
 		<div class="ui attached segment">
 			<div class="flex-list">
 				<div class="flex-item">
-					{{.locale.Tr "settings.tokens_desc"}}
+					{{ctx.Locale.Tr "settings.tokens_desc"}}
 				</div>
 				{{range .Tokens}}
 					<div class="flex-item">
 						<div class="flex-item-leading">
-							<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.token_state_desc"}}"{{end}}>
+							<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.token_state_desc"}}"{{end}}>
 								{{svg "fontawesome-send" 32}}
 							</span>
 						</div>
@@ -19,14 +19,14 @@
 							<details>
 								<summary><span class="flex-item-title">{{.Name}}</span></summary>
 								<p class="gt-my-2">
-									{{$.locale.Tr "settings.repo_and_org_access"}}:
+									{{ctx.Locale.Tr "settings.repo_and_org_access"}}:
 									{{if .DisplayPublicOnly}}
-										{{$.locale.Tr "settings.permissions_public_only"}}
+										{{ctx.Locale.Tr "settings.permissions_public_only"}}
 									{{else}}
-										{{$.locale.Tr "settings.permissions_access_all"}}
+										{{ctx.Locale.Tr "settings.permissions_access_all"}}
 									{{end}}
 								</p>
-								<p class="gt-my-2">{{$.locale.Tr "settings.permissions_list"}}</p>
+								<p class="gt-my-2">{{ctx.Locale.Tr "settings.permissions_list"}}</p>
 								<ul class="gt-my-2">
 								{{range .Scope.StringSlice}}
 									{{if (ne . $.AccessTokenScopePublicOnly)}}
@@ -36,13 +36,13 @@
 								</ul>
 							</details>
 							<div class="flex-item-body">
-								<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info"}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}}</i>
+								<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}}</i>
 							</div>
 						</div>
 						<div class="flex-item-trailing">
 								<button class="ui red tiny button delete-button" data-modal-id="delete-token" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
 									{{svg "octicon-trash" 16 "gt-mr-2"}}
-									{{$.locale.Tr "settings.delete_token"}}
+									{{ctx.Locale.Tr "settings.delete_token"}}
 								</button>
 						</div>
 					</div>
@@ -51,47 +51,47 @@
 		</div>
 		<div class="ui attached bottom segment">
 			<h5 class="ui top header">
-				{{.locale.Tr "settings.generate_new_token"}}
+				{{ctx.Locale.Tr "settings.generate_new_token"}}
 			</h5>
 			<form id="scoped-access-form" class="ui form ignore-dirty" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<div class="field {{if .Err_Name}}error{{end}}">
-					<label for="name">{{.locale.Tr "settings.token_name"}}</label>
+					<label for="name">{{ctx.Locale.Tr "settings.token_name"}}</label>
 					<input id="name" name="name" value="{{.name}}" autofocus required maxlength="255">
 				</div>
 				<div class="field">
-					<label>{{.locale.Tr "settings.repo_and_org_access"}}</label>
+					<label>{{ctx.Locale.Tr "settings.repo_and_org_access"}}</label>
 					<label class="gt-cursor-pointer">
 						<input class="enable-system gt-mt-2 gt-mr-2" type="radio" name="scope" value="{{$.AccessTokenScopePublicOnly}}">
-						{{.locale.Tr "settings.permissions_public_only"}}
+						{{ctx.Locale.Tr "settings.permissions_public_only"}}
 					</label>
 					<label class="gt-cursor-pointer">
 						<input class="enable-system gt-mt-2 gt-mr-2" type="radio" name="scope" value="" checked>
-						{{.locale.Tr "settings.permissions_access_all"}}
+						{{ctx.Locale.Tr "settings.permissions_access_all"}}
 					</label>
 				</div>
 				<details class="ui optional field">
 					<summary class="gt-pb-4 gt-pl-2">
-						{{.locale.Tr "settings.select_permissions"}}
+						{{ctx.Locale.Tr "settings.select_permissions"}}
 					</summary>
 					<p class="activity meta">
-						<i>{{$.locale.Tr "settings.access_token_desc" (printf `href="/api/swagger" target="_blank"`) (printf `href="https://docs.gitea.com/development/oauth2-provider#scopes" target="_blank"`) | Str2html}}</i>
+						<i>{{ctx.Locale.Tr "settings.access_token_desc" (printf `href="/api/swagger" target="_blank"`) (printf `href="https://docs.gitea.com/development/oauth2-provider#scopes" target="_blank"`) | Str2html}}</i>
 					</p>
 					<div class="scoped-access-token-mount">
 						<scoped-access-token-selector
 							:is-admin="{{if .IsAdmin}}true{{else}}false{{end}}"
-							no-access-label="{{.locale.Tr "settings.permission_no_access"}}"
-							read-label="{{.locale.Tr "settings.permission_read"}}"
-							write-label="{{.locale.Tr "settings.permission_write"}}"
+							no-access-label="{{ctx.Locale.Tr "settings.permission_no_access"}}"
+							read-label="{{ctx.Locale.Tr "settings.permission_read"}}"
+							write-label="{{ctx.Locale.Tr "settings.permission_write"}}"
 						></scoped-access-token-selector>
 					</div>
 				</details>
 				<button id="scoped-access-submit" class="ui primary button">
-					{{.locale.Tr "settings.generate_token"}}
+					{{ctx.Locale.Tr "settings.generate_token"}}
 				</button>
 			</form>{{/* Fomantic ".ui.form .warning.message" is hidden by default, so put the warning message out of the form*/}}
 			<div id="scoped-access-warning" class="ui warning message center gt-hidden">
-				{{.locale.Tr "settings.at_least_one_permission"}}
+				{{ctx.Locale.Tr "settings.at_least_one_permission"}}
 			</div>
 		</div>
 
@@ -104,10 +104,10 @@
 <div class="ui g-modal-confirm delete modal" id="delete-token">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "settings.access_token_deletion"}}
+		{{ctx.Locale.Tr "settings.access_token_deletion"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "settings.access_token_deletion_desc"}}</p>
+		<p>{{ctx.Locale.Tr "settings.access_token_deletion_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" (dict "ModalButtonColors" "yellow")}}
 </div>
diff --git a/templates/user/settings/applications_oauth2.tmpl b/templates/user/settings/applications_oauth2.tmpl
index 47d8dfc2de..866a1f87d3 100644
--- a/templates/user/settings/applications_oauth2.tmpl
+++ b/templates/user/settings/applications_oauth2.tmpl
@@ -1,5 +1,5 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "settings.manage_oauth2_applications"}}
+	{{ctx.Locale.Tr "settings.manage_oauth2_applications"}}
 </h4>
 
 {{template "user/settings/applications_oauth2_list" .}}
diff --git a/templates/user/settings/applications_oauth2_edit_form.tmpl b/templates/user/settings/applications_oauth2_edit_form.tmpl
index 1437277009..c0bddd55b3 100644
--- a/templates/user/settings/applications_oauth2_edit_form.tmpl
+++ b/templates/user/settings/applications_oauth2_edit_form.tmpl
@@ -1,23 +1,23 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "settings.edit_oauth2_application"}}
+	{{ctx.Locale.Tr "settings.edit_oauth2_application"}}
 </h4>
 <div class="ui attached segment">
-	<p>{{.locale.Tr "settings.oauth2_application_create_description"}}</p>
+	<p>{{ctx.Locale.Tr "settings.oauth2_application_create_description"}}</p>
 </div>
 <div class="ui attached segment form ignore-dirty">
 	{{.CsrfTokenHtml}}
 	<div class="field">
-		<label for="client-id">{{.locale.Tr "settings.oauth2_client_id"}}</label>
+		<label for="client-id">{{ctx.Locale.Tr "settings.oauth2_client_id"}}</label>
 		<input id="client-id" readonly value="{{.App.ClientID}}">
 	</div>
 	{{if .ClientSecret}}
 		<div class="field">
-			<label for="client-secret">{{.locale.Tr "settings.oauth2_client_secret"}}</label>
+			<label for="client-secret">{{ctx.Locale.Tr "settings.oauth2_client_secret"}}</label>
 			<input id="client-secret" type="text" readonly value="{{.ClientSecret}}">
 		</div>
 	{{else}}
 		<div class="field">
-			<label for="client-secret">{{.locale.Tr "settings.oauth2_client_secret"}}</label>
+			<label for="client-secret">{{ctx.Locale.Tr "settings.oauth2_client_secret"}}</label>
 			<input id="client-secret" type="password" readonly value="averysecuresecret">
 		</div>
 	{{end}}
@@ -25,8 +25,8 @@
 		<!-- TODO add regenerate secret functionality */ -->
 		<form class="ui form ignore-dirty" action="{{.FormActionPath}}/regenerate_secret" method="post">
 			{{.CsrfTokenHtml}}
-			{{.locale.Tr "settings.oauth2_regenerate_secret_hint"}}
-			<button class="ui mini button gt-ml-3" type="submit">{{.locale.Tr "settings.oauth2_regenerate_secret"}}</button>
+			{{ctx.Locale.Tr "settings.oauth2_regenerate_secret_hint"}}
+			<button class="ui mini button gt-ml-3" type="submit">{{ctx.Locale.Tr "settings.oauth2_regenerate_secret"}}</button>
 		</form>
 	</div>
 </div>
@@ -34,19 +34,19 @@
 	<form class="ui form ignore-dirty" action="{{.FormActionPath}}" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="field {{if .Err_AppName}}error{{end}}">
-			<label for="application-name">{{.locale.Tr "settings.oauth2_application_name"}}</label>
+			<label for="application-name">{{ctx.Locale.Tr "settings.oauth2_application_name"}}</label>
 			<input id="application-name" value="{{.App.Name}}" name="application_name" required maxlength="255">
 		</div>
 		<div class="field {{if .Err_RedirectURI}}error{{end}}">
-			<label for="redirect-uris">{{.locale.Tr "settings.oauth2_redirect_uris"}}</label>
+			<label for="redirect-uris">{{ctx.Locale.Tr "settings.oauth2_redirect_uris"}}</label>
 			<textarea name="redirect_uris" id="redirect-uris" required>{{StringUtils.Join .App.RedirectURIs "\n"}}</textarea>
 		</div>
 		<div class="field ui checkbox {{if .Err_ConfidentialClient}}error{{end}}">
-			<label>{{.locale.Tr "settings.oauth2_confidential_client"}}</label>
+			<label>{{ctx.Locale.Tr "settings.oauth2_confidential_client"}}</label>
 			<input type="checkbox" name="confidential_client" {{if .App.ConfidentialClient}}checked{{end}}>
 		</div>
 		<button class="ui primary button">
-			{{.locale.Tr "settings.save_application"}}
+			{{ctx.Locale.Tr "settings.save_application"}}
 		</button>
 	</form>
 </div>
diff --git a/templates/user/settings/applications_oauth2_list.tmpl b/templates/user/settings/applications_oauth2_list.tmpl
index a92909f77f..bf6b28ec5f 100644
--- a/templates/user/settings/applications_oauth2_list.tmpl
+++ b/templates/user/settings/applications_oauth2_list.tmpl
@@ -1,7 +1,7 @@
 <div class="ui attached segment">
 	<div class="flex-list">
 		<div class="flex-item">
-			{{.locale.Tr "settings.oauth2_application_create_description"}}
+			{{ctx.Locale.Tr "settings.oauth2_application_create_description"}}
 		</div>
 		{{range .Applications}}
 			<div class="flex-item gt-ac">
@@ -11,23 +11,23 @@
 				<div class="flex-item-main">
 					<div class="flex-item-title">{{.Name}}</div>
 					<div class="flex-item-body">
-						{{$.locale.Tr "settings.oauth2_client_id"}}
+						{{ctx.Locale.Tr "settings.oauth2_client_id"}}
 						<span class="ui label">{{.ClientID}}</span>
 					</div>
 				</div>
 				{{$isBuiltin := and $.BuiltinApplications (index $.BuiltinApplications .ClientID)}}
 				<div class="flex-item-trailing">
 					{{if $isBuiltin}}
-						<span class="ui basic label" data-tooltip-content="{{$.locale.Tr "settings.oauth2_application_locked"}}">{{ctx.Locale.Tr "locked"}}</span>
+						<span class="ui basic label" data-tooltip-content="{{ctx.Locale.Tr "settings.oauth2_application_locked"}}">{{ctx.Locale.Tr "locked"}}</span>
 					{{else}}
 						<a href="{{$.Link}}/oauth2/{{.ID}}" class="ui primary tiny button">
 							{{svg "octicon-pencil" 16 "gt-mr-2"}}
-							{{$.locale.Tr "settings.oauth2_application_edit"}}
+							{{ctx.Locale.Tr "settings.oauth2_application_edit"}}
 						</a>
 						<button class="ui red tiny button delete-button" data-modal-id="remove-gitea-oauth2-application"
 								data-url="{{$.Link}}/oauth2/{{.ID}}/delete">
 							{{svg "octicon-trash" 16 "gt-mr-2"}}
-							{{$.locale.Tr "settings.delete_key"}}
+							{{ctx.Locale.Tr "settings.delete_key"}}
 						</button>
 					{{end}}
 				</div>
@@ -38,10 +38,10 @@
 	<div class="ui g-modal-confirm delete modal" id="remove-gitea-oauth2-application">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "settings.remove_oauth2_application"}}
+			{{ctx.Locale.Tr "settings.remove_oauth2_application"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "settings.oauth2_application_remove_description"}}</p>
+			<p>{{ctx.Locale.Tr "settings.oauth2_application_remove_description"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
@@ -49,24 +49,24 @@
 
 <div class="ui attached bottom segment">
 	<h5 class="ui top header">
-		{{.locale.Tr "settings.create_oauth2_application"}}
+		{{ctx.Locale.Tr "settings.create_oauth2_application"}}
 	</h5>
 	<form class="ui form ignore-dirty" action="{{.Link}}/oauth2" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="field {{if .Err_AppName}}error{{end}}">
-			<label for="application-name">{{.locale.Tr "settings.oauth2_application_name"}}</label>
+			<label for="application-name">{{ctx.Locale.Tr "settings.oauth2_application_name"}}</label>
 			<input id="application-name" name="application_name" value="{{.application_name}}" required maxlength="255">
 		</div>
 		<div class="field {{if .Err_RedirectURI}}error{{end}}">
-			<label for="redirect-uris">{{.locale.Tr "settings.oauth2_redirect_uris"}}</label>
+			<label for="redirect-uris">{{ctx.Locale.Tr "settings.oauth2_redirect_uris"}}</label>
 			<textarea name="redirect_uris" id="redirect-uris"></textarea>
 		</div>
 		<div class="field ui checkbox {{if .Err_ConfidentialClient}}error{{end}}">
-			<label>{{.locale.Tr "settings.oauth2_confidential_client"}}</label>
+			<label>{{ctx.Locale.Tr "settings.oauth2_confidential_client"}}</label>
 			<input type="checkbox" name="confidential_client" checked>
 		</div>
 		<button class="ui primary button">
-			{{.locale.Tr "settings.create_oauth2_application_button"}}
+			{{ctx.Locale.Tr "settings.create_oauth2_application_button"}}
 		</button>
 	</form>
 </div>
diff --git a/templates/user/settings/grants_oauth2.tmpl b/templates/user/settings/grants_oauth2.tmpl
index dbe7d0409f..3c4c6e80d4 100644
--- a/templates/user/settings/grants_oauth2.tmpl
+++ b/templates/user/settings/grants_oauth2.tmpl
@@ -1,10 +1,10 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "settings.authorized_oauth2_applications"}}
+	{{ctx.Locale.Tr "settings.authorized_oauth2_applications"}}
 </h4>
 <div class="ui attached segment">
 	<div class="flex-list">
 		<div class="flex-item">
-			{{.locale.Tr "settings.authorized_oauth2_applications_description"}}
+			{{ctx.Locale.Tr "settings.authorized_oauth2_applications_description"}}
 		</div>
 		{{range .Grants}}
 			<div class="flex-item">
@@ -14,13 +14,13 @@
 				<div class="flex-item-main">
 					<div class="flex-item-title">{{.Application.Name}}</div>
 					<div class="flex-item-body">
-						<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}}</i>
+						<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}}</i>
 					</div>
 				</div>
 				<div class="flex-item-trailing">
 					<button class="ui red tiny button delete-button" data-modal-id="revoke-gitea-oauth2-grant"
 							data-url="{{AppSubUrl}}/user/settings/applications/oauth2/{{.ApplicationID}}/revoke/{{.ID}}">
-						{{$.locale.Tr "settings.revoke_key"}}
+						{{ctx.Locale.Tr "settings.revoke_key"}}
 					</button>
 				</div>
 			</div>
@@ -30,10 +30,10 @@
 	<div class="ui g-modal-confirm delete modal" id="revoke-gitea-oauth2-grant">
 		<div class="header">
 			{{svg "octicon-shield" 16 "gt-mr-2"}}
-			{{.locale.Tr "settings.revoke_oauth2_grant"}}
+			{{ctx.Locale.Tr "settings.revoke_oauth2_grant"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "settings.revoke_oauth2_grant_description"}}</p>
+			<p>{{ctx.Locale.Tr "settings.revoke_oauth2_grant_description"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/user/settings/hook_new.tmpl b/templates/user/settings/hook_new.tmpl
index 9a857db85c..be21f59b9c 100644
--- a/templates/user/settings/hook_new.tmpl
+++ b/templates/user/settings/hook_new.tmpl
@@ -1,7 +1,7 @@
 {{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings new webhook")}}
 	<div class="user-setting-content">
-		{{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}}
-		{{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}{{end}}
+		{{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}}
+		{{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}{{end}}
 		{{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
 	</div>
 {{template "user/settings/layout_footer" .}}
diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl
index 467b275d35..bd560fa325 100644
--- a/templates/user/settings/keys_gpg.tmpl
+++ b/templates/user/settings/keys_gpg.tmpl
@@ -1,7 +1,7 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "settings.manage_gpg_keys"}}
+	{{ctx.Locale.Tr "settings.manage_gpg_keys"}}
 	<div class="ui right">
-		<button class="ui primary tiny show-panel toggle button" data-panel="#add-gpg-key-panel">{{.locale.Tr "settings.add_key"}}</button>
+		<button class="ui primary tiny show-panel toggle button" data-panel="#add-gpg-key-panel">{{ctx.Locale.Tr "settings.add_key"}}</button>
 	</div>
 </h4>
 <div class="ui attached segment">
@@ -10,40 +10,40 @@
 			{{.CsrfTokenHtml}}
 			<input type="hidden" name="title" value="none">
 			<div class="field {{if .Err_Content}}error{{end}}">
-				<label for="content">{{.locale.Tr "settings.key_content"}}</label>
-				<textarea id="gpg-key-content" name="content" placeholder="{{.locale.Tr "settings.key_content_gpg_placeholder"}}" required>{{.content}}</textarea>
+				<label for="content">{{ctx.Locale.Tr "settings.key_content"}}</label>
+				<textarea id="gpg-key-content" name="content" placeholder="{{ctx.Locale.Tr "settings.key_content_gpg_placeholder"}}" required>{{.content}}</textarea>
 			</div>
 			{{if .Err_Signature}}
 				<div class="ui error message">
-					<p>{{.locale.Tr "settings.gpg_token_required"}}</p>
+					<p>{{ctx.Locale.Tr "settings.gpg_token_required"}}</p>
 				</div>
 				<div class="field">
-					<label for="token">{{.locale.Tr "settings.gpg_token"}}</label>
+					<label for="token">{{ctx.Locale.Tr "settings.gpg_token"}}</label>
 					<input readonly="" value="{{.TokenToSign}}">
 					<div class="help">
-						<p>{{.locale.Tr "settings.gpg_token_help"}}</p>
-						<p><code>{{$.locale.Tr "settings.gpg_token_code" .TokenToSign .PaddedKeyID}}</code></p>
+						<p>{{ctx.Locale.Tr "settings.gpg_token_help"}}</p>
+						<p><code>{{ctx.Locale.Tr "settings.gpg_token_code" .TokenToSign .PaddedKeyID}}</code></p>
 					</div>
 				</div>
 				<div class="field">
-					<label for="signature">{{.locale.Tr "settings.gpg_token_signature"}}</label>
-					<textarea id="gpg-key-signature" name="signature" placeholder="{{.locale.Tr "settings.key_signature_gpg_placeholder"}}" required>{{.signature}}</textarea>
+					<label for="signature">{{ctx.Locale.Tr "settings.gpg_token_signature"}}</label>
+					<textarea id="gpg-key-signature" name="signature" placeholder="{{ctx.Locale.Tr "settings.key_signature_gpg_placeholder"}}" required>{{.signature}}</textarea>
 				</div>
 			{{end}}
 			<input name="type" type="hidden" value="gpg">
 			<button class="ui primary button">
-				{{.locale.Tr "settings.add_key"}}
+				{{ctx.Locale.Tr "settings.add_key"}}
 			</button>
 			<button class="ui hide-panel button" data-panel="#add-gpg-key-panel">
-				{{.locale.Tr "cancel"}}
+				{{ctx.Locale.Tr "cancel"}}
 			</button>
 		</form>
 	</div>
 	<div class="flex-list">
 		<div class="flex-item">
 			<p>
-				{{.locale.Tr "settings.gpg_desc"}}<br>
-				{{.locale.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification" | Str2html}}
+				{{ctx.Locale.Tr "settings.gpg_desc"}}<br>
+				{{ctx.Locale.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification" | Str2html}}
 			</p>
 		</div>
 		{{range .GPGKeys}}
@@ -53,57 +53,57 @@
 				</div>
 				<div class="flex-item-main">
 					{{if .Verified}}
-						<span class="flex-text-block" data-tooltip-content="{{$.locale.Tr "settings.gpg_key_verified_long"}}">{{svg "octicon-verified"}} <strong>{{$.locale.Tr "settings.gpg_key_verified"}}</strong></span>
+						<span class="flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.gpg_key_verified_long"}}">{{svg "octicon-verified"}} <strong>{{ctx.Locale.Tr "settings.gpg_key_verified"}}</strong></span>
 					{{end}}
 					{{if gt (len .Emails) 0}}
-						<span class="flex-text-block" data-tooltip-content="{{$.locale.Tr "settings.gpg_key_matched_identities_long"}}">{{svg "octicon-mail"}} {{$.locale.Tr "settings.gpg_key_matched_identities"}} {{range .Emails}}<strong>{{.Email}} </strong>{{end}}</span>
+						<span class="flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.gpg_key_matched_identities_long"}}">{{svg "octicon-mail"}} {{ctx.Locale.Tr "settings.gpg_key_matched_identities"}} {{range .Emails}}<strong>{{.Email}} </strong>{{end}}</span>
 					{{end}}
 					<div class="flex-item-body">
-						<b>{{$.locale.Tr "settings.key_id"}}:</b> {{.PaddedKeyID}}
-						<b>{{$.locale.Tr "settings.subkeys"}}:</b> {{range .SubsKey}} {{.PaddedKeyID}} {{end}}
+						<b>{{ctx.Locale.Tr "settings.key_id"}}:</b> {{.PaddedKeyID}}
+						<b>{{ctx.Locale.Tr "settings.subkeys"}}:</b> {{range .SubsKey}} {{.PaddedKeyID}} {{end}}
 					</div>
 					<div class="flex-item-body">
-						<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .AddedUnix) | Safe}}</i>
+						<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .AddedUnix) | Safe}}</i>
 						-
-						<i>{{if not .ExpiredUnix.IsZero}}{{$.locale.Tr "settings.valid_until_date" (DateTime "short" .ExpiredUnix) | Safe}}{{else}}{{$.locale.Tr "settings.valid_forever"}}{{end}}</i>
+						<i>{{if not .ExpiredUnix.IsZero}}{{ctx.Locale.Tr "settings.valid_until_date" (DateTime "short" .ExpiredUnix) | Safe}}{{else}}{{ctx.Locale.Tr "settings.valid_forever"}}{{end}}</i>
 					</div>
 				</div>
 				<div class="flex-item-trailing">
 					<button class="ui red tiny button delete-button" data-modal-id="delete-gpg" data-url="{{$.Link}}/delete?type=gpg" data-id="{{.ID}}">
-						{{$.locale.Tr "settings.delete_key"}}
+						{{ctx.Locale.Tr "settings.delete_key"}}
 					</button>
 					{{if and (not .Verified) (ne $.VerifyingID .KeyID)}}
-						<a class="ui primary tiny button" href="{{$.Link}}?verify_gpg={{.KeyID}}">{{$.locale.Tr "settings.gpg_key_verify"}}</a>
+						<a class="ui primary tiny button" href="{{$.Link}}?verify_gpg={{.KeyID}}">{{ctx.Locale.Tr "settings.gpg_key_verify"}}</a>
 					{{end}}
 				</div>
 			</div>
 			{{if and (not .Verified) (eq $.VerifyingID .KeyID)}}
 				<div class="ui  segment">
-					<h4>{{$.locale.Tr "settings.gpg_token_required"}}</h4>
+					<h4>{{ctx.Locale.Tr "settings.gpg_token_required"}}</h4>
 					<form class="ui form{{if $.HasGPGVerifyError}} error{{end}}" action="{{$.Link}}" method="post">
 						{{$.CsrfTokenHtml}}
 						<input type="hidden" name="title" value="none">
 						<input type="hidden" name="content" value="{{.KeyID}}">
 						<input type="hidden" name="key_id" value="{{.KeyID}}">
 						<div class="field">
-							<label for="token">{{$.locale.Tr "settings.gpg_token"}}</label>
+							<label for="token">{{ctx.Locale.Tr "settings.gpg_token"}}</label>
 							<input readonly="" value="{{$.TokenToSign}}">
 							<div class="help">
-								<p>{{$.locale.Tr "settings.gpg_token_help"}}</p>
-								<p><code>{{$.locale.Tr "settings.gpg_token_code" $.TokenToSign .PaddedKeyID}}</code></p>
+								<p>{{ctx.Locale.Tr "settings.gpg_token_help"}}</p>
+								<p><code>{{ctx.Locale.Tr "settings.gpg_token_code" $.TokenToSign .PaddedKeyID}}</code></p>
 							</div>
 							<br>
 						</div>
 						<div class="field">
-							<label for="signature">{{$.locale.Tr "settings.gpg_token_signature"}}</label>
-							<textarea id="gpg-key-signature" name="signature" placeholder="{{$.locale.Tr "settings.key_signature_gpg_placeholder"}}" required>{{$.signature}}</textarea>
+							<label for="signature">{{ctx.Locale.Tr "settings.gpg_token_signature"}}</label>
+							<textarea id="gpg-key-signature" name="signature" placeholder="{{ctx.Locale.Tr "settings.key_signature_gpg_placeholder"}}" required>{{$.signature}}</textarea>
 						</div>
 						<input name="type" type="hidden" value="verify_gpg">
 						<button class="ui primary button">
-							{{$.locale.Tr "settings.gpg_key_verify"}}
+							{{ctx.Locale.Tr "settings.gpg_key_verify"}}
 						</button>
 						<a class="ui red button" href="{{$.Link}}">
-							{{$.locale.Tr "settings.cancel"}}
+							{{ctx.Locale.Tr "settings.cancel"}}
 						</a>
 					</form>
 				</div>
@@ -113,10 +113,10 @@
 	<div class="ui g-modal-confirm delete modal" id="delete-gpg">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "settings.gpg_key_deletion"}}
+			{{ctx.Locale.Tr "settings.gpg_key_deletion"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "settings.gpg_key_deletion_desc"}}</p>
+			<p>{{ctx.Locale.Tr "settings.gpg_key_deletion_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/user/settings/keys_principal.tmpl b/templates/user/settings/keys_principal.tmpl
index d9cc8fb823..513afc2b61 100644
--- a/templates/user/settings/keys_principal.tmpl
+++ b/templates/user/settings/keys_principal.tmpl
@@ -1,33 +1,33 @@
 {{if .AllowPrincipals}}
 	<h4 class="ui top attached header">
-		{{.locale.Tr "settings.manage_ssh_principals"}}
+		{{ctx.Locale.Tr "settings.manage_ssh_principals"}}
 		<div class="ui right">
 		{{if not .DisableSSH}}
-			<button class="ui primary tiny show-panel button" data-panel="#add-ssh-principal-panel">{{.locale.Tr "settings.add_new_principal"}}</button>
+			<button class="ui primary tiny show-panel button" data-panel="#add-ssh-principal-panel">{{ctx.Locale.Tr "settings.add_new_principal"}}</button>
 		{{else}}
-			<button class="ui primary tiny button disabled">{{.locale.Tr "settings.ssh_disabled"}}</button>
+			<button class="ui primary tiny button disabled">{{ctx.Locale.Tr "settings.ssh_disabled"}}</button>
 		{{end}}
 		</div>
 	</h4>
 	<div class="ui attached segment">
 		<div class="flex-list">
 			<div class="flex-item">
-				{{.locale.Tr "settings.principal_desc"}}
+				{{ctx.Locale.Tr "settings.principal_desc"}}
 			</div>
 			{{range .Principals}}
 				<div class="flex-item">
 					<div class="flex-item-leading">
-						<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
+						<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.principal_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
 					</div>
 					<div class="flex-item-main">
 						<div class="flex-item-title">{{.Name}}</div>
 						<div class="flex-item-body">
-							<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} —  {{svg "octicon-info" 16}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}}</i>
+							<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} —  {{svg "octicon-info" 16}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}}</i>
 						</div>
 					</div>
 					<div class="flex-item-trailing">
 						<button class="ui red tiny button delete-button" data-modal-id="delete-principal" data-url="{{$.Link}}/delete?type=principal" data-id="{{.ID}}">
-							{{$.locale.Tr "settings.delete_key"}}
+							{{ctx.Locale.Tr "settings.delete_key"}}
 						</button>
 					</div>
 				</div>
@@ -38,19 +38,19 @@
 
 	<div {{if not .HasPrincipalError}}class="gt-hidden"{{end}} id="add-ssh-principal-panel">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.add_new_principal"}}
+			{{ctx.Locale.Tr "settings.add_new_principal"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<div class="field {{if .Err_Content}}error{{end}}">
-					<label for="content">{{.locale.Tr "settings.principal_content"}}</label>
+					<label for="content">{{ctx.Locale.Tr "settings.principal_content"}}</label>
 					<input id="ssh-principal-content" name="content" value="{{.content}}" autofocus required>
 				</div>
 				<input name="title" type="hidden" value="principal">
 				<input name="type" type="hidden" value="principal">
 				<button class="ui primary button">
-					{{.locale.Tr "settings.add_new_principal"}}
+					{{ctx.Locale.Tr "settings.add_new_principal"}}
 				</button>
 			</form>
 		</div>
@@ -59,10 +59,10 @@
 	<div class="ui g-modal-confirm delete modal" id="delete-principal">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "settings.ssh_principal_deletion"}}
+			{{ctx.Locale.Tr "settings.ssh_principal_deletion"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "settings.ssh_principal_deletion_desc"}}</p>
+			<p>{{ctx.Locale.Tr "settings.ssh_principal_deletion_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/user/settings/keys_ssh.tmpl b/templates/user/settings/keys_ssh.tmpl
index 626d34fd33..f4aa7ef968 100644
--- a/templates/user/settings/keys_ssh.tmpl
+++ b/templates/user/settings/keys_ssh.tmpl
@@ -1,8 +1,8 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "settings.manage_ssh_keys"}}
+	{{ctx.Locale.Tr "settings.manage_ssh_keys"}}
 	<div class="ui right">
 		<button id="add-ssh-button" class="ui primary tiny show-panel toggle button" data-panel="#add-ssh-key-panel">
-			{{.locale.Tr "settings.add_key"}}
+			{{ctx.Locale.Tr "settings.add_key"}}
 		</button>
 	</div>
 </h4>
@@ -11,87 +11,87 @@
 		<form class="ui form" action="{{.Link}}" method="post">
 			{{.CsrfTokenHtml}}
 			<div class="field {{if .Err_Title}}error{{end}}">
-				<label for="title">{{.locale.Tr "settings.key_name"}}</label>
+				<label for="title">{{ctx.Locale.Tr "settings.key_name"}}</label>
 				<input id="ssh-key-title" name="title" value="{{.title}}" autofocus required maxlength="50">
 			</div>
 			<div class="field {{if .Err_Content}}error{{end}}">
-				<label for="content">{{.locale.Tr "settings.key_content"}}</label>
-				<textarea id="ssh-key-content" name="content" class="js-quick-submit" placeholder="{{.locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
+				<label for="content">{{ctx.Locale.Tr "settings.key_content"}}</label>
+				<textarea id="ssh-key-content" name="content" class="js-quick-submit" placeholder="{{ctx.Locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
 			</div>
 			<input name="type" type="hidden" value="ssh">
 			<button class="ui primary button">
-				{{.locale.Tr "settings.add_key"}}
+				{{ctx.Locale.Tr "settings.add_key"}}
 			</button>
 			<button id="cancel-ssh-button" class="ui hide-panel button" data-panel="#add-ssh-key-panel">
-				{{.locale.Tr "cancel"}}
+				{{ctx.Locale.Tr "cancel"}}
 			</button>
 		</form>
 	</div>
 	<div id="keys-ssh" class="flex-list">
 		<div class="flex-item">
 			<p>
-				{{.locale.Tr "settings.ssh_desc"}}<br>
-				{{.locale.Tr "settings.ssh_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/troubleshooting-ssh" | Str2html}}
+				{{ctx.Locale.Tr "settings.ssh_desc"}}<br>
+				{{ctx.Locale.Tr "settings.ssh_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/troubleshooting-ssh" | Str2html}}
 			</p>
 		</div>
 		{{if .DisableSSH}}
 			<div class="flex-item">
-				{{.locale.Tr "settings.ssh_signonly"}}
+				{{ctx.Locale.Tr "settings.ssh_signonly"}}
 			</div>
 		{{end}}
 		{{range $index, $key := .Keys}}
 			<div class="flex-item">
 				<div class="flex-item-leading">
-					<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{$.locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
+					<span class="text {{if .HasRecentActivity}}green{{end}}" {{if .HasRecentActivity}}data-tooltip-content="{{ctx.Locale.Tr "settings.key_state_desc"}}"{{end}}>{{svg "octicon-key" 32}}</span>
 				</div>
 				<div class="flex-item-main">
 						{{if .Verified}}
-							<div class="flex-item-title flex-text-block" data-tooltip-content="{{$.locale.Tr "settings.ssh_key_verified_long"}}">{{svg "octicon-verified"}}{{$.locale.Tr "settings.ssh_key_verified"}}</div>
+							<div class="flex-item-title flex-text-block" data-tooltip-content="{{ctx.Locale.Tr "settings.ssh_key_verified_long"}}">{{svg "octicon-verified"}}{{ctx.Locale.Tr "settings.ssh_key_verified"}}</div>
 						{{end}}
 						<div class="flex-item-title">{{.Name}}</div>
 						<div class="flex-item-body">
 								{{.Fingerprint}}
 						</div>
 						<div class="flex-item-body">
-								<i>{{$.locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} —	{{svg "octicon-info"}} {{if .HasUsed}}{{$.locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{$.locale.Tr "settings.no_activity"}}{{end}}</i>
+								<i>{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix) | Safe}} —	{{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateTime "short" .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}}</i>
 						</div>
 				</div>
 				<div class="flex-item-trailing">
-					<button class="ui red tiny button delete-button{{if index $.ExternalKeys $index}} disabled{{end}}" data-modal-id="delete-ssh" data-url="{{$.Link}}/delete?type=ssh" data-id="{{.ID}}"{{if index $.ExternalKeys $index}} title="{{$.locale.Tr "settings.ssh_externally_managed"}}"{{end}}>
-						{{$.locale.Tr "settings.delete_key"}}
+					<button class="ui red tiny button delete-button{{if index $.ExternalKeys $index}} disabled{{end}}" data-modal-id="delete-ssh" data-url="{{$.Link}}/delete?type=ssh" data-id="{{.ID}}"{{if index $.ExternalKeys $index}} title="{{ctx.Locale.Tr "settings.ssh_externally_managed"}}"{{end}}>
+						{{ctx.Locale.Tr "settings.delete_key"}}
 					</button>
 					{{if and (not .Verified) (ne $.VerifyingFingerprint .Fingerprint)}}
-						<a class="ui primary tiny button" href="{{$.Link}}?verify_ssh={{.Fingerprint}}">{{$.locale.Tr "settings.ssh_key_verify"}}</a>
+						<a class="ui primary tiny button" href="{{$.Link}}?verify_ssh={{.Fingerprint}}">{{ctx.Locale.Tr "settings.ssh_key_verify"}}</a>
 					{{end}}
 				</div>
 			</div>
 			{{if and (not .Verified) (eq $.VerifyingFingerprint .Fingerprint)}}
 				<div class="ui segment">
-					<h4>{{$.locale.Tr "settings.ssh_token_required"}}</h4>
+					<h4>{{ctx.Locale.Tr "settings.ssh_token_required"}}</h4>
 					<form class="ui form{{if $.HasSSHVerifyError}} error{{end}}" action="{{$.Link}}" method="post">
 						{{$.CsrfTokenHtml}}
 						<input type="hidden" name="title" value="none">
 						<input type="hidden" name="content" value="{{.Content}}">
 						<input type="hidden" name="fingerprint" value="{{.Fingerprint}}">
 						<div class="field">
-							<label for="token">{{$.locale.Tr "settings.ssh_token"}}</label>
+							<label for="token">{{ctx.Locale.Tr "settings.ssh_token"}}</label>
 							<input readonly="" value="{{$.TokenToSign}}">
 							<div class="help">
-								<p>{{$.locale.Tr "settings.ssh_token_help"}}</p>
+								<p>{{ctx.Locale.Tr "settings.ssh_token_help"}}</p>
 								<p><code>{{printf "echo -n '%s' | ssh-keygen -Y sign -n gitea -f /path_to_your_privkey" $.TokenToSign}}</code></p>
 							</div>
 							<br>
 						</div>
 						<div class="field">
-							<label for="signature">{{$.locale.Tr "settings.ssh_token_signature"}}</label>
-							<textarea id="ssh-key-signature" name="signature" class="js-quick-submit" placeholder="{{$.locale.Tr "settings.key_signature_ssh_placeholder"}}" required>{{$.signature}}</textarea>
+							<label for="signature">{{ctx.Locale.Tr "settings.ssh_token_signature"}}</label>
+							<textarea id="ssh-key-signature" name="signature" class="js-quick-submit" placeholder="{{ctx.Locale.Tr "settings.key_signature_ssh_placeholder"}}" required>{{$.signature}}</textarea>
 						</div>
 						<input name="type" type="hidden" value="verify_ssh">
 						<button class="ui primary button">
-							{{$.locale.Tr "settings.ssh_key_verify"}}
+							{{ctx.Locale.Tr "settings.ssh_key_verify"}}
 						</button>
 						<a class="ui red button" href="{{$.Link}}">
-							{{$.locale.Tr "settings.cancel"}}
+							{{ctx.Locale.Tr "settings.cancel"}}
 						</a>
 					</form>
 				</div>
@@ -101,10 +101,10 @@
 	<div class="ui g-modal-confirm delete modal" id="delete-ssh">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "settings.ssh_key_deletion"}}
+			{{ctx.Locale.Tr "settings.ssh_key_deletion"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "settings.ssh_key_deletion_desc"}}</p>
+			<p>{{ctx.Locale.Tr "settings.ssh_key_deletion_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/user/settings/navbar.tmpl b/templates/user/settings/navbar.tmpl
index ac9ef26022..a690d00352 100644
--- a/templates/user/settings/navbar.tmpl
+++ b/templates/user/settings/navbar.tmpl
@@ -1,55 +1,55 @@
 <div class="flex-container-nav">
 	<div class="ui fluid vertical menu">
-		<div class="header item">{{.locale.Tr "user.settings"}}</div>
+		<div class="header item">{{ctx.Locale.Tr "user.settings"}}</div>
 		<a class="{{if .PageIsSettingsProfile}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
-			{{.locale.Tr "settings.profile"}}
+			{{ctx.Locale.Tr "settings.profile"}}
 		</a>
 		<a class="{{if .PageIsSettingsAccount}}active {{end}}item" href="{{AppSubUrl}}/user/settings/account">
-			{{.locale.Tr "settings.account"}}
+			{{ctx.Locale.Tr "settings.account"}}
 		</a>
 		<a class="{{if .PageIsSettingsAppearance}}active {{end}}item" href="{{AppSubUrl}}/user/settings/appearance">
-			{{.locale.Tr "settings.appearance"}}
+			{{ctx.Locale.Tr "settings.appearance"}}
 		</a>
 		<a class="{{if .PageIsSettingsSecurity}}active {{end}}item" href="{{AppSubUrl}}/user/settings/security">
-			{{.locale.Tr "settings.security"}}
+			{{ctx.Locale.Tr "settings.security"}}
 		</a>
 		<a class="{{if .PageIsSettingsApplications}}active {{end}}item" href="{{AppSubUrl}}/user/settings/applications">
-			{{.locale.Tr "settings.applications"}}
+			{{ctx.Locale.Tr "settings.applications"}}
 		</a>
 		<a class="{{if .PageIsSettingsKeys}}active {{end}}item" href="{{AppSubUrl}}/user/settings/keys">
-			{{.locale.Tr "settings.ssh_gpg_keys"}}
+			{{ctx.Locale.Tr "settings.ssh_gpg_keys"}}
 		</a>
 		{{if .EnableActions}}
 		<details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}open{{end}}>
-			<summary>{{.locale.Tr "actions.actions"}}</summary>
+			<summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
 			<div class="menu">
 				<a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/runners">
-					{{.locale.Tr "actions.runners"}}
+					{{ctx.Locale.Tr "actions.runners"}}
 				</a>
 				<a class="{{if .PageIsSharedSettingsSecrets}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/secrets">
-					{{.locale.Tr "secrets.secrets"}}
+					{{ctx.Locale.Tr "secrets.secrets"}}
 				</a>
 				<a class="{{if .PageIsSharedSettingsVariables}}active {{end}}item" href="{{AppSubUrl}}/user/settings/actions/variables">
-					{{.locale.Tr "actions.variables"}}
+					{{ctx.Locale.Tr "actions.variables"}}
 				</a>
 			</div>
 		</details>
 		{{end}}
 		{{if .EnablePackages}}
 		<a class="{{if .PageIsSettingsPackages}}active {{end}}item" href="{{AppSubUrl}}/user/settings/packages">
-			{{.locale.Tr "packages.title"}}
+			{{ctx.Locale.Tr "packages.title"}}
 		</a>
 		{{end}}
 		{{if not DisableWebhooks}}
 		<a class="{{if .PageIsSettingsHooks}}active {{end}}item" href="{{AppSubUrl}}/user/settings/hooks">
-			{{.locale.Tr "repo.settings.hooks"}}
+			{{ctx.Locale.Tr "repo.settings.hooks"}}
 		</a>
 		{{end}}
 		<a class="{{if .PageIsSettingsOrganization}}active {{end}}item" href="{{AppSubUrl}}/user/settings/organization">
-			{{.locale.Tr "settings.organization"}}
+			{{ctx.Locale.Tr "settings.organization"}}
 		</a>
 		<a class="{{if .PageIsSettingsRepos}}active {{end}}item" href="{{AppSubUrl}}/user/settings/repos">
-			{{.locale.Tr "settings.repos"}}
+			{{ctx.Locale.Tr "settings.repos"}}
 		</a>
 	</div>
 </div>
diff --git a/templates/user/settings/organization.tmpl b/templates/user/settings/organization.tmpl
index be986cd8cf..8079521984 100644
--- a/templates/user/settings/organization.tmpl
+++ b/templates/user/settings/organization.tmpl
@@ -1,10 +1,10 @@
 {{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings organization")}}
 	<div class="user-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.orgs"}}
+			{{ctx.Locale.Tr "settings.orgs"}}
 			{{if .SignedUser.CanCreateOrganization}}
 			<div class="ui right">
-				<a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{.locale.Tr "admin.orgs.new_orga"}}</a>
+				<a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{ctx.Locale.Tr "admin.orgs.new_orga"}}</a>
 			</div>
 			{{end}}
 		</h4>
@@ -28,7 +28,7 @@
 								<button class="ui red button delete-button" data-modal-id="leave-organization"
 												data-url="{{.OrganisationLink}}/members/action/leave" data-datauid="{{$.SignedUser.ID}}"
 												data-name="{{$.SignedUser.DisplayName}}"
-												data-data-organization-name="{{.DisplayName}}">{{$.locale.Tr "org.members.leave"}}
+												data-data-organization-name="{{.DisplayName}}">{{ctx.Locale.Tr "org.members.leave"}}
 								</button>
 							</form>
 						</div>
@@ -37,17 +37,17 @@
 				</div>
 				{{template "base/paginate" .}}
 			{{else}}
-				{{.locale.Tr "settings.orgs_none"}}
+				{{ctx.Locale.Tr "settings.orgs_none"}}
 			{{end}}
 		</div>
 	</div>
 
 <div class="ui g-modal-confirm delete modal" id="leave-organization">
 	<div class="header">
-		{{$.locale.Tr "org.members.leave"}}
+		{{ctx.Locale.Tr "org.members.leave"}}
 	</div>
 	<div class="content">
-		<p>{{$.locale.Tr "org.members.leave.detail" `<span class="dataOrganizationName"></span>` | Safe}}</p>
+		<p>{{ctx.Locale.Tr "org.members.leave.detail" `<span class="dataOrganizationName"></span>` | Safe}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/user/settings/packages.tmpl b/templates/user/settings/packages.tmpl
index f4933d3dae..1de20fe729 100644
--- a/templates/user/settings/packages.tmpl
+++ b/templates/user/settings/packages.tmpl
@@ -4,19 +4,19 @@
 		{{template "package/shared/cargo" .}}
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "packages.owner.settings.chef.title"}}
+			{{ctx.Locale.Tr "packages.owner.settings.chef.title"}}
 		</h4>
 		<div class="ui attached segment">
 			<div class="ui form">
 				<div class="field">
-					<label>{{$.locale.Tr "packages.owner.settings.chef.keypair.description"}}</label>
+					<label>{{ctx.Locale.Tr "packages.owner.settings.chef.keypair.description"}}</label>
 				</div>
 				<form class="field" action="{{.Link}}/chef/regenerate_keypair" method="post">
 					{{.CsrfTokenHtml}}
-					<button class="ui primary button">{{$.locale.Tr "packages.owner.settings.chef.keypair"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "packages.owner.settings.chef.keypair"}}</button>
 				</form>
 				<div class="field">
-					<label>{{.locale.Tr "packages.registry.documentation" "Chef" "https://docs.gitea.com/usage/packages/chef/" | Safe}}</label>
+					<label>{{ctx.Locale.Tr "packages.registry.documentation" "Chef" "https://docs.gitea.com/usage/packages/chef/" | Safe}}</label>
 				</div>
 			</div>
 		</div>
diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl
index 34c790065a..a508a5e835 100644
--- a/templates/user/settings/profile.tmpl
+++ b/templates/user/settings/profile.tmpl
@@ -1,70 +1,70 @@
 {{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings profile")}}
 	<div class="user-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.public_profile"}}
+			{{ctx.Locale.Tr "settings.public_profile"}}
 		</h4>
 		<div class="ui attached segment">
-			<p>{{.locale.Tr "settings.profile_desc"}}</p>
+			<p>{{ctx.Locale.Tr "settings.profile_desc"}}</p>
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<div class="required field {{if .Err_Name}}error{{end}}">
-					<label for="username">{{.locale.Tr "username"}}
-						<span class="text red gt-hidden" id="name-change-prompt"> {{.locale.Tr "settings.change_username_prompt"}}</span>
-						<span class="text red gt-hidden" id="name-change-redirect-prompt"> {{.locale.Tr "settings.change_username_redirect_prompt"}}</span>
+					<label for="username">{{ctx.Locale.Tr "username"}}
+						<span class="text red gt-hidden" id="name-change-prompt"> {{ctx.Locale.Tr "settings.change_username_prompt"}}</span>
+						<span class="text red gt-hidden" id="name-change-redirect-prompt"> {{ctx.Locale.Tr "settings.change_username_redirect_prompt"}}</span>
 					</label>
 					<input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if or (not .SignedUser.IsLocal) .IsReverseProxy}}disabled{{end}} maxlength="40">
 					{{if or (not .SignedUser.IsLocal) .IsReverseProxy}}
-					<p class="help text blue">{{$.locale.Tr "settings.password_username_disabled"}}</p>
+					<p class="help text blue">{{ctx.Locale.Tr "settings.password_username_disabled"}}</p>
 					{{end}}
 				</div>
 				<div class="field {{if .Err_FullName}}error{{end}}">
-					<label for="full_name">{{.locale.Tr "settings.full_name"}}</label>
+					<label for="full_name">{{ctx.Locale.Tr "settings.full_name"}}</label>
 					<input id="full_name" name="full_name" value="{{.SignedUser.FullName}}" maxlength="100">
 				</div>
 				<div class="field {{if .Err_Email}}error{{end}}">
-					<label for="email">{{.locale.Tr "email"}}</label>
+					<label for="email">{{ctx.Locale.Tr "email"}}</label>
 					<p>{{.SignedUser.Email}}</p>
 				</div>
 				<div class="field {{if .Err_Description}}error{{end}}">
-					<label for="description">{{$.locale.Tr "user.user_bio"}}</label>
-					<textarea id="description" name="description" rows="2" placeholder="{{.locale.Tr "settings.biography_placeholder"}}" maxlength="255">{{.SignedUser.Description}}</textarea>
+					<label for="description">{{ctx.Locale.Tr "user.user_bio"}}</label>
+					<textarea id="description" name="description" rows="2" placeholder="{{ctx.Locale.Tr "settings.biography_placeholder"}}" maxlength="255">{{.SignedUser.Description}}</textarea>
 				</div>
 				<div class="field {{if .Err_Website}}error{{end}}">
-					<label for="website">{{.locale.Tr "settings.website"}}</label>
+					<label for="website">{{ctx.Locale.Tr "settings.website"}}</label>
 					<input id="website" name="website" type="url" value="{{.SignedUser.Website}}" maxlength="255">
 				</div>
 				<div class="field">
-					<label for="location">{{.locale.Tr "settings.location"}}</label>
-					<input id="location" name="location" placeholder="{{.locale.Tr "settings.location_placeholder"}}" value="{{.SignedUser.Location}}" maxlength="50">
+					<label for="location">{{ctx.Locale.Tr "settings.location"}}</label>
+					<input id="location" name="location" placeholder="{{ctx.Locale.Tr "settings.location_placeholder"}}" value="{{.SignedUser.Location}}" maxlength="50">
 				</div>
 
 				<div class="divider"></div>
 				<!-- private block -->
 
 				<div class="field" id="privacy-user-settings">
-					<label for="security-private"><strong>{{.locale.Tr "settings.privacy"}}</strong></label>
+					<label for="security-private"><strong>{{ctx.Locale.Tr "settings.privacy"}}</strong></label>
 				</div>
 
 				<div class="inline field {{if .Err_Visibility}}error{{end}}">
-					<span class="inline required field"><label for="visibility">{{.locale.Tr "settings.visibility"}}</label></span>
+					<span class="inline required field"><label for="visibility">{{ctx.Locale.Tr "settings.visibility"}}</label></span>
 					<div class="ui selection type dropdown">
 						{{if .SignedUser.Visibility.IsPublic}}<input type="hidden" id="visibility" name="visibility" value="0">{{end}}
 						{{if .SignedUser.Visibility.IsLimited}}<input type="hidden" id="visibility" name="visibility" value="1">{{end}}
 						{{if .SignedUser.Visibility.IsPrivate}}<input type="hidden" id="visibility" name="visibility" value="2">{{end}}
 						<div class="text">
-							{{if .SignedUser.Visibility.IsPublic}}{{.locale.Tr "settings.visibility.public"}}{{end}}
-							{{if .SignedUser.Visibility.IsLimited}}{{.locale.Tr "settings.visibility.limited"}}{{end}}
-							{{if .SignedUser.Visibility.IsPrivate}}{{.locale.Tr "settings.visibility.private"}}{{end}}
+							{{if .SignedUser.Visibility.IsPublic}}{{ctx.Locale.Tr "settings.visibility.public"}}{{end}}
+							{{if .SignedUser.Visibility.IsLimited}}{{ctx.Locale.Tr "settings.visibility.limited"}}{{end}}
+							{{if .SignedUser.Visibility.IsPrivate}}{{ctx.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" data-tooltip-content="{{$.locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{$.locale.Tr "settings.visibility.public"}}</div>
+									<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{ctx.Locale.Tr "settings.visibility.public"}}</div>
 								{{else if $mode.IsLimited}}
-									<div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{$.locale.Tr "settings.visibility.limited"}}</div>
+									<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{ctx.Locale.Tr "settings.visibility.limited"}}</div>
 								{{else if $mode.IsPrivate}}
-									<div class="item" data-tooltip-content="{{$.locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{$.locale.Tr "settings.visibility.private"}}</div>
+									<div class="item" data-tooltip-content="{{ctx.Locale.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{ctx.Locale.Tr "settings.visibility.private"}}</div>
 								{{end}}
 							{{end}}
 						</div>
@@ -73,14 +73,14 @@
 
 				<div class="field">
 					<div class="ui checkbox">
-						<label data-tooltip-content="{{.locale.Tr "settings.keep_email_private_popup"}}"><strong>{{.locale.Tr "settings.keep_email_private"}}</strong></label>
+						<label data-tooltip-content="{{ctx.Locale.Tr "settings.keep_email_private_popup"}}"><strong>{{ctx.Locale.Tr "settings.keep_email_private"}}</strong></label>
 						<input name="keep_email_private" type="checkbox" {{if .SignedUser.KeepEmailPrivate}}checked{{end}}>
 					</div>
 				</div>
 
 				<div class="field">
 					<div class="ui checkbox" id="keep-activity-private">
-						<label data-tooltip-content="{{.locale.Tr "settings.keep_activity_private_popup"}}"><strong>{{.locale.Tr "settings.keep_activity_private"}}</strong></label>
+						<label data-tooltip-content="{{ctx.Locale.Tr "settings.keep_activity_private_popup"}}"><strong>{{ctx.Locale.Tr "settings.keep_activity_private"}}</strong></label>
 						<input name="keep_activity_private" type="checkbox" {{if .SignedUser.KeepActivityPrivate}}checked{{end}}>
 					</div>
 				</div>
@@ -88,13 +88,13 @@
 				<div class="divider"></div>
 
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "settings.update_profile"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "settings.update_profile"}}</button>
 				</div>
 			</form>
 		</div>
 
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.avatar"}}
+			{{ctx.Locale.Tr "settings.avatar"}}
 		</h4>
 		<div class="ui attached segment">
 			<form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
@@ -103,11 +103,11 @@
 				<div class="inline field">
 					<div class="ui radio checkbox">
 						<input name="source" value="lookup" type="radio" {{if not .SignedUser.UseCustomAvatar}}checked{{end}}>
-						<label>{{.locale.Tr "settings.lookup_avatar_by_mail"}}</label>
+						<label>{{ctx.Locale.Tr "settings.lookup_avatar_by_mail"}}</label>
 					</div>
 				</div>
 				<div class="field gt-pl-4 {{if .Err_Gravatar}}error{{end}}">
-					<label for="gravatar">Avatar {{.locale.Tr "email"}}</label>
+					<label for="gravatar">Avatar {{ctx.Locale.Tr "email"}}</label>
 					<input id="gravatar" name="gravatar" value="{{.SignedUser.AvatarEmail}}">
 				</div>
 				{{end}}
@@ -115,18 +115,18 @@
 				<div class="inline field">
 					<div class="ui radio checkbox">
 						<input name="source" value="local" type="radio" {{if .SignedUser.UseCustomAvatar}}checked{{end}}>
-						<label>{{.locale.Tr "settings.enable_custom_avatar"}}</label>
+						<label>{{ctx.Locale.Tr "settings.enable_custom_avatar"}}</label>
 					</div>
 				</div>
 
 				<div class="inline field gt-pl-4">
-					<label for="avatar">{{.locale.Tr "settings.choose_new_avatar"}}</label>
+					<label for="avatar">{{ctx.Locale.Tr "settings.choose_new_avatar"}}</label>
 					<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
 				</div>
 
 				<div class="field">
-					<button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button>
-					<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "settings.update_avatar"}}</button>
+					<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{ctx.Locale.Tr "settings.delete_current_avatar"}}</button>
 				</div>
 			</form>
 		</div>
diff --git a/templates/user/settings/repos.tmpl b/templates/user/settings/repos.tmpl
index db912770d2..5aabec547a 100644
--- a/templates/user/settings/repos.tmpl
+++ b/templates/user/settings/repos.tmpl
@@ -1,7 +1,7 @@
 {{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings repos")}}
 	<div class="user-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.repos"}}
+			{{ctx.Locale.Tr "settings.repos"}}
 		</h4>
 		<div class="ui attached segment">
 			{{if or .allowAdopt .allowDelete}}
@@ -26,7 +26,7 @@
 										<a class="muted name" href="{{$repo.Link}}">{{$repo.OwnerName}}/{{$repo.Name}}</a>
 										<span class="text light-3" {{if not (eq $repo.Size 0)}} data-tooltip-content="{{$repo.SizeDetailsString}}"{{end}}>{{FileSize $repo.Size}}</span>
 										{{if $repo.IsFork}}
-											{{$.locale.Tr "repo.forked_from"}}
+											{{ctx.Locale.Tr "repo.forked_from"}}
 											<span><a href="{{$repo.BaseRepo.Link}}">{{$repo.BaseRepo.OwnerName}}/{{$repo.BaseRepo.Name}}</a></span>
 										{{end}}
 									{{else}}
@@ -34,13 +34,13 @@
 										<span class="name gt-dib gt-pt-3">{{$.ContextUser.Name}}/{{$dir}}</span>
 										<div class="gt-float-right">
 											{{if $.allowAdopt}}
-												<button class="ui button primary show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button>
+												<button class="ui button primary show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{ctx.Locale.Tr "repo.adopt_preexisting_label"}}</span></button>
 												<div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}">
 													<div class="header">
-														<span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span>
+														<span class="label">{{ctx.Locale.Tr "repo.adopt_preexisting"}}</span>
 													</div>
 													<div class="content">
-														<p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
+														<p>{{ctx.Locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
 													</div>
 													<form class="ui form" method="post" action="{{AppSubUrl}}/user/settings/repos/unadopted">
 														{{$.CsrfTokenHtml}}
@@ -51,13 +51,13 @@
 												</div>
 											{{end}}
 											{{if $.allowDelete}}
-												<button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button>
+												<button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{ctx.Locale.Tr "repo.delete_preexisting_label"}}</span></button>
 												<div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}">
 													<div class="header">
-														<span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span>
+														<span class="label">{{ctx.Locale.Tr "repo.delete_preexisting"}}</span>
 													</div>
 													<div class="content">
-														<p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p>
+														<p>{{ctx.Locale.Tr "repo.delete_preexisting_content" $dir}}</p>
 													</div>
 													<form class="ui form" method="post" action="{{AppSubUrl}}/user/settings/repos/unadopted">
 														{{$.CsrfTokenHtml}}
@@ -76,7 +76,7 @@
 					{{template "base/paginate" .}}
 				{{else}}
 					<div class="item">
-						{{.locale.Tr "settings.repos_none"}}
+						{{ctx.Locale.Tr "settings.repos_none"}}
 					</div>
 				{{end}}
 			{{else}}
@@ -99,7 +99,7 @@
 									<a class="name" href="{{.Link}}">{{.OwnerName}}/{{.Name}}</a>
 									<span>{{FileSize .Size}}</span>
 									{{if .IsFork}}
-										{{$.locale.Tr "repo.forked_from"}}
+										{{ctx.Locale.Tr "repo.forked_from"}}
 										<span><a href="{{.BaseRepo.Link}}">{{.BaseRepo.OwnerName}}/{{.BaseRepo.Name}}</a></span>
 									{{end}}
 								</div>
@@ -109,7 +109,7 @@
 					{{template "base/paginate" .}}
 				{{else}}
 					<div class="item">
-						{{.locale.Tr "settings.repos_none"}}
+						{{ctx.Locale.Tr "settings.repos_none"}}
 					</div>
 				{{end}}
 			{{end}}
@@ -119,10 +119,10 @@
 <div class="ui g-modal-confirm delete modal">
 	<div class="header">
 		{{svg "octicon-trash"}}
-		{{.locale.Tr "settings.remove_account_link"}}
+		{{ctx.Locale.Tr "settings.remove_account_link"}}
 	</div>
 	<div class="content">
-		<p>{{.locale.Tr "settings.remove_account_link_desc"}}</p>
+		<p>{{ctx.Locale.Tr "settings.remove_account_link_desc"}}</p>
 	</div>
 	{{template "base/modal_actions_confirm" .}}
 </div>
diff --git a/templates/user/settings/security/accountlinks.tmpl b/templates/user/settings/security/accountlinks.tmpl
index 7fbd39cbd4..73b2735650 100644
--- a/templates/user/settings/security/accountlinks.tmpl
+++ b/templates/user/settings/security/accountlinks.tmpl
@@ -1,11 +1,11 @@
 {{/* No account links, no way to add account links: Menu will not be shown. */}}
 {{if or .AccountLinks .OrderedOAuth2Names}}
 <h4 class="ui top attached header">
-	{{.locale.Tr "settings.manage_account_links"}}
+	{{ctx.Locale.Tr "settings.manage_account_links"}}
 	{{if .OrderedOAuth2Names}}
 		<div class="ui right">
 			<div class="ui dropdown">
-				<div class="ui primary tiny button">{{.locale.Tr "settings.link_account"}}</div>
+				<div class="ui primary tiny button">{{ctx.Locale.Tr "settings.link_account"}}</div>
 				<div class="menu">
 					{{range $key := .OrderedOAuth2Names}}
 						{{$provider := index $.OAuth2Providers $key}}
@@ -23,7 +23,7 @@
 <div class="ui attached segment">
 	<div class="flex-list">
 		<div class="flex-item">
-			{{.locale.Tr "settings.manage_account_links_desc"}}
+			{{ctx.Locale.Tr "settings.manage_account_links_desc"}}
 		</div>
 		{{range $loginSource, $provider := .AccountLinks}}
 			<div class="flex-item">
@@ -36,12 +36,12 @@
 						{{$loginSource.Name}}
 					</span>
 					{{if $loginSource.IsActive}}
-					<span class="flex-text-body text primary">{{$.locale.Tr "repo.settings.active"}}</span>
+					<span class="flex-text-body text primary">{{ctx.Locale.Tr "repo.settings.active"}}</span>
 					{{end}}
 				</div>
 				<div class="flex-item-trailing">
 					<button class="ui red tiny button delete-button" data-modal-id="delete-account-link" data-url="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}">
-						{{$.locale.Tr "settings.delete_key"}}
+						{{ctx.Locale.Tr "settings.delete_key"}}
 					</button>
 				</div>
 			</div>
@@ -51,10 +51,10 @@
 	<div class="ui g-modal-confirm delete modal" id="delete-account-link">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "settings.remove_account_link"}}
+			{{ctx.Locale.Tr "settings.remove_account_link"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "settings.remove_account_link_desc"}}</p>
+			<p>{{ctx.Locale.Tr "settings.remove_account_link_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/user/settings/security/openid.tmpl b/templates/user/settings/security/openid.tmpl
index f22b02c898..0e9b4adcbe 100644
--- a/templates/user/settings/security/openid.tmpl
+++ b/templates/user/settings/security/openid.tmpl
@@ -1,10 +1,10 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "settings.manage_openid"}}
+	{{ctx.Locale.Tr "settings.manage_openid"}}
 </h4>
 <div class="ui attached segment">
 	<div class="flex-list">
 		<div class="flex-item">
-			{{.locale.Tr "settings.openid_desc"}}
+			{{ctx.Locale.Tr "settings.openid_desc"}}
 		</div>
 		{{range .OpenIDs}}
 			<div class="flex-item gt-ac">
@@ -21,17 +21,17 @@
 						{{if .Show}}
 							<button class="ui tiny button">
 							{{svg "octicon-eye" 16 "icon"}}
-							{{$.locale.Tr "settings.hide_openid"}}
+							{{ctx.Locale.Tr "settings.hide_openid"}}
 							</button>
 						{{else}}
 							<button class="ui tiny button">
 							{{svg "octicon-eye-closed" 16 "icon"}}
-							{{$.locale.Tr "settings.show_openid"}}
+							{{ctx.Locale.Tr "settings.show_openid"}}
 							</button>
 						{{end}}
 					</form>
 					<button class="ui red tiny button delete-button" data-modal-id="delete-openid" data-url="{{AppSubUrl}}/user/settings/security/openid/delete" data-id="{{.ID}}">
-						{{$.locale.Tr "settings.delete_key"}}
+						{{ctx.Locale.Tr "settings.delete_key"}}
 					</button>
 				</div>
 			</div>
@@ -42,21 +42,21 @@
 	<form class="ui form" action="{{AppSubUrl}}/user/settings/security/openid" method="post">
 		{{.CsrfTokenHtml}}
 		<div class="required field {{if .Err_OpenID}}error{{end}}">
-			<label for="openid">{{.locale.Tr "settings.add_new_openid"}}</label>
+			<label for="openid">{{ctx.Locale.Tr "settings.add_new_openid"}}</label>
 			<input id="openid" name="openid" type="text" required>
 		</div>
 		<button class="ui primary button">
-			{{.locale.Tr "settings.add_openid"}}
+			{{ctx.Locale.Tr "settings.add_openid"}}
 		</button>
 	</form>
 
 	<div class="ui g-modal-confirm delete modal" id="delete-openid">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "settings.openid_deletion"}}
+			{{ctx.Locale.Tr "settings.openid_deletion"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "settings.openid_deletion_desc"}}</p>
+			<p>{{ctx.Locale.Tr "settings.openid_deletion_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/user/settings/security/twofa.tmpl b/templates/user/settings/security/twofa.tmpl
index dbf395c4b1..9e58a647d2 100644
--- a/templates/user/settings/security/twofa.tmpl
+++ b/templates/user/settings/security/twofa.tmpl
@@ -1,34 +1,34 @@
 <h4 class="ui top attached header">
-	{{.locale.Tr "settings.twofa"}}
+	{{ctx.Locale.Tr "settings.twofa"}}
 </h4>
 <div class="ui attached segment">
-	<p>{{.locale.Tr "settings.twofa_desc"}}</p>
+	<p>{{ctx.Locale.Tr "settings.twofa_desc"}}</p>
 	{{if .TOTPEnrolled}}
-	<p>{{$.locale.Tr "settings.twofa_is_enrolled" | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "settings.twofa_is_enrolled" | Str2html}}</p>
 	<form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/regenerate_scratch" method="post" enctype="multipart/form-data">
 		{{.CsrfTokenHtml}}
-		<p>{{.locale.Tr "settings.regenerate_scratch_token_desc"}}</p>
-		<button class="ui primary button">{{$.locale.Tr "settings.twofa_scratch_token_regenerate"}}</button>
+		<p>{{ctx.Locale.Tr "settings.regenerate_scratch_token_desc"}}</p>
+		<button class="ui primary button">{{ctx.Locale.Tr "settings.twofa_scratch_token_regenerate"}}</button>
 	</form>
 	<form class="ui form" action="{{AppSubUrl}}/user/settings/security/two_factor/disable" method="post" enctype="multipart/form-data" id="disable-form">
 		{{.CsrfTokenHtml}}
-		<p>{{.locale.Tr "settings.twofa_disable_note"}}</p>
-		<button class="ui red button delete-button" data-modal-id="disable-twofa" data-type="form" data-form="#disable-form">{{$.locale.Tr "settings.twofa_disable"}}</button>
+		<p>{{ctx.Locale.Tr "settings.twofa_disable_note"}}</p>
+		<button class="ui red button delete-button" data-modal-id="disable-twofa" data-type="form" data-form="#disable-form">{{ctx.Locale.Tr "settings.twofa_disable"}}</button>
 	</form>
 	{{else}}
-	<p>{{.locale.Tr "settings.twofa_not_enrolled"}}</p>
+	<p>{{ctx.Locale.Tr "settings.twofa_not_enrolled"}}</p>
 	<div class="inline field">
-		<a class="ui primary button" href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{$.locale.Tr "settings.twofa_enroll"}}</a>
+		<a class="ui primary button" href="{{AppSubUrl}}/user/settings/security/two_factor/enroll">{{ctx.Locale.Tr "settings.twofa_enroll"}}</a>
 	</div>
 	{{end}}
 
 	<div class="ui g-modal-confirm delete modal" id="disable-twofa">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "settings.twofa_disable"}}
+			{{ctx.Locale.Tr "settings.twofa_disable"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "settings.twofa_disable_desc"}}</p>
+			<p>{{ctx.Locale.Tr "settings.twofa_disable_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>
diff --git a/templates/user/settings/security/twofa_enroll.tmpl b/templates/user/settings/security/twofa_enroll.tmpl
index 9235e4f614..d6bfadf084 100644
--- a/templates/user/settings/security/twofa_enroll.tmpl
+++ b/templates/user/settings/security/twofa_enroll.tmpl
@@ -1,22 +1,22 @@
 {{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings twofa")}}
 	<div class="user-setting-content">
 		<h4 class="ui top attached header">
-			{{.locale.Tr "settings.twofa_enroll"}}
+			{{ctx.Locale.Tr "settings.twofa_enroll"}}
 		</h4>
 		<div class="ui attached segment">
-			<p>{{.locale.Tr "settings.scan_this_image"}}</p>
+			<p>{{ctx.Locale.Tr "settings.scan_this_image"}}</p>
 			<img src="{{.QrUri}}" alt="{{.TwofaSecret}}">
-			<p>{{.locale.Tr "settings.or_enter_secret" .TwofaSecret}}</p>
-			<p>{{.locale.Tr "settings.then_enter_passcode"}}</p>
+			<p>{{ctx.Locale.Tr "settings.or_enter_secret" .TwofaSecret}}</p>
+			<p>{{ctx.Locale.Tr "settings.then_enter_passcode"}}</p>
 			<form class="ui form" action="{{.Link}}" method="post">
 				{{.CsrfTokenHtml}}
 				<div class="inline required field {{if .Err_Passcode}}error{{end}}">
-					<label for="passcode">{{.locale.Tr "passcode"}}</label>
+					<label for="passcode">{{ctx.Locale.Tr "passcode"}}</label>
 					<input id="passcode" name="passcode" autofocus required>
 				</div>
 				<div class="inline field">
 					<label></label>
-					<button class="ui primary button">{{.locale.Tr "auth.verify"}}</button>
+					<button class="ui primary button">{{ctx.Locale.Tr "auth.verify"}}</button>
 				</div>
 			</form>
 		</div>
diff --git a/templates/user/settings/security/webauthn.tmpl b/templates/user/settings/security/webauthn.tmpl
index 6a74b8770a..28d8511fb4 100644
--- a/templates/user/settings/security/webauthn.tmpl
+++ b/templates/user/settings/security/webauthn.tmpl
@@ -1,6 +1,6 @@
-<h4 class="ui top attached header">{{.locale.Tr "settings.webauthn"}}</h4>
+<h4 class="ui top attached header">{{ctx.Locale.Tr "settings.webauthn"}}</h4>
 <div class="ui attached segment">
-	<p>{{.locale.Tr "settings.webauthn_desc" | Str2html}}</p>
+	<p>{{ctx.Locale.Tr "settings.webauthn_desc" | Str2html}}</p>
 	{{template "user/auth/webauthn_error" .}}
 	<div class="flex-list">
 		{{range .WebAuthnCredentials}}
@@ -10,11 +10,11 @@
 				</div>
 				<div class="flex-item-main">
 					<div class="flex-item-title">{{.Name}}</div>
-					<span class="flex-item-body time">{{TimeSinceUnix .CreatedUnix $.locale}}</span>
+					<span class="flex-item-body time">{{TimeSinceUnix .CreatedUnix ctx.Locale}}</span>
 				</div>
 				<div class="flex-item-trailing">
 					<button class="ui red tiny button delete-button" data-modal-id="delete-registration" data-url="{{$.Link}}/webauthn/delete" data-id="{{.ID}}">
-					{{$.locale.Tr "settings.delete_key"}}
+					{{ctx.Locale.Tr "settings.delete_key"}}
 					</button>
 				</div>
 			</div>
@@ -22,18 +22,18 @@
 	</div>
 	<div class="ui form">
 		<div class="required field">
-			<label for="nickname">{{.locale.Tr "settings.webauthn_nickname"}}</label>
+			<label for="nickname">{{ctx.Locale.Tr "settings.webauthn_nickname"}}</label>
 			<input id="nickname" name="nickname" type="text" required>
 		</div>
-		<button id="register-webauthn" class="ui primary button">{{svg "octicon-key"}} {{.locale.Tr "settings.webauthn_register_key"}}</button>
+		<button id="register-webauthn" class="ui primary button">{{svg "octicon-key"}} {{ctx.Locale.Tr "settings.webauthn_register_key"}}</button>
 	</div>
 	<div class="ui g-modal-confirm delete modal" id="delete-registration">
 		<div class="header">
 			{{svg "octicon-trash"}}
-			{{.locale.Tr "settings.webauthn_delete_key"}}
+			{{ctx.Locale.Tr "settings.webauthn_delete_key"}}
 		</div>
 		<div class="content">
-			<p>{{.locale.Tr "settings.webauthn_delete_key_desc"}}</p>
+			<p>{{ctx.Locale.Tr "settings.webauthn_delete_key_desc"}}</p>
 		</div>
 		{{template "base/modal_actions_confirm" .}}
 	</div>