Changing the language, first response is 404 and after doing back getting the translated page

29 views Asked by At

I'm really curious to know why it happens everytime, always after changing the laguage initialy getting the 404 page, and after doing back, getting the translated page. AND NOTE that it always happens every first time. What can be a problem?

Example: here it is when I'm opening the page in browser:

http://127.0.0.1:8000/

After changing to /fr:

http://127.0.0.1:8000/fr        # getting error because of absence '/' at the end

After adding '/' everything works perfect:

http://127.0.0.1:8000/fr/

I hope I could explain to you my bug. Any suggestions or advices, please?

<ul class="dropdown-menu">
    {% get_current_language as LANGUAGE_CODE %}</li>
    {% get_available_languages as LANGUAGES %}</li>
    {% get_language_info_list for LANGUAGES as languages%}
    {% for lang in languages%}
        <li>
            <a class="dropdown-item" href="/{{ lang.code }}{{ request.get_full_path|slice:"3:" }}**/**">{{ lang.code }}</a>
        </li>
                                    {% endfor %}
                
</ul>
0

There are 0 answers