I'm not sure if this issue should be marked as duplicate of #104973: language block does not preserve query string because the latter is a very old 4.x issue, and at that time the language switcher were not part of core yet. If this is a duplicate issue, please feel free to mark it as such.

Well, the problem is the same of that old issue: the language switcher block does not preserve query string parameters.

How to reproduce:

  1. Put language switcher block in some region of a multilingual site
  2. Go to /en/somepage?parameter=value
  3. Inspect language switcher links -- all links point to only "/XX/somepage"

Upon inspecting the code, I can see that no 'query' is being added to the links in locale_block function (locale.module around line 575).

Comments

vihangk’s picture

I am also facing the same problem. Is there a solution/work-around published for this?

vihangk’s picture

I found some nice hints in the post http://drupal.org/node/854104

You need to add
'query' => drupal_query_string_encode($_GET, array('q'))
in your language selection code to resolve this problem. Hopefully it helps someone who is stuck with the same problem.

Thanks,
Vihang

dddave’s picture