Skip to content

Commit

Permalink
feat: allow challenges to be hidden by language (freeCodeCamp#40833)
Browse files Browse the repository at this point in the history
  • Loading branch information
ojeytonwilliams authored Jan 31, 2021
1 parent 8c22432 commit 81e5560
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions utils/is-audited.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
// this can go once all certs have been audited.

// Currently the auditing is going through Crowdin, so once a cert has been 100%
// proofread, we can add it in here. That means that translations can come
// through from Crowdin whenever they are done, but we don't show them on the
// client until we decide the entire cert is ready.

// NOTE: certificates themselves (.markdown files) are not currently being
// translated, but when they are they can be included by adding 'certificates'
// to the arrays below

const auditedCerts = {
espanol: [],
chinese: []
};

function isAuditedCert(lang, cert) {
if (!lang || !cert)
throw Error('Both arguments must be provided for auditing');
// in order to see the challenges in the client, add the certification that
// contains those challenges to this array:
const auditedCerts = [
'responsive-web-design',
'javascript-algorithms-and-data-structures',
'certificates'
];
return lang === 'english' || auditedCerts.includes(cert);
return lang === 'english' || auditedCerts[lang].includes(cert);
}

exports.isAuditedCert = isAuditedCert;

0 comments on commit 81e5560

Please sign in to comment.