Fixes#5912 : handling of the conference 2021 translation updates.
Testing:
* run `./bin/tx-push-www`:
* output shows what would run with the --execute flag.
* look for `tx-push-src` wtih resource name 'conference-index-2021-l10njson', for the conference 2021 view.
DO NOT RUN THE SCRIPT WITH `--execute`
Steps to land this PR:
1. rename the resource on transifex: `conference-2021-index-l10njson` to `conference-index-2021-l10njson` so that we don't lose any current translations.
2. merge the PR. Nightly update-translations job will execute the script.
3. rename or remove [conference-2021-index-l10njson](https://github.com/LLK/scratch-l10n/tree/master/www/scratch-website.conference-2021-index-l10njson) in scratch-l10n.
When the name of the view in `routes.json` does not match the name of the resource in transifex there needs to be a mapping added to the script that generates translations. _Note: the resource name in transifex is usually based on the name of the source file in the `views` directory. Usually the name of the view in the routes file matches._
Since `routes.json` is a JSON file that does not support comments there’s no way to add a warning to the file when someone is adding a route.
The sympton was the message that there were no translations for ‘vernier’ or ‘embed’ when running translate. The `vernier` route is actually the `gdxfor` view, and `embed` is just another version of `preview`
async.auto / async.waterfall now take the callback as the last argument in functions with dependencies.
Async is modularized so eachLimit can be required specifically
start to depend on `scratch-l10n`
So far only the supported locales is used.
There is one small difference between scratch-l10n and the `languages.json` that was removed.
languages was:
`{locale: ‘languagename’, …}` key value pairs.
l10n exports:
`{locale: {name: ‘languagename’},…}
That required an additional change to the language chooser.
* detect `embed` in the URL
* initialize GUI in embed mode if detected
* match `embed` in the project page route
* add fastly config rules to redirect `/projects/embed/:id` to `/projects/:id/embed`
set-cookie causes the cache to not cache the page. Since we’re not trying to track the user beyond, we don’t want to try resetting the cookie again with the same info
This fixes an issue in compilation by upgrading node-sass to v4.6, and also upgrades express in the process.
Callback added to `writeFile` in `get-localized-urls` in order to avoid a deprecation warning during `make translations`.
* Add error checking and testing for translations. Also make build-locales quieter if there are no problems.
* Allow build with broken translations (to allow development), but fail test so that broken translations don't get merged or deployed
New of tips page, uses cards from new resources server (s3)
* added get-localized-urls script to get the generated json from the s3 bucket
* added /tips route
* correct localized-urls for other pages
* remove thingstotry
* redirect /go
* fix up /info/cards view to use resources (s3).
* redirect /go to /tips
* change /hoc redirect from /go to /tips
* Add full set of cards pdf download to tips localization
* removed cards and guides from static PDFs, they are all coming from resources.scratch.mit.edu now.
* removed things to try view
Corrections for reviews:
* decided to pretty print the localized URLs
* replaced console.errors with process.stdout and fail with exit(1)
* formatted localized-urls to make it easier to read
* moved link outside `<Button…` makes whole button clickable instead of just text
* fixed up css styles, removed unnecessary classes
* corrected “unused” resource links
This fixes https://github.com/LLK/scratchr2/issues/3798 by using regex in expressjs patterns, and then also parsing those regex patterns for fastly, such that we can limit the scope of the regex created for a specific view