Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No i18n support #12

Closed
NAllred91 opened this issue Jul 11, 2017 · 6 comments
Closed

No i18n support #12

NAllred91 opened this issue Jul 11, 2017 · 6 comments
Assignees

Comments

@NAllred91
Copy link

It looks like this library only supports english. Is there any way you know of to add additional translation files?

@mo4islona mo4islona self-assigned this Jul 12, 2017
@mo4islona
Copy link
Owner

I'll try to implement i18n

@NAllred91
Copy link
Author

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

@mo4islona
Copy link
Owner

Please try the latest version

import Blockly from 'node-blockly/browser';
import De from 'node-blockly/lib/i18n/de';
Blockly.setLocale(De)

@mo4islona
Copy link
Owner

mo4islona commented Jul 16, 2017

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

@mo4islona
Copy link
Owner

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

@NAllred91
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants