Help with i18n language translation in template - strange behavior between Django 2.2.12 and 3.0+

20 views
Skip to first unread message

Александър Попов

unread,
Apr 8, 2020, 11:12:12 AM4/8/20
to Django users
Hello guys, 
I hope you are doing well :)

I have the following problem in my project:
I have a simple PasswordChangeForm, which I want to translate in German for example... Everything is fine and works correctly in Django 2.2.12:
See: 1.png
If I upgrade my Django to v 3.0+ same labels are partially translated! And this behavior is only for some languages: de,ru,bg.
For example in 'fr' everything is fine and all labels and error messages are translated.
See: 2.png and 3.png

The code that I use is same. Only Django version is different.

My code in templates/passsword.html:
 <form method="POST" >
            {% csrf_token %}
            <fieldset class="form-group">
                <legend class="border-bottom mb-4">Password change</legend>
                {% load i18n %}
                {% language 'de' %}
                {{ p_form|crispy }}
                {% endlanguage %}
            </fieldset>
            <div class="form-group">
                <button class="btn btn-outline-info" type="submit" name="btn-change">Save</button>
            </div>
 </form>


Have you faced with issue liked this? Do you have any idea, what is wrong?

Thanks in advance.
1.png
2.png
3.png
Reply all
Reply to author
Forward
0 new messages