Skip to content

Add lang switcher in footer (fix #56)

Yohan requested to merge gh-90139a64/70/ideascube/lang-switcher into master

Ref: #56 (closed)

This PR just adds a select lang switcher in the footer, but there are two tricks:

  • firstly, as it adds a form in every page, I've needed to add ids to every form, in order to make them selectable in unittests, which create a lot of noise in the diff
  • secondly, as we are using i18n URLs, we needed to workaround a limitation of the Django view: if we just give the current URL as "next" parameter, it will never work, because the URL contains the i18n prefix (for example /en/, so the Django view will set the new lang, then redirect to the next URL, which contains the i19n prefix, so will be caught by the i18n middleware, which at its turn will set the current language (so using the initial language)

Merge request reports