Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing UI language opens the wrong page after a partial page load #1743

Open
osma opened this issue Jan 23, 2025 · 0 comments
Open

Changing UI language opens the wrong page after a partial page load #1743

osma opened this issue Jan 23, 2025 · 0 comments
Labels
Milestone

Comments

@osma
Copy link
Member

osma commented Jan 23, 2025

URL address of the page where you encountered the problem

https://test.dev.finto.fi/yso/en/page/p19378

Description of the problem

  1. In Skosmos 3, go to the YSO concept page for "cat" in English, i.e. https://test.dev.finto.fi/yso/en/page/p19378
  2. Click on another concept in the sidebar hierarchy, e.g. "European shorthair" (this will show the new concept page using partial page load)
  3. Change the UI language to Finnish by clicking on "suomeksi"

This will show the page for the "cat" concept (kissa) in Finnish, which is not expected, since we were on the concept page for "European shorthair".

The vocabulary home page behaves in a similar way:

  1. Go to the YSO front page in English, i.e. https://test.dev.finto.fi/yso/en/
  2. Click on a concept in the hierarchy, e.g. "aapa mires" (this will perform a partial page load)
  3. Change the UI language to Finnish by clicking on "suomeksi"

Again the new concept page (aapa mires) is lost and instead the user is taken back to the vocabulary home page (this time in Finnish).

Additional information (e.g. screenshots) about the problem

I think this happens because the links to change the UI language are just regular HTML links. The partial page load doesn't change their target URLs, so they will keep pointing at the original concept page.

This doesn't happen in Skosmos 2, because when performing the partial page load, the UI language links are rewritten as well by replacing the language links with those extracted from the dynamically loaded DOM:

function updateTopbarLang(data) {
var $language = $('#language');
$language.empty();
var langBut = $('#language', data).html();
$language.append(langBut);
}

The browser you used when the problem appeared

Firefox

@osma osma added the bug label Jan 23, 2025
@osma osma added this to the 3.x milestone Jan 23, 2025
@github-project-automation github-project-automation bot moved this to Proposed Skosmos 3.0 issues (to do) in Skosmos 3.0 Backlog Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Proposed Skosmos 3.0 issues (to do)
Development

No branches or pull requests

1 participant