Fix "yarn test" for website by adding injection step to siteConfig.js #3475
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
"yarn test" was failing for website build because we were statically requiring dynamically generated js files (en.js is created from en.json, en.json is needed by CrowdIn since it can't process a js file for translateable strings, but JSON format works). These files don't exist at CI test step, and only exist at website build step after a upload/download sync. This PR adds only the available languages to the siteConfig at runtime so that "yarn test" run from /website works and the website build step also works.
Also added fixes to navigation, and added localized titles to pages.
Test plan
Tested locally by running "yarn test" from /website when no localized JSON files and docs were present, then ran after CrowdIn download step.
Need tests on CI to pass, and will require SSH-ing in to see if files output properly.