@@ -706,9 +706,10 @@ function otherIdsTextNode(label, value, url) {
706706 wrapper . appendChild ( prefix )
707707 }
708708
709+ const safeUrl = sanitizeUrl ( url )
709710 const valueAsUrl = sanitizeUrl ( value )
710- if ( valueAsUrl ) {
711- // If the value itself is a URL, render it as a link and ignore the `url` parameter
711+ if ( safeUrl && valueAsUrl ) {
712+ // If both are provided and value is a URL, render value as the link
712713 wrapper . appendChild ( document . createTextNode ( ' (' ) )
713714 const a = document . createElement ( 'a' )
714715 a . href = valueAsUrl
@@ -718,10 +719,10 @@ function otherIdsTextNode(label, value, url) {
718719 wrapper . appendChild ( a )
719720 wrapper . appendChild ( document . createTextNode ( ')' ) )
720721 } else {
721- // Otherwise, keep the existing behavior: render value as text,
722+ // Otherwise, render value as text,
723+ if ( value ) wrapper . appendChild ( document . createTextNode ( value ) )
724+
722725 // and optionally append a (url) link if provided and safe
723- wrapper . appendChild ( document . createTextNode ( value ) )
724- const safeUrl = sanitizeUrl ( url )
725726 if ( safeUrl ) {
726727 wrapper . appendChild ( document . createTextNode ( ' (' ) )
727728 const a = document . createElement ( 'a' )
@@ -746,7 +747,7 @@ function renderActivityGroupFromJson(section, title, items, renderItem) {
746747 const block = document . createElement ( 'div' )
747748 block . className = 'activity-group'
748749 const heading = document . createElement ( 'h3' )
749- heading . textContent = $localize `:@@printView.activityGroupHeading: ${ title } :TITLE: (${ entries . length } :COUNT: )`
750+ heading . textContent = ` ${ title } (${ entries . length } )`
750751 block . appendChild ( heading )
751752 const list = document . createElement ( 'ul' )
752753 entries . forEach ( ( entry ) => {
@@ -835,9 +836,7 @@ function composeActivityEntryFromJson(entry, opts = {}) {
835836 idRel && idRel . toLowerCase ( ) !== 'self'
836837 ? `${ localizedRel } ${ idType } ` . trim ( )
837838 : idType || STRINGS . identifier
838- wrapper . appendChild (
839- otherIdsTextNode ( label , idValue || idUrl || '' , idUrl )
840- )
839+ wrapper . appendChild ( otherIdsTextNode ( label , idValue , idUrl ) )
841840 } )
842841 }
843842
@@ -1114,7 +1113,7 @@ function renderPeerReviews(activities, section) {
11141113 const block = document . createElement ( 'div' )
11151114 block . className = 'activity-group'
11161115 const heading = document . createElement ( 'h3' )
1117- heading . textContent = $localize `:@@printView.peerReviewHeading: Peer review (${ reviews } :REVIEW_COUNT: reviews for ${ sortedPublications . size } :PUBLICATION_COUNT: publications/grants)`
1116+ heading . textContent = ` Peer review (${ reviews } reviews for ${ sortedPublications . size } publications/grants)`
11181117 block . appendChild ( heading )
11191118 const list = document . createElement ( 'ul' )
11201119 for ( publication of sortedPublications || [ ] ) {
@@ -1192,9 +1191,7 @@ async function fetchOrcidRecord(orcidId) {
11921191 }
11931192 }
11941193 if ( ! response . ok ) {
1195- throw new Error (
1196- $localize `:@@printView.fetchFailed:Failed to fetch ORCID record (${ response . status } :STATUS:).`
1197- )
1194+ throw new Error ( `Failed to fetch ORCID record (${ response . status } ).` )
11981195 }
11991196
12001197 const recordJson = await response . json ( )
@@ -1221,10 +1218,7 @@ async function loadRecord(orcidId) {
12211218 message . className = 'error'
12221219 message . textContent = error . message
12231220 cvRoot . appendChild ( message )
1224- showStatus (
1225- $localize `:@@printView.couldNotLoad:Could not load ${ orcidId } :ORCID_ID:.` ,
1226- 'error'
1227- )
1221+ showStatus ( `Could not load ${ orcidId } .` , 'error' )
12281222 cvRoot . setAttribute ( 'aria-busy' , 'false' )
12291223 }
12301224}
0 commit comments