Answer the question
In order to leave comments, you need to log in
How to implement localization in django (display conditions)?
There is a line, it should be only in / ru, if the active localization is / en, do not show this line, for example {% if locale = ru %} show {% endif %}, respectively, if it does not fall under the condition, do not show it.
How to implement?
Answer the question
In order to leave comments, you need to log in
Use the get_current_language tag in templates.
For example:
{% get_current_language as LANGUAGE_CODE %}
{% if LANGUAGE_CODE == "ru" %}
Ваша строка
{% endif %}
Well, if it’s completely on the forehead, then just make an empty line in the localization file for en
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question