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

"nojs" mode does not handle properly the ZIM with multiple languages #724

Open
kelson42 opened this issue Jan 2, 2025 · 1 comment
Open

Comments

@kelson42
Copy link
Contributor

kelson42 commented Jan 2, 2025

See, this screenshot:
Image

Not sure exactly how it should be fixed, but it should not be that ugly like now

@kelson42 kelson42 transferred this issue from kiwix/kiwix-desktop Jan 2, 2025
@kelson42 kelson42 added this to the 3.8.0 milestone Jan 2, 2025
@kelson42 kelson42 modified the milestones: 3.8.0, 3.9.0 Jan 27, 2025
@Optimus-NP
Copy link

Root Cause

Q: Why do we see this issue?
We see this issue when observing the Kiwix Library by leveraging the link: https://library.kiwix.org/nojs.

Q: Why do we see language tags when we hit the link: https://library.kiwix.org/nojs?
The answer lies in the TED talk books: https://library.kiwix.org/nojs?lang=&category=&q=ted. If you visit this link, you will see the response in the Chrome tab:

Image

Here, we can see that the

element with the CSS class book__languageTag contains multiple languages delimited by commas instead of a single language (e.g., eng, swa, or ces). Ideally, it should be a single language for each book tile.


Potential Fix

I am unable to access the zim file XML library, but my hypothesis is that the issue lies in the XML data for the TED books. If I could get access to this library, I would be able to investigate further and address this problem.


Questions

Q: I went through the documentation: kiwix-serve. My understanding is:

  • When we start the daemon using kiwix-serve, the --library option provides a directory that contains all the books available on the Kiwix Library website.
  • Somewhere in the XML files, we should have the data for the TED books as well. If we can fix that, it should resolve this issue.
  • Another option would be handle in the code, I believe code generates the HTML, so, here we need to ensure that langCode isn't comma separated list, but rather it should be a single language.

Please confirm if my understanding is correct and guide me on how to proceed with accessing the XML library to verify and address this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants