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:
- Put language switcher block in some region of a multilingual site
- Go to /en/somepage?parameter=value
- 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
Comment #1
vihangk commentedI am also facing the same problem. Is there a solution/work-around published for this?
Comment #2
vihangk commentedI 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
Comment #3
dddave commented#854104: Language switcher (locale_block) doesn't keep query parameters