Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
fix(untranslated-ckg-pills): metadata key fix & ckg pill altText logi…
Browse files Browse the repository at this point in the history
…c fix
  • Loading branch information
qiyundai committed Jun 29, 2023
1 parent f3fb839 commit f8dc094
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions express/scripts/ckg-link-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function fetchLinkList() {
}

function matchCKGResult(ckgData, pageData) {
const ckgMatch = pageData.ckgID === ckgData.ckgID;
const ckgMatch = pageData.ckgid === ckgData.ckgID;
const pageDataTasks = pageData.tasks ?? pageData.templateTasks;
const taskMatch = ckgData.tasks?.toLowerCase() === pageDataTasks?.toLowerCase();
const currentLocale = getLocale(window.location);
Expand Down Expand Up @@ -150,15 +150,15 @@ async function updateLinkList(container, linkPill, list) {

if (pillsMapping) {
const alternateText = pillsMapping.find((row) => window.location.pathname === `${urlPrefix}${row['Express SEO URL']}` && d.ckgID === row['CKG Pill ID']);

if (alternateText && alternateText[`${localeColumnString}`]) {
const hasAlternateTextForLocale = alternateText && alternateText[`${localeColumnString}`];
if (hasAlternateTextForLocale) {
displayText = alternateText[`${localeColumnString}`];
if (templatePageData) {
templatePageData.altShortTitle = displayText;
}
}

hideUntranslatedPill = !displayText && locale !== 'us';
hideUntranslatedPill = !hasAlternateTextForLocale && locale !== 'us';
}

if (templatePageData) {
Expand Down

0 comments on commit f8dc094

Please sign in to comment.