Comments (6)
I'll try to implement i18n
from node-blockly.
@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.
from node-blockly.
Please try the latest version
import Blockly from 'node-blockly/browser';
import De from 'node-blockly/lib/i18n/de';
Blockly.setLocale(De)
from node-blockly.
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
from node-blockly.
Also check the async locales demo http://mo4islona.github.io/blockly/
from node-blockly.
@mo4islona Thanks, this was really easy to swap out my temporary hack with what you implemented.
from node-blockly.
Related Issues (20)
- Install Error is caused by `xmlshim` that depend on `libxmljs` HOT 4
- Possible to build on our own?
- Can't load javascript blocks HOT 2
- How to import custom blocks and generate code? HOT 2
- static files from server HOT 1
- current node-blockly NPM not installing on NodeJS 10.x HOT 10
- Add /* eslint-disable */ for generated browser.js HOT 1
- Translate xml string to a javascript string in Browser HOT 4
- Usage with webpack? HOT 1
- Error when trying to generate javascript from xml that contains overridden shadows HOT 19
- Update to Blockly 2.20190722.0 (July 2019) HOT 2
- Expose blockly functions HOT 2
- Does not compile on Node 12 HOT 2
- Latest blockly version: goog is not defined HOT 4
- for help๏ผ--blockly's user block program data pass HOT 2
- goog missing in node-block/browser HOT 1
- Generator type is not always the same as block type for certain blocks HOT 2
- Blockly.JavaScript.addReservedWords() dosen't add a reserved word. HOT 1
- Update to Blockly Q2 2020? HOT 2
- Blockly.Theme.defineTheme() is not a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-blockly.