Ready to Learn?Ex Libris products all provide open APIs

  • Primo resources
  • Alma resources
  • Rosetta resources
  • Leganto resources
  • bX resources
  • SFX resources
  • Aleph resources
  • Voyager resources

Tech Blog

 

Converting to Simplified Chinese from Traditional Chinese on a Simplified Chinese interface on the Fly on Primo New UI

The following source codes using Angular JS  translate brief records and full records on Primo new UI to simplified Chinese from traditional Chinese when users are on a simplified Chinese interface by walking through the DOM of the associated HTML tags.

 

1. https://github.com/OUHKLIBSYS/CSIDSPrimoNewUI/blob/master/OUHK/js/custom.js

 /*Start - Convert to Simp Chin on Simp-Chin-Interface*/
 app.component('prmBriefResultContainerAfter', {
 require: ['child', '^parent'],
 bindings: {parentCtrl: '='},
 controller: 'prmBriefResultContainerAfterController'
 });
 app.controller('prmBriefResultContainerAfterController', ['angularLoad', function (angularLoad) {
 var prmCtrl = this;
 angular.element(document).ready(function () {
 angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/simpTradChinConversion.js')
 .then(function(){briefViewConvertToSimpChin(prmCtrl);});
 });
 }]);
 /*End - Convert to Simp Chin on Simp-Chin-Interface*/

 

2. https://github.com/OUHKLIBSYS/CSIDSPrimoNewUI/blob/master/OUHK/js/simpTradChinConversion.js: Providing functions to check if users are on a simplified Chinese interface and the functions of translating to/from simplified Chinese.

 

Wai-yan NG

The Open University of Hong Kong, Library

wwyng@ouhk.edu.hk