i18n: Pass the name of the single-sign on system into strings.

This should avoid us needing to add a new set of translated strings
every time we add a new authentication method.
This commit is contained in:
Tim Abbott 2018-04-22 13:34:37 -07:00
parent 955d03b8a0
commit b91de0e283
2 changed files with 15 additions and 5 deletions

View File

@ -79,7 +79,9 @@ $(function () {
<div class="register-google">
<form class="form-inline" action="{{ url('zerver.views.auth.start_google_oauth2') }}" method="get">
<input type='hidden' name='is_signup' value='1' />
<button class="login-social-button login-google-button full-width">{{ _('Sign up with Google') }}</button>
<button class="login-social-button login-google-button full-width">
{{ _('Sign up with %(identity_provider)s', identity_provider="Google") }}
</button>
</form>
</div>
{% endif %}
@ -87,7 +89,9 @@ $(function () {
{% if github_auth_enabled %}
<div class="login-github">
<form class="form-inline github-wrapper" action="{{ url('signup-social', args=('github',)) }}" method="get">
<button class="login-social-button login-github-button github">{{ _('Sign up with GitHub') }}</button>
<button class="login-social-button login-github-button full-width">
{{ _('Sign up with %(identity_provider)s', identity_provider="GitHub") }}
</button>
</form>
</div>
{% endif %}

View File

@ -32,7 +32,9 @@
{# SSO users don't have a password. #}
<div class="login-sso">
<a id="sso-login" href="/accounts/login/sso/?next={{ next }}" class="btn btn-large btn-primary">{{ _('Log in with SSO') }}</a>
<a id="sso-login" href="/accounts/login/sso/?next={{ next }}" class="btn btn-large btn-primary">
{{ _('Log in with %(identity_provider)s', identity_provider="SSO") }}
</a>
</div>
{% else %}
@ -127,7 +129,9 @@
<div class="login-google">
<form id='google_login_form' class="form-inline" action="{{ url('zerver.views.auth.start_google_oauth2') }}" method="get">
<input type="hidden" name="next" value="{{ next }}">
<button class="login-social-button login-google-button full-width">{{ _('Log in with Google') }}</button>
<button class="login-social-button login-google-button full-width">
{{ _('Log in with %(identity_provider)s', identity_provider="Google") }}
</button>
</form>
</div>
{% endif %}
@ -136,7 +140,9 @@
<div class="login-github">
<form id='social_login_form' class="form-inline github-wrapper" action="{{ url('login-social', args=('github',)) }}" method="get">
<input type="hidden" name="next" value="{{ next }}">
<button class="login-social-button login-github-button github">{{ _('Log in with GitHub') }}</button>
<button class="login-social-button login-github-button github">
{{ _('Log in with %(identity_provider)s', identity_provider="GitHub") }}
</button>
</form>
</div>
{% endif %}