vitryd / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

Separate language resources #48

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
from group discussion 
https://groups.google.com/forum/?fromgroups#!topic/blockly/xwhG5dBZFbE

It need some balance since Blockly needs to declare the block piece by piece 
(not only just about the text, but where to put input fields and dropdown 
menu), and not all languages are ordered as english syntax. 

For example, I need to change some string and input column order of the 
original Blockly block, to reflect more comfortable Traditional Chinese syntax.

Not sure if JS support the override feature that we can extract strings from 
basic english version, and allow to override functions that needs the syntax 
customization. Then we will have an easier multi-language friendly structure.

TODO:

Extract Block Strings to _messages.js for easier i18n

1. Rename language/en to language/common,
2. Extract strings from language/en to _messages.js

The string format is 'Blockly.LANG_CONTROLS_' + block id, ex:

// Control Blocks
Blockly.LANG_CONTROLS_IF_HELPURL = 
'http://code.google.com/p/blockly/wiki/If_Then';
Blockly.LANG_CONTROLS_IF_TOOLTIP_1 = 'If a value is true, then do some 
statements.';
Blockly.LANG_CONTROLS_IF_TOOLTIP_2 = 'If a value is true, then do the first 
block of statements.\n' +
               'Otherwise, do the second block of statements.';
Blockly.LANG_CONTROLS_IF_TOOLTIP_3 = 'If the first value is true, then do the 
first block of statements.\n' +
               'Otherwise, if the second value is true, do the second block of statements.';
Blockly.LANG_CONTROLS_IF_TOOLTIP_4 = 'If the first value is true, then do the 
first block of statements.\n' +
               'Otherwise, if the second value is true, do the second block of statements.\n' +
               'If none of the values are true, do the last block of statements.';

Original issue reported on code.google.com by gasolin on 22 Jun 2012 at 1:55

GoogleCodeExporter commented 8 years ago
Hi gasolin.
I'm mnagaku.

in maze demo's frame.html

  <script type="text/javascript" src="../../language/en/logic.js"></script>

this line has not been fixed yet.

  <script type="text/javascript" src="../../language/common/logic.js"></script>

thx!

Original comment by mnag...@gmail.com on 1 Jul 2012 at 7:23

GoogleCodeExporter commented 8 years ago
mnagaku, 

maze demo was fixed in r299, thanks

Original comment by gasolin on 2 Jul 2012 at 2:08

GoogleCodeExporter commented 8 years ago
fixed at r348

Original comment by gasolin on 12 Jul 2012 at 12:55