openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Language-Aware "Random Book" Feature

Open JordanFrederick opened this issue 7 months ago • 2 comments

With Open Library becoming increasingly more language-aware (edition aware carousals, etc), it would be nice if the "Random Book" feature was as well. For example, only showing books with French editions available when the user has chosen to display the website in French.

Relevant code

This function will need to take into account the current user language:

https://github.com/internetarchive/openlibrary/blob/35e1ecef5cc8841f6efe33656343b14181ebbd1d/openlibrary/plugins/openlibrary/home.py#L126-L131

https://github.com/internetarchive/openlibrary/blob/35e1ecef5cc8841f6efe33656343b14181ebbd1d/openlibrary/plugins/openlibrary/home.py#L112-L123

But only for populated languages. Something similar to this:

https://github.com/internetarchive/openlibrary/blob/10ed6bead1358571a3fcae970fb1fc332f39873e/openlibrary/macros/QueryCarousel.html#L17-L23

JordanFrederick avatar May 18 '25 16:05 JordanFrederick

Can you help me to get the repo to contribute ?

SinhaS12 avatar Nov 17 '25 04:11 SinhaS12

Hi @SinhaS12 , please see our Git cheat sheet: https://github.com/internetarchive/openlibrary/wiki/Git-Cheat-Sheet . And follow the guides on https://docs.openlibrary.org/ .

I also added some more information on how this issue can be tackled.

cdrini avatar Dec 08 '25 22:12 cdrini