Summon Integration (Multiple Language Support)

Please review our general https://thirdiron.atlassian.net/wiki/spaces/BrowZineAPIDocs/pages/104988678 first! This guide will only explain the details related to setting up multiple language support in the script. It will work best to have the default integration setup and functioning before modifying it further.

On December 15, 2021 Ex Libris will be updating the User Interface for Summon. It is unknown at this time if this will break the way that Summon handles multiple languages. It is anticipated that the below script will continue to work if the updates are made using the MAIN instructions first: https://thirdiron.atlassian.net/wiki/spaces/BrowZineAPIDocs/pages/104988678. Notably the “Version” parameter that is now required.

Summon Integration (Multiple Language Support) Overview

The default Summon integration script sets up LibKey integration links in Summon in a single language. We have been in touch with some of our subscribers who have helped develop an integration script which can handle Summon instances offering multiple languages and ensure LibKey integration links are presented in the correct language for users.

To set this up, you will need to know the language codes associated with the alternative languages your Summon offers. These can be found by switching between languages in Summon and examining how the URL changes for different languages.

In the example screenshots below, notice how the Greek version of Summon contains gr-GR in the URL while the English one uses en.

 

Example Multiple Language Support Integration Script

These language codes will need to be inserted into the script as in the example below. It is, in essence, two copies of the integration code using two different languages for the display text. There is an additional piece of scripting to look for these language codes in the URL to tell the script which version to use.

Our example uses gr-GR for Greek. If you are using different languages, please insert the language codes you are using and the phrasing you want in the same way shown below. You can also still customize the specific LibKey options and settings as desired:

if(window.location.href.indexOf("gr-GR") > -1) { var browzine = { libraryId: "XXX", apiKey: "ENTER API KEY", version: 2, // Required for the other parameters below to work after December 15, 2021. journalWording: "Δείτε το Περιοδικό", articleWording: "Δείτε το Πλήρες Τεύχος", journalBrowZineWebLinkText: "Πλοηγηθείτε Τώρα", articleBrowZineWebLinkText: "Πλοηγηθείτε Τώρα", articlePDFDownloadLinkEnabled: true, articlePDFDownloadWording: "Το Άρθρο σε PDF", articlePDFDownloadLinkText: "Κατεβάστε το Τώρα", articleLinkEnabled: true, articleLinkTextWording: "Σύνδεσμος στο Άρθρο", articleLinkText: "Διαβάστε το Άρθρο", }; } else { var browzine = { libraryID: "XXX", apiKey: "ENTER API KEY", version: 2, // Required for the other parameters below to work after December 15, 2021. journalWording: "View the Journal", articleWording: "View Complete Issue", journalBrowZineWebLinkText: "Browse Now", articleBrowZineWebLinkText: "Browse Now", articlePDFDownloadLinkEnabled: true, articlePDFDownloadWording: "Article PDF", articlePDFDownloadLinkText: "Download Now", articleLinkEnabled: true, articleLinkTextWording: "Article Link", articleLinkText: "Read Article", }; } browzine.script = document.createElement("script"); browzine.script.src = "https://s3.amazonaws.com/browzine-adapters/summon/browzine-summon-adapter.js"; document.head.appendChild(browzine.script);

Theoretically this same approach could be extended to multiple languages by simply repeating the first if statement with additional codes as many times as needed.

After modifying your script as shown above, please upload and deploy it as covered in our main https://thirdiron.atlassian.net/wiki/spaces/BrowZineAPIDocs/pages/104988678 article. If you’re having problems seeing the integration or seeing the correct language text displayed after doing so, please contact us for assistance and include your script file as an attachment in your email.