js: Fix language redirect dropping URL fragment
Performing a language redirect drops the query and fragment of the URL, which causes certain links to stop working properly.
Steps to reproduce:
- Switch the page's language to e.g. Brazilian Portuguese - "pt-BR"
- Now access https://apps.gnome.org/#development
- Instead of the Development tools (which the URL fragment #development links to), one gets https://apps.gnome.org/pt-BR/ in the beginning of the page.
- Expected: https://apps.gnome.org/pt-BR/#development
Fix that by just replacing the pathname when redirecting, instead of the entire url.
Reported-by: Rafael Fontenelle
Fixes: 9cc8caf3 (js: Fix language redirect breaking back button, 2023-11-19)
Resolves: #114 (closed)
Edited by Guacamolie