Skip to content

Commit

Permalink
support building individial translated pages (#5151)
Browse files Browse the repository at this point in the history
yarn build -l zh-cn web/api/datatransfer/cleardata/index.html
was failing
  • Loading branch information
fiji-flo authored Jan 11, 2022
1 parent 5d81bac commit ffbd1c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion content/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,11 @@ function findAll({
return false;
}

const locale = filePath.replace(root, "").split(path.sep)[1];
if (!VALID_LOCALES.has(locale)) {
return false;
}
if (locales.size) {
const locale = filePath.replace(root, "").split(path.sep)[1];
if (!locales.get(locale)) {
return false;
}
Expand Down
3 changes: 3 additions & 0 deletions content/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ function gatherTranslations() {
for (const {
metadata: { slug, locale, title },
} of iter) {
if (!slug || !locale || !title) {
continue;
}
const translation = {
title,
locale,
Expand Down

0 comments on commit ffbd1c8

Please sign in to comment.