localization for sign in view

This commit is contained in:
Thomas Nahuel Rusiecki 2024-11-27 02:05:29 -03:00
parent 3d362ced40
commit 6c6e86cc73
2 changed files with 26 additions and 8 deletions

View file

@ -1,5 +1,5 @@
{% extends "login_base.html" %}
{% load i18n static %}
{% load i18n static language_code%}
{% block login_content %}
<form action="{% url 'login:login' %}" method="post" class="row g-3 needs-validation" novalidate>
@ -9,7 +9,7 @@
autocorrect="off" class="form-control textinput textInput" id="yourEmail" required
autofocus placeholder="{{ form.username.label }}"
{% if form.username.value %}value="{{ form.username.value }}" {% endif %}>
<div class="invalid-feedback">Please enter your email.</div>
<div class="invalid-feedback">{%trans 'Please enter your email.' %}</div>
{% if form.username.errors %}
<p class="text-error">
{{ form.username.errors|striptags }}
@ -30,17 +30,35 @@
<i class="input-group-text bi bi-eye" id="togglePassword" style="cursor: pointer">
</i>
</div>
<div class="invalid-feedback">Please enter your password!</div>
<div class="invalid-feedback">{% trans 'Please enter your password!'%}</div>
</div>
<input name="next" type="hidden" value="{{ success_url }}">
<div class="col-12">
<button class="btn btn-primary w-100" type="submit">Next</button>
</div>
<button class="btn btn-primary w-100" type="submit">{% trans "Next"%}</button>
</div>
</form>
<div id="login-footer" class="mt-3">
<a href="{% url 'login:password_reset' %}" data-toggle="modal" data-target="#forgotPasswordModal">{% trans "Forgot your password? Click here to recover" %}</a>
<div id="login-footer" class="mt-3 d-flex justify-content-between align-items-center">
<a href="{% url 'login:password_reset' %}" data-toggle="modal" data-target="#forgotPasswordModal">{% trans "Forgot your password? Click here to recover" %}</a>
<div class="dropdown ms-auto pl-1">
<form action="{% url 'set_language' %}" method="post">
{% csrf_token %}
<button class="btn btn-tertiary dropdown-toggle" type="button" id="languageDropdown" data-bs-toggle="dropdown" aria-expanded="false">
{% get_current_language as LANGUAGE_CODE %}
{% get_language_info_list for LANGUAGES as languages %}
{{ LANGUAGE_CODE|get_language_code:languages }}
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="languageDropdown">
{% for lang in languages %}
<li>
<button class="dropdown-item" type="submit" name="language" value="{{ lang.code }}">{{ lang.name_local }}</button>
</li>
{% endfor %}
</ul>
</form>
</div>
</div>
{% endblock %}

View file

@ -62,7 +62,7 @@
<div class="card-body">
<div class="pt-2 pb-3">
<h5 class="card-title text-center pb-0 fs-4 help">Sign in</h5>
<h5 class="card-title text-center pb-0 fs-4 help"> {% trans "Sign in" %}</h5>
</div>