Bug 41318 - AmazonLocale system preference - add Brazil as an option
Summary: AmazonLocale system preference - add Brazil as an option
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-26 17:38 UTC by David Nind
Modified: 2025-11-27 18:52 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement lets you manually set the top-level domain using the AmazonLocaleTld system preference (previously AmazonLocale), instead of using a hard-coded predefined list. Notes: - AmazonLocale system preference is now renamed to AmazonLocaleTld. - There is no dropdown list, but you can click on the domains listed under options in the description to add it. - The system preference is not actually used to retrieve the image, it is used for the link "Amazon cover image (see the original image)" at the bottom of the light box after clicking on the image. - If AmazonLocale is set and you click the link in the light box, it often leads to a page not found (404) or broken pages on the Amazon country domain.
Version(s) released in:
Circulation function:


Attachments
Bug 41318: Rename AmazonLocale to AmazonLocaleTld (19.22 KB, patch)
2025-11-27 11:46 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 41318: Rename AmazonLocale to AmazonLocaleTld (19.24 KB, patch)
2025-11-27 18:37 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Nind 2025-11-26 17:38:06 UTC
See the post on Mattermost chat https://chat.koha-community.org/koha-community/pl/7mr33cigziruzpjsutpy97acka on 27 November 2025:

amandap

Hello Kohers <3,

I would like to propose an enhancement to the AmazonLocale System Preference to include Brazil (amazon.com.br) as a selectable option.

Currently, the system preference does not list a Brazilian locale. Brazilian libraries using Koha are forced to select the US (amazon.com) or another locale, which results in a low cover image match rate for Brazilian Portuguese editions, as our editions often differ significantly from those listed in other Amazon stores.

Including amazon.com.br would significantly improve the accuracy of cover images displayed on the OPAC and Staff Interface for libraries operating in Brazil and potentially other Portuguese-speaking countries, enhancing the value of the Enhanced Content feature for this region.

Thank you for considering this enhancement.
Comment 1 Jonathan Druart 2025-11-27 11:46:52 UTC
Created attachment 189988 [details] [review]
Bug 41318: Rename AmazonLocale to AmazonLocaleTld

To be more flexible we could allow the top-level domain instead of
having a predefined list.
However this patch still list the different available options (and adds
Brazilian) for easy selection.

Note that this system preference is not used to retrieve the image but
only to link to from the image. Contrary to what the reporter of the bug
report thought. And actually what I thought as well until I finished to
write the patch and started testing it!
Anyway now the patch is written, there should not be any changes in
behaviour. Most of the time the links are actually broken when not using
.com. So I think we either broke the whole feature at some point, or it
never really worked. On a separate bug we could eventually have a look
at fetching from the locale tld.

Test plan:
Turn on OPACAmazonCoverImages and AmazonCoverImages
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=5
http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=5
=> You see the PBP cover
click on it, it opens the lightbox, click "(see the original image)" at
the bottom
=> This is where the syspref AmazonLocale/AmazonLocaleTld acts

Modify the syspref's value and confirm that the link is modified and
point to the correct domain (leading to 404 or broken pages most of the time,
at least in my tests).
Comment 2 Jonathan Druart 2025-11-27 11:50:57 UTC
The "fun" part is that the Brazilian's 404 is also a dog, not the same however :D
Comment 3 David Nind 2025-11-27 18:37:48 UTC
Created attachment 190000 [details] [review]
Bug 41318: Rename AmazonLocale to AmazonLocaleTld

To be more flexible we could allow the top-level domain instead of
having a predefined list.
However this patch still list the different available options (and adds
Brazilian) for easy selection.

Note that this system preference is not used to retrieve the image but
only to link to from the image. Contrary to what the reporter of the bug
report thought. And actually what I thought as well until I finished to
write the patch and started testing it!
Anyway now the patch is written, there should not be any changes in
behaviour. Most of the time the links are actually broken when not using
.com. So I think we either broke the whole feature at some point, or it
never really worked. On a separate bug we could eventually have a look
at fetching from the locale tld.

Test plan:
Turn on OPACAmazonCoverImages and AmazonCoverImages
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=5
http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=5
=> You see the PBP cover
click on it, it opens the lightbox, click "(see the original image)" at
the bottom
=> This is where the syspref AmazonLocale/AmazonLocaleTld acts

Modify the syspref's value and confirm that the link is modified and
point to the correct domain (leading to 404 or broken pages most of the time,
at least in my tests).

Signed-off-by: David Nind <david@davidnind.com>