GithubHelp home page GithubHelp logo

No i18n support about node-blockly HOT 6 CLOSED

mo4islona avatar mo4islona commented on May 12, 2024
No i18n support

from node-blockly.

Comments (6)

mo4islona avatar mo4islona commented on May 12, 2024

I'll try to implement i18n

from node-blockly.

NAllred91 avatar NAllred91 commented on May 12, 2024

@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.

mo4islona avatar mo4islona commented on May 12, 2024

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.

mo4islona avatar mo4islona commented on May 12, 2024

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.

mo4islona avatar mo4islona commented on May 12, 2024

Also check the async locales demo http://mo4islona.github.io/blockly/

from node-blockly.

NAllred91 avatar NAllred91 commented on May 12, 2024

@mo4islona Thanks, this was really easy to swap out my temporary hack with what you implemented.

from node-blockly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.