forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow challenges to be hidden by language (freeCodeCamp#40833)
- Loading branch information
1 parent
8c22432
commit 81e5560
Showing
1 changed file
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |