Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

Please review our general guide on the Ex Libris Primo Integration 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 furtherone of the the non-multiple language versions installed (Option 1, 2 3, or 4 will work fine) and running first before looking into modifying it as demonstrated below.

Primo Integration (Multiple Language Support) Overview

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

...

These language codes will then need to be inserted into the example scripts below. The first script 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 and to use them to tell the script which version to load.

Our example below uses en for English and cy for Welsh along with English and Welsh phrasing for the text and has options configured per the “Option 1” setup on the main primo configuration page. 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:

Code Block
languagejs
  // Begin BrowZine - Primo Integration...	

     var primolang = location.search.match(/lang=cy/) ? 'cy' : 'en';
 
      if (primolang == "cy") {
        window.browzine = {
          apilibraryId: "https://public-api.thirdiron.com/public/v1/libraries/XXX",
          apiKey: "ENTER API KEY",
          
          journalCoverImagesEnabled: true,
          
          journalBrowZineWebLinkTextEnabled: true,
          journalBrowZineWebLinkText: "Gweld Cynnwys y Cyfnodolyn",
          
          articleBrowZineWebLinkTextEnabled: true,          
           articleBrowZineWebLinkText: "Gweld Cynnwys y Rhifyn",
		
		
          
          articlePDFDownloadLinkEnabled: true,
		
          articlePDFDownloadLinkText: "Lawrlwytho Erthygl",
		
		          
          articleLinkEnabled: true,
          articleLinkText: "Darllen Erthygl",
          
          printRecordsIntegrationEnabled: true,
                  
          showFormatChoice: false,
          showLinkResolverLink: true,
          enableLinkOptimizer: true,
          
          articleRetractionWatchEnabled: true,
          articleRetractionWatchText: "Erthygl wedi'i thynnu'n",
          
          articleExpressionOfConcernEnabled: true,
          articleExpressionOfConcernText: "RetractedErthygl gyda Articlephryderon",
          
          unpaywallEmailAddressKey: "enter-your-email@your-institution-domain.edu",
          
          articlePDFDownloadViaUnpaywallEnabled: true,
          articlePDFDownloadViaUnpaywallText: "DownloadLawrlwytho PDFErthygl (viatrwy Unpaywall)",
          
          articleLinkViaUnpaywallEnabled: true,
          articleLinkViaUnpaywallText: "ReadDarllen ArticleErthygl (viatrwy Unpaywall)",
          
          articleAcceptedManuscriptPDFViaUnpaywallEnabled: true,
          articleAcceptedManuscriptPDFViaUnpaywallText: "DownloadLawrlwytho PDFErthygl (AcceptedLlawysgrif a ManuscriptDderbyniwyd viatrwy Unpaywall)",

          articleAcceptedManuscriptArticleLinkViaUnpaywallEnabled: true,
          articleAcceptedManuscriptArticleLinkViaUnpaywallText: "ReadDarllen ArticleErthygl (AcceptedLlawysgrif a ManuscriptDderbyniwyd viatrwy Unpaywall)",
        };
      } else {
        window.browzine = {
          apilibraryId: "https://public-api.thirdiron.com/public/v1/libraries/XXX",
          apiKey: "ENTER API KEY",
          
          journalCoverImagesEnabled: true,
          
          journalBrowZineWebLinkTextEnabled: true,
          journalBrowZineWebLinkText: "View Journal Contents",
          
          articleBrowZineWebLinkTextEnabled: true,
          articleBrowZineWebLinkText: "View Issue Contents",
          
          articlePDFDownloadLinkEnabled: true,
          articlePDFDownloadLinkText: "Download Article",
          
          articleLinkEnabled: true,
          articleLinkText: "Read Article",
          
          printRecordsIntegrationEnabled: true,
          
          showFormatChoice: false,
          showLinkResolverLink: true,
          enableLinkOptimizer: true,
          
          articleRetractionWatchEnabled: true,
          articleRetractionWatchText: "Retracted Article",
          
          articleExpressionOfConcernEnabled: true,
          articleExpressionOfConcernText: "Expression of Concern",
          
          unpaywallEmailAddressKey: "enter-your-email@your-institution-domain.edu",
          
          articlePDFDownloadViaUnpaywallEnabled: true,
          articlePDFDownloadViaUnpaywallText: "Download PDF (via Unpaywall)",
          
          articleLinkViaUnpaywallEnabled: true,
          articleLinkViaUnpaywallText: "Read Article (via Unpaywall)",
          
          articleAcceptedManuscriptPDFViaUnpaywallEnabled: true,
          articleAcceptedManuscriptPDFViaUnpaywallText: "Download PDF (Accepted Manuscript via Unpaywall)",  
                  
          articleAcceptedManuscriptArticleLinkViaUnpaywallEnabled: true,
          articleAcceptedManuscriptArticleLinkViaUnpaywallText: "Read Article (Accepted Manuscript via Unpaywall)",
        };
      }
  browzine.script = document.createElement("script");
  browzine.script.src = "https://s3.amazonaws.com/browzine-adapters/primo/browzine-primo-adapter.js";
  document.head.appendChild(browzine.script);

  //Continue Browzine
  app.controller('browzineControllerprmSearchResultAvailabilityLineAfterController', function ($scope) {
    window.browzine.primo.searchResult($scope);
  });

  app.component('prmSearchResultAvailabilityLineAfter', {
    bindings: { parentCtrl: '<' },
    controller: 'browzineController',
    template: '<prm-toc-link parent-ctrl="$ctrl.parentCtrl"></prm-toc-link>prmSearchResultAvailabilityLineAfterController'
  });
  //End BrowZine

You may also need a second piece of scripting to ensure the page is reloaded with the correct language links if the user switches languages. An example of this script is below. We are again using en for English and cy for Welsh, but please insert the language codes you are using where appropriate:

...