Closed mu-hun closed 8 years ago
The "editor link" is just set as a basic default and changes depending on the programming language chosen. If it is Python and the "human language" is english (i.e. for http://reeborg.ca/world.html), then "Python Code" appears. Switching to Javascript, then "Javascript Code" will appear. For other "human languages" (i.e. Korean or French), the appropriate translation is obtained from some specific language file.
For example, have a look at https://github.com/aroberge/reeborg/blob/master/src/js/aa_utils.js#L95 which sets the "editor link" to Python code
for the English version.
The key is RUR.translate("Python Code")
. The translate
function is defined in the same file at https://github.com/aroberge/reeborg/blob/master/src/js/aa_utils.js#L23 When using English, it gets its value from https://github.com/aroberge/reeborg/blob/master/src/lang/translation_en.js#L55
If you look at https://github.com/aroberge/reeborg/blob/master/world.html#L315 you will see that translation_en.js
is included. To enable the proper text to appear in the "editor link", one would need to have a file named translation_kr.js
included which would have the required translation.
If you include a basic translation_kr.js
file, any missing translation will simply use the English string provided as an argument as the default. Thus, you could have a simple file which only contains the following three lines
RUR.translation["Python Code"] = korean translation;
RUR.translation["Javascript Code"] = "Javascript Code";
RUR.translation["CoffeeScript Code"] = "CoffeeScript Code";
and it would ensure that "Python Code" would be translated appropriately.
Note that I have started incorporating Blockly (https://developers.google.com/blockly/about/showcase) and that world.html has changed as a result. If you are familiar with switching branches using git, you can view the current work by switching to the "blockly" branch. I hope to be done within two days and merge the result into the current branch.
Can you confirm that blockly supports Korean by going to https://blockly-games.appspot.com/ and using the drop-down menu (top right) to switch languages? If it does, then I can probably make (most of) the required changes to world_kr.html myself when I am done.
Thanks, blockly supports Korean(NOT completed. 20~40% translated). and drop-down menu It works.
@yale2a1 Please see http://reeborg.ca/world_ko.html
I have used the two-letter language code "ko" instead of "kr". I have updated the file to include all the changes I have made on the English version; I hope I have not forgotten any.
I've completed translation
world.html
.By the way, editor name isn't translated
Line : 110 example)
result : Code Python