Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo sync #26946

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions middleware/contextualizers/glossaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import { correctTranslatedContentStrings } from '../../lib/correct-translation-c
export default async function glossaries(req, res, next) {
if (!req.pagePath.endsWith('get-started/quickstart/github-glossary')) return next()

// If the current version (which is found as part of the URL), does not
// correspond to a supported version, the Liquid rendering will fail
// (if there's uses of `ifversion` in any the Liquid).
// So we'll skip this contextualizer and let the 404 error take over later.
if (!req.context.currentVersionObj) return next()

// When the current language is *not* English, we'll need to get the English
// glossary based on the term. We'll use this to render the translated
// glossaries. For example, if the Korean translation has a corruption
Expand Down