Y
Y
Yura Khlyan2017-08-31 15:32:49
Django
Yura Khlyan, 2017-08-31 15:32:49

How to combine FlatPages and Internationalization?

Good day.
I have a multilingual(2) Django-Oscar project. In it I need to add FlatPages. It is not a problem to add them, but when I change the language, the code of the selected language is not added to the static page url, respectively 404. In which direction should I dig?
Here is the form code for switching languages:

<form id="language_selector" class="navbar-left navbar-form" action="{% url 'set_language' %}" method="post">
  {% csrf_token %}
  <input name="next" type="hidden" value="{{ language_neutral_url_path }}" />
  {% for language in LANGUAGES %}
    <input type="radio" name="language" id="language_{{ language.0 }}" value="{{ language.0 }}" class="hide language-select-input">
    <label for="language_{{ language.0 }}" class="language-btn {% if language.0 == LANGUAGE_CODE%} selected link_site_style{% endif %}">
        <button type="button">{{ language.1 }}</button>
    </label>
  {% endfor %}
</form>

As far as I understood from the code, the prefixes for the language are given very deeply somewhere. But not to static pages.
I will be very grateful for your help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question