Skip to content

Commit

Permalink
Merge pull request #516 from Davidxuwuhu/474-chinese-simplified
Browse files Browse the repository at this point in the history
474 chinese simplified
  • Loading branch information
amyjko authored Jul 12, 2024
2 parents e08488d + 3da472f commit 028a303
Show file tree
Hide file tree
Showing 5 changed files with 1,237 additions and 1,360 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions src/util/verify-locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ function checkTutorial(log: Log, locale: Locale, original: Tutorial) {
}

// Build a list of all concept links
const conceptLinks: ConceptLink[] = revised.acts
const conceptLinks: { dialog: Dialog; link: ConceptLink }[] = revised.acts
.map((act) => [
// Across all scenes
...act.scenes
Expand All @@ -815,8 +815,8 @@ function checkTutorial(log: Log, locale: Locale, original: Tutorial) {
// Keep all dialog that aren't null
.filter((line): line is Dialog => line !== null)
// Map each line of dialog to a flat list of concepts in the dialog
.map((line) =>
parseDoc(
.map((line) => {
return parseDoc(
toTokens(
DOCS_SYMBOL +
line.slice(2).join('\n\n') +
Expand All @@ -828,15 +828,19 @@ function checkTutorial(log: Log, locale: Locale, original: Tutorial) {
(node: Node): node is ConceptLink =>
node instanceof ConceptLink,
)
.flat(),
)
.map((link) => ({ dialog: line, link }))
.flat();
})
.flat(2),
])
.flat();

for (const link of conceptLinks)
for (const { dialog, link } of conceptLinks)
if (!link.isValid(locale))
log.bad(2, `Unknown tutorial concept: ${link.getName()}`);
log.bad(
2,
`Unknown tutorial concept: ${link.getName()}, found in ${dialog}`,
);

return revised;
}
Expand Down
Loading

0 comments on commit 028a303

Please sign in to comment.