Thanks for the info! That helps a lot. I'll try to explain what's happening for posterity and in case anyone else runs into this and then I'll give a recommendation on what to do.
So for background there are 3 main ways to get Blockly onto your webpage:
1. Use a module loader, get blockly from npm and import it into your app (recommended)
2. Use a cdn like unpkg (or download from npm into node_modules), use script tags to load the compiled code directly
3. Download the code from github and use script tags to load the necessary files (not recommended, but still technically supported since our documentation says you can do this)
We tested this patch for the first two use cases but not the last one, and it looks like that's the approach you're using. Apologies that we didn't catch this case for you.
The reason it doesn't work is that now the "unpackaged" en.js file doesn't work directly anymore. It only works once the UMD wrapper is added to the file, which happens during our package step and is included in the npm package, but isn't actually committed in the git repo. I think we will probably fix this and commit the wrapped file in another patch so that messages work for all 3 use cases, but I need to discuss with our packaging expert.
The fact that adding a script tag for `messages.js` works for you is basically a coincidence. That is the raw message file that translators use. It is not intended to be used directly and it will only work for English translations. It also may not continue to work in the future. I know at least one of our own demos uses it but that is also a mistake in our code :)
So for how to fix this:
- Ideally, you could switch to one of the other two methods listed above and don't download the code from github directly. An easy way to do this is to use npm to download blockly, the files will be placed in node_modules, and you can include a script tag that uses the files directly out of node_modules. Some of our examples do this e.g.
https://github.com/google/blockly-samples/blob/master/examples/mirror-demo/index.html#L8 (the message file you need is msg/en.js)
- Keep using messages.js but know that in the future that approach may not continue to work and it only works for English.
- Download this file
https://unpkg.com/blockly @8.0.4/msg/en.js (remove the space before the @ sign, have to circumvent google's email address scrubber) and use it instead of the one in the github repo. This would be similar to approach #2 listed above. But you want to be careful to keep this up to date and in sync with the version of Blockly you're using.
- Wait for us to release another patch containing the compiled message files, and use those (will confirm that we plan to do this asap)
- Compile/package blockly yourself and use the packaged version of the message file (really not recommended, but included here for completeness)
TLDR: Thank you for the info and we will work on a solution so that you don't have to use `messages.js`
Maribeth