Closed NAllred91 closed 7 years ago
I'll try to implement i18n
@mo4islona It looks like adding all the languages will add about 500kb+ to the size of the package. I wonder if it could be implemented in a way where you can import just the languages you want and the unused languages can be removed using tree shaking by whoever is using this library.
For now, I'm able to grab the files out of the blockly repo and use them on my application side.
Please try the latest version
import Blockly from 'node-blockly/browser';
import De from 'node-blockly/lib/i18n/de';
Blockly.setLocale(De)
Dynamic imports also works but Blockly doesn't re-render workspace. You must re-render it manually after locale loaded
Check https://github.com/mo4islona/node-blockly/blob/master/test/browser/index.js#L25
Also check the async locales demo http://mo4islona.github.io/blockly/
@mo4islona Thanks, this was really easy to swap out my temporary hack with what you implemented.
It looks like this library only supports english. Is there any way you know of to add additional translation files?