From 95c75edf9825073c2d72fda821562822d594dac9 Mon Sep 17 00:00:00 2001 From: yiting Date: Fri, 14 Mar 2014 17:01:26 -0400 Subject: [PATCH 01/16] created zh-tw directory --- .../javascript/localizations/zh-tw/array.json | 249 ++++++ .../localizations/zh-tw/boolean.json | 101 +++ .../localizations/zh-tw/canvas.json | 273 +++++++ .../javascript/localizations/zh-tw/color.json | 299 +++++++ .../localizations/zh-tw/control.json | 353 ++++++++ .../javascript/localizations/zh-tw/date.json | 114 +++ .../javascript/localizations/zh-tw/fb.json | 98 +++ .../localizations/zh-tw/geolocation.json | 132 +++ .../javascript/localizations/zh-tw/image.json | 292 +++++++ .../javascript/localizations/zh-tw/math.json | 768 ++++++++++++++++++ .../localizations/zh-tw/matrix.json | 30 + .../localizations/zh-tw/motion.json | 32 + .../localizations/zh-tw/object.json | 123 +++ .../javascript/localizations/zh-tw/path.json | 183 +++++ .../javascript/localizations/zh-tw/point.json | 92 +++ .../localizations/zh-tw/random.json | 120 +++ .../javascript/localizations/zh-tw/rect.json | 158 ++++ .../localizations/zh-tw/sensing.json | 179 ++++ .../javascript/localizations/zh-tw/shape.json | 369 +++++++++ .../javascript/localizations/zh-tw/size.json | 75 ++ .../localizations/zh-tw/social.json | 30 + .../javascript/localizations/zh-tw/sound.json | 69 ++ .../localizations/zh-tw/sprite.json | 633 +++++++++++++++ .../localizations/zh-tw/string.json | 550 +++++++++++++ .../javascript/localizations/zh-tw/text.json | 169 ++++ .../localizations/zh-tw/vector.json | 149 ++++ .../javascript/localizations/zh-tw/voice.json | 237 ++++++ 27 files changed, 5877 insertions(+) create mode 100644 languages/javascript/localizations/zh-tw/array.json create mode 100644 languages/javascript/localizations/zh-tw/boolean.json create mode 100644 languages/javascript/localizations/zh-tw/canvas.json create mode 100644 languages/javascript/localizations/zh-tw/color.json create mode 100644 languages/javascript/localizations/zh-tw/control.json create mode 100644 languages/javascript/localizations/zh-tw/date.json create mode 100644 languages/javascript/localizations/zh-tw/fb.json create mode 100644 languages/javascript/localizations/zh-tw/geolocation.json create mode 100644 languages/javascript/localizations/zh-tw/image.json create mode 100644 languages/javascript/localizations/zh-tw/math.json create mode 100644 languages/javascript/localizations/zh-tw/matrix.json create mode 100644 languages/javascript/localizations/zh-tw/motion.json create mode 100644 languages/javascript/localizations/zh-tw/object.json create mode 100644 languages/javascript/localizations/zh-tw/path.json create mode 100644 languages/javascript/localizations/zh-tw/point.json create mode 100644 languages/javascript/localizations/zh-tw/random.json create mode 100644 languages/javascript/localizations/zh-tw/rect.json create mode 100644 languages/javascript/localizations/zh-tw/sensing.json create mode 100644 languages/javascript/localizations/zh-tw/shape.json create mode 100644 languages/javascript/localizations/zh-tw/size.json create mode 100644 languages/javascript/localizations/zh-tw/social.json create mode 100644 languages/javascript/localizations/zh-tw/sound.json create mode 100644 languages/javascript/localizations/zh-tw/sprite.json create mode 100644 languages/javascript/localizations/zh-tw/string.json create mode 100644 languages/javascript/localizations/zh-tw/text.json create mode 100644 languages/javascript/localizations/zh-tw/vector.json create mode 100644 languages/javascript/localizations/zh-tw/voice.json diff --git a/languages/javascript/localizations/zh-tw/array.json b/languages/javascript/localizations/zh-tw/array.json new file mode 100644 index 00000000..b388a73c --- /dev/null +++ b/languages/javascript/localizations/zh-tw/array.json @@ -0,0 +1,249 @@ +{ + "name": "Arrays", + "help": "Arrays are lists of items. Items can be added and removed, located, sorted and more.", + "blocks": [ + { + "blocktype": "step", + "id": "e6a297e9-1255-4701-91d8-80548489ee9a", + "script": "local.array## = [];", + "help": "Create an empty array", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "array##" + } + ], + "script": "local.array##", + "type": "array" + } + ], + "sockets": [ + { + "name": "new array##" + } + ] + }, + { + "blocktype": "step", + "id": "83d67170-4ba7-45ac-95ae-bb2f314c3ae0", + "script": "local.array## = {{1}}.slice();", + "help": "create a new array with the contents of another array", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "array##" + } + ], + "script": "local.array##", + "type": "array" + } + ], + "sockets": [ + { + "name": "new array with array##", + "type": "array" + } + ] + }, + { + "blocktype": "expression", + "id": "3e56f9c1-29b9-4d0c-99bd-05ccabfa29c2", + "script": "{{1}}[{{2}}]", + "type": "any", + "help": "get an item from an index in the array", + "sockets": [ + { + "name": "array", + "type": "array" + }, + { + "name": "item", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "5b1cc330-b9b1-4062-b8d4-e5032c7a5776", + "script": "{{1}}.join({{2}})", + "type": "string", + "help": "join items of an array into a string, each item separated by given string", + "sockets": [ + { + "name": "array", + "type": "array" + }, + { + "name": "join with", + "type": "string", + "value": ", " + } + ] + }, + { + "blocktype": "step", + "id": "3fab2b88-430a-401e-88b2-2703d614780a", + "script": "{{1}}.push({{2}});", + "help": "add any object to the end of an array", + "sockets": [ + { + "name": "array", + "type": "array" + }, + { + "name": "append", + "type": "any" + } + ] + }, + { + "blocktype": "step", + "id": "77edf0e9-e5df-4294-81ef-bfa363cda3ee", + "script": "{{1}}.unshift({{2}});", + "help": "add any object to the beginning of an array", + "sockets": [ + { + "name": "array", + "type": "array" + }, + { + "name": "prepend", + "type": "any" + } + ] + }, + { + "blocktype": "expression", + "id": "bf3ed213-4435-4152-bb2c-573ce1721036", + "script": "{{1}}.length", + "type": "number", + "help": "get the length of an array", + "sockets": [ + { + "name": "array", + "type": "array", + "suffix": "length" + } + ] + }, + { + "blocktype": "expression", + "id": "f4870f0f-1dbb-4bc7-b8e3-3a00af613689", + "script": "{{1}}.splice({{2}}, 1)[0]", + "type": "any", + "help": "remove item at index from an array", + "sockets": [ + { + "name": "array", + "type": "array" + }, + { + "name": "remove item", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "e137e1a3-fe66-4d15-ae2a-596050acb6a7", + "script": "{{1}}.pop()", + "type": "any", + "help": "remove and return the last item from an array", + "sockets": [ + { + "name": "array", + "type": "array", + "suffix": "pop" + } + ] + }, + { + "blocktype": "expression", + "id": "00685267-c279-4fc1-bdbd-a07742a76b1e", + "script": "{{1}}.shift()", + "type": "any", + "help": "remove and return the first item from an array", + "sockets": [ + { + "name": "array", + "type": "array", + "suffix": "shift" + } + ] + }, + { + "blocktype": "expression", + "id": "b4f115d3-fc52-4d75-a363-5119de21e97c", + "script": "{{1}}.slice().reverse()", + "type": "array", + "help": "reverse a copy of array", + "sockets": [ + { + "name": "array", + "type": "array", + "suffix": "reversed" + } + ] + }, + { + "blocktype": "expression", + "id": "0931d219-707c-41dd-92e6-b1a7c2a0f6b3", + "script": "{{1}}.concat({{2}});", + "type": "array", + "help": "a new array formed by joining the arrays", + "sockets": [ + { + "name": "array", + "type": "array" + }, + { + "name": "concat", + "type": "array" + } + ] + }, + { + "blocktype": "context", + "id": "9f6f4e21-7abf-4e6f-b9bf-4ce8a1086a21", + "script": "{{1}}.forEach(function(item, idx){local.index = idx; local.item = item; [[1]] });", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "index" + } + ], + "script": "local.index", + "help": "index of current item in array", + "type": "number" + }, + { + "blocktype": "expression", + "sockets": [ + { + "name": "item" + } + ], + "script": "local.item", + "help": "the current item in the iteration", + "type": "any" + } + ], + "help": "run the blocks with each item of a named array", + "sockets": [ + { + "name": "array", + "type": "array", + "suffix": "for each" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/boolean.json b/languages/javascript/localizations/zh-tw/boolean.json new file mode 100644 index 00000000..7f32c969 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/boolean.json @@ -0,0 +1,101 @@ +{ + "name": "Boolean", + "help": "Booleans are true or false and expressions which evaluate to true or false", + "blocks": [ + { + "blocktype": "expression", + "id": "770756e8-3a10-4993-b02e-3d1333c98958", + "type": "boolean", + "script": "({{1}} && {{2}})", + "help": "both operands are true", + "sockets": [ + { + "name": "", + "type": "boolean" + }, + { + "name": "and", + "type": "boolean" + } + ] + }, + { + "blocktype": "expression", + "id": "a56c0d03-5c5c-4459-9aaf-cbbea6eb3abf", + "type": "boolean", + "script": "({{1}} || {{2}})", + "help": "either or both operands are true", + "sockets": [ + { + "name": "", + "type": "boolean" + }, + { + "name": "or", + "type": "boolean" + } + ] + }, + { + "blocktype": "expression", + "id": "cb9ddee8-5ee1-423b-9559-6d2cbb379b80", + "type": "boolean", + "script": "({{1}} ? !{{2}} : {{2}})", + "help": "either, but not both, operands are true", + "sockets": [ + { + "name": "", + "type": "boolean" + }, + { + "name": "xor", + "type": "boolean" + } + ] + }, + { + "blocktype": "expression", + "id": "138a6840-37cc-4e2d-b44a-af32e673ba56", + "type": "boolean", + "script": "(! {{1}})", + "help": "operand is false", + "sockets": [ + { + "name": "not", + "type": "boolean" + } + ] + }, + { + "blocktype": "expression", + "id": "de9f5ebd-2408-4c72-9705-786b1eec2b14", + "type": "boolean", + "script": "!({{1}}%2)", + "help": "true when the parameter is even", + "sockets": [ + { + "name": "", + "type": "number", + "value": 2, + "suffix": "is even" + } + ] + }, + { + "blocktype": "expression", + "id": "0ac50ac9-2af6-4073-83cf-4f79b4bde163", + "type": "boolean", + "script": "!!({{1}}%2)", + "help": "true when the parameter is odd", + "sockets": [ + { + "name": "", + "type": "number", + "value": 1, + "suffix": "is odd" + } + ] + } + + ] +} diff --git a/languages/javascript/localizations/zh-tw/canvas.json b/languages/javascript/localizations/zh-tw/canvas.json new file mode 100644 index 00000000..b818147d --- /dev/null +++ b/languages/javascript/localizations/zh-tw/canvas.json @@ -0,0 +1,273 @@ +{ + "name": "Canvas", + "help": "Canvas blocks are blocks that are about drawing on the canvas but don't fit elsewhere. Also look at the Sprites, Shapes, and Path menus.", + "blocks": [ + { + "blocktype": "context", + "script": "local.ctx.save();[[1]];local.ctx.restore();", + "help": "save the current state, run the contained steps, then restore the saved state", + "id": "9e514499-05a6-4b76-ad4b-1ea888181a8b", + "sockets": [ + { + "name": "with local state" + } + ] + }, + { + "blocktype": "step", + "script": "local.ctx.stroke();", + "help": "stroke...", + "id": "99d5828c-ccdd-47db-9abe-f67a8c065fe6", + "sockets": [ + { + "name": "stroke" + } + ] + }, + { + "blocktype": "step", + "script": "local.ctx.fill();", + "help": "fill...", + "id": "d540bb5f-7711-4133-a631-53821daeb593", + "sockets": [ + { + "name": "fill" + } + ] + }, + { + "blocktype": "step", + "id": "c7e2e322-921a-4a96-9c86-9dbbaf54eb53", + "script": "local.ctx.globalAlpha = {{1}};", + "help": "set the global alpha", + "sockets": [ + { + "name": "global alpha", + "type": "number", + "value": 1.0 + } + ] + }, + { + "blocktype": "step", + "id": "0237bbab-d62a-4ff9-afb8-4a64bc98dbc3", + "script": "local.ctx.globalCompositOperator = {{1}};", + "help": "set the global composite operator", + "sockets": [ + { + "name": "global composite operator", + "type": "string", + "options": "globalCompositeOperators", + "value": "source-over" + } + ] + }, + { + "blocktype": "step", + "id": "96085392-9a2d-4857-85f1-af2af72cf800", + "script": "local.ctx.scale({{1}},{{2}});", + "help": "change the scale of subsequent drawing", + "sockets": [ + { + "name": "scale x", + "type": "number", + "value": 1.0 + }, + { + "name": "y", + "type": "number", + "value": 1.0 + } + ] + }, + { + "blocktype": "step", + "id": "5e6ce8f8-d5a2-454e-8e88-d5155fb0eef0", + "script": "local.ctx.rotate(deg2rad({{1}}));", + "help": "rotate...", + "sockets": [ + { + "name": "rotate by", + "type": "number", + "value": 0, + "suffix": "degrees" + } + ] + }, + { + "blocktype": "step", + "id": "df0ffca8-dd43-45aa-8b9f-b7d588090cd5", + "script": "local.ctx.translate({{1}},{{2}});", + "help": "translate...", + "sockets": [ + { + "name": "translate by x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "step", + "id": "d297afc2-3941-4977-a6af-d7f4e222b467", + "script": "local.ctx.lineWidth = {{1}};", + "help": "set line width", + "sockets": [ + { + "name": "line width", + "type": "number", + "value": 1 + } + ] + }, + { + "blocktype": "step", + "id": "b538aadd-e90d-4d0d-bc12-95b7df9c2a61", + "script": "local.ctx.lineCap = {{1}};", + "help": "set line cap", + "sockets": [ + { + "name": "line cap", + "type": "string", + "options": "linecap", + "value": "round" + } + ] + }, + { + "blocktype": "step", + "id": "4b3f5315-295c-46d7-baf2-e791c707cf4f", + "script": "local.ctx.lineJoin = {{1}};", + "help": "set line join", + "sockets": [ + { + "name": "line join", + "type": "string", + "options": "linejoin", + "value": null + } + ] + }, + { + "blocktype": "step", + "id": "c3aec6b2-ccb1-4e24-b00f-0736214f44c3", + "script": "local.ctx.mitreLimit = {{1}};", + "help": "set mitre limit", + "sockets": [ + { + "name": "mitre limit", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "step", + "id": "f28b6498-87f7-4b39-bf16-81644a2a1996", + "script": "local.ctx.shadowOffsetX = {{1}}; local.ctx.shadowOffsetY = {{2}}", + "help": "set the offsets for shadow", + "sockets": [ + { + "name": "shadow offset x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "step", + "id": "278b0b41-895c-4786-9c09-d745ae5501af", + "script": "local.ctx.shadowBlur = {{1}};", + "help": "set the shadow blur radius", + "sockets": [ + { + "name": "shadow blur", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "step", + "script": "local.ctx.clearRect({{1}}.x,{{1}}.y,{{1}}.w,{{1}}.h);", + "help": "clear...", + "id": "cf17a61d-8c7a-4829-a476-0b650efda3e4", + "sockets": [ + { + "name": "clear rect", + "type": "shape", + "value": null + } + ] + }, + { + "blocktype": "step", + "script": "var point## = {{1}}; var radius## = {{2}};local.ctx.beginPath();local.ctx.arc(point##.x,point##.y,radius##,0,Math.PI*2,true);local.ctx.closePath();local.ctx.stroke();", + "help": "circle...", + "id": "b4e05d48-32e4-4e0b-832c-b2433ffda2e2", + "sockets": [ + { + "name": "stroke circle at point", + "type": "point", + "value": null + }, + { + "name": "with radius", + "type": "number", + "value": "10" + } + ] + }, + { + "blocktype": "step", + "script": "var shape## = {{1}}; var color## = {{2}}; Shape.fillShape(shape##, color##);", + "help": "fill...", + "id": "0baa9d2b-659d-40a7-bbd3-cc72712a546b", + "sockets": [ + { + "name": "fill shape", + "type": "shape", + "value": null + }, + { + "name": "with color", + "type": "color", + "value": null + } + ] + }, + { + "blocktype": "step", + "script": "var shape## = {{1}}; var color## = {{2}}; var width## = {{3}}; Shape.strokeShape(shape##, color##, width##);", + "help": "stroke...", + "id": "90b70122-340f-46a7-9753-9c39022c00ac", + "sockets": [ + { + "name": "stroke shape", + "type": "shape", + "value": null + }, + { + "name": "with color", + "type": "color", + "value": null + }, + { + "name": "and width", + "type": "number", + "value": 1 + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/color.json b/languages/javascript/localizations/zh-tw/color.json new file mode 100644 index 00000000..1b795ca4 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/color.json @@ -0,0 +1,299 @@ +{ + "name": "Color", + "help": "Color blocks are for creating, converting, and manipulating colors", + "blocks": [ + { + "blocktype": "step", + "id": "01e39af1-679d-4b4d-b30e-a093a2687063", + "script": "local.ctx.shadowColor = {{1}};", + "help": "set the shadow color", + "sockets": [ + { + "name": "shadow color", + "type": "color" + } + ] + }, + { + "blocktype": "step", + "id": "9286b647-2c6f-4fbe-ae92-3d0062bc438f", + "script": "local.ctx.strokeStyle = {{1}};", + "help": "stroke color...", + "sockets": [ + { + "name": "stroke color", + "type": "color", + "value": "#000" + } + ] + }, + { + "blocktype": "step", + "id": "6fe550a9-c630-4876-950c-f727de27b7ae", + "script": "local.ctx.fillStyle = {{1}};", + "help": "fill color...", + "sockets": [ + { + "name": "fill color", + "type": "color", + "value": "#000" + } + ] + }, + { + "blocktype": "expression", + "id": "271c8b4c-b045-4ff9-8ad5-9608ea204b09", + "script": "\"rgb(\" + {{1}} + \",\" + {{2}} + \",\" + {{3}} + \")\"", + "type": "color", + "help": "returns a color", + "sockets": [ + { + "name": "color with red", + "type": "number", + "value": 0 + }, + { + "name": "green", + "type": "number", + "value": 0 + }, + { + "name": "blue", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "13236aef-cccd-42b3-a041-e26528174323", + "script": "\"rgba(\" + {{1}} + \",\" + {{2}} + \",\" + {{3}} + \",\" + {{4}} + \")\"", + "type": "color", + "help": "returns a semi-opaque color", + "sockets": [ + { + "name": "color with red", + "type": "number", + "value": 0 + }, + { + "name": "green", + "type": "number", + "value": 0 + }, + { + "name": "blue", + "type": "number", + "value": 0 + }, + { + "name": "alpha", + "type": "number", + "value": 0.1 + } + ] + }, + { + "blocktype": "expression", + "id": "e9496816-4f7b-47d3-8c70-163df835230c", + "type": "color", + "script": "\"hsb({{1}}, {{2}}, {{3}})\"", + "help": "returns a color", + "sockets": [ + { + "name": "color with hue", + "type": "number", + "value": 0 + }, + { + "name": "saturation", + "type": "number", + "value": 0 + }, + { + "name": "brightness", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "da9a266b-8ec0-4b97-bd79-b18dc7d4596f", + "type": "color", + "script": "\"rgb(\" + randint(0,255) + \",\" + randint(0,255) + \",\" + randint(0,255) + \")\"", + "help": "returns a random color", + "sockets": [ + { + "name": "random color" + } + ] + }, + { + "blocktype": "step", + "id": "c2d8442b-c9eb-45bb-8ca6-69f2e6d4c7c7", + "script": "local.ctx.strokeStyle = {{1}};", + "help": "replaces stroke color or stroke pattern with gradient", + "sockets": [ + { + "name": "stroke gradient", + "type": "gradient" + } + ] + }, + { + "blocktype": "step", + "id": "b80bc4ea-7f07-4dd5-b2f9-d8f09e0aca55", + "script": "local.ctx.fillStyle = {{1}};", + "help": "replaces fill color or fill pattern with gradient", + "sockets": [ + { + "name": "fill gradient", + "type": "gradient" + } + ] + }, + { + "blocktype": "step", + "id": "7fd65106-276d-43f3-b433-5ce6b750d511", + "script": "local.ctx.strokeStyle = {{1}};", + "help": "replaces stroke color or stroke gradient with pattern", + "sockets": [ + { + "name": "stroke pattern", + "type": "pattern" + } + ] + }, + { + "blocktype": "step", + "id": "9f54e5b1-f539-4005-bd8e-5b759e776bba", + "script": "local.ctx.fillStyle = {{1}};", + "help": "replaces fill color or fill gradient with pattern", + "sockets": [ + { + "name": "fill pattern", + "type": "pattern" + } + ] + }, + { + "blocktype": "step", + "id": "5caf94c7-f489-4423-a0c7-d1ad066c4dc7", + "script": "local.gradient## = local.ctx.createRadialGradient({{1}}.x,{{1}}.y,{{2}},{{3}}.x,{{3}}.y,{{4}});", + "help": "create a radial gradient in the cone described by two circles", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "radial gradient##" + } + ], + "script": "local.gradient##", + "type": "gradient" + } + ], + "sockets": [ + { + "name": "create radial gradient from point1", + "type": "point" + }, + { + "name": "radius1", + "type": "number", + "value": 0 + }, + { + "name": "to point2", + "type": "point" + }, + { + "name": "radius2", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "step", + "id": "be35754d-da0e-4b26-b8f1-9a4f36e902c3", + "script": "local.gradient## = local.ctx.createLinearGradient({{1}}.x,{{1}}.y,{{2}}.x,{{2}}.y);", + "help": "create a linear gradient between two points", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "linear gradient##" + } + ], + "script": "local.linear.gradient##", + "type": "gradient" + } + ], + "sockets": [ + { + "name": "create linear gradient from point1", + "type": "point" + }, + { + "name": "to point2", + "type": "point" + } + ] + }, + { + "blocktype": "step", + "id": "a0783aab-194c-4059-8f8e-4afd93ec1ca5", + "script": "{{1}}.addColorStop({{2}}, {{3}});", + "help": "creates an additional color stop, offset must be between 0.0 and 1.0", + "sockets": [ + { + "name": "add color stop to gradient", + "type": "gradient" + }, + { + "name": "at offset", + "type": "number", + "value": 0.5 + }, + { + "name": "with color", + "type": "color", + "value": "#F00" + } + ] + }, + { + "blocktype": "step", + "id": "3a6b43b7-3392-4f0d-b2b7-c5e1dc0cf501", + "script": "local.pattern## = local.ctx.createPattern({{1}}, {{2}});", + "help": "create a pattern with the given html image", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "pattern##" + } + ], + "script": "local.pattern##", + "type": "pattern" + } + ], + "sockets": [ + { + "name": "create pattern## from image", + "type": "image" + }, + { + "name": "repeats", + "type": "string", + "options": "repetition", + "value": "repeat" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/control.json b/languages/javascript/localizations/zh-tw/control.json new file mode 100644 index 00000000..c2ec2de6 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/control.json @@ -0,0 +1,353 @@ +{ + "name": "Controls", + "help": "Contains control flow, variables, setters, and messaging blocks.", + "blocks": [ + { + "blocktype": "eventhandler", + "id": "1cf8132a-4996-47db-b482-4e336200e3ca", + "script": "function _start(){[[1]]}_start();", + "help": "this trigger will run its scripts once when the program starts", + "sockets": [ + { + "name": "when program runs" + } + ] + }, + { + "blocktype": "eventhandler", + "id": "f4a604cd-f0b5-4133-9f91-4e1abe48fb6a", + "script": "document.addEventListener('keydown', function(event){ if (global.keyForEvent(event) === {{1}}){[[1]];}});", + "help": "this trigger will run the attached blocks every time this key is pressed", + "sockets": [ + { + "name": "when", + "type": "string", + "options": "keys", + "value": "a", + "suffix": "key pressed" + } + ] + }, + { + "blocktype": "eventhandler", + "id": "f13fcf60-a7e4-4672-9ff8-06197a65af94", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "event##" + } + ], + "script": "local.event##", + "type": "object" + } + ], + "script": "document.addEventListener({{1}}, function(event){local.event##=event;[[1]]; });", + "help": "this trigger will run the attached blocks every time the chosen mouse event happens", + "sockets": [ + { + "name": "when", + "type": "string", + "options": "pointerEvents", + "value": "" + } + ] + }, + { + "blocktype": "eventhandler", + "id": "cfea9087-3d7c-46ad-aa41-579bba2f4709", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "count##" + } + ], + "script": "local.count##", + "type": "number" + } + ], + "script": "(function(){local.count##=0;requestAnimationFrame(function eachFrame(){local.count##++;[[1]];requestAnimationFrame(eachFrame);})})();", + "help": "this trigger will run the attached blocks periodically", + "sockets": [ + { + "name": "each frame" + } + ] + }, + { + "blocktype": "eventhandler", + "id": "47AA31E2-5A90-4AF1-8F98-5FDD437561B6", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "count##" + } + ], + "script": "local.count##", + "type": "number" + } + ], + "script": "(function(){local.count##=0;local.timerid##=setInterval(function(){local.count##++;if({{2}}){clearInterval(local.timerid##);return;}[[1]]},1000/{{1}});})();", + "help": "this trigger will run the attached blocks periodically", + "sockets": [ + { + "name": "repeat", + "type": "number", + "value": "30" + }, + { + "name": "times a second until", + "type": "boolean", + "value": true + } + ] + }, + { + "blocktype": "step", + "id": "079b2b89-41c2-4d00-8e21-bcb86574bf80", + "script": "local.variable## = {{1}};", + "locals": [ + { + "blocktype": "expression", + "script": "local.variable##", + "type": "any", + "sockets": [ + { + "name": "variable##" + } + ] + } + ], + "help": "create a reference to re-use the any", + "sockets": [ + { + "name": "variable variable##", + "type": "any" + } + ] + }, + { + "blocktype": "step", + "id": "b4036693-8645-4852-a4de-9e96565f9aec", + "script": "{{1}} = {{2}};", + "help": "first argument must be a variable", + "sockets": [ + { + "name": "set variable", + "type": "any" + }, + { + "name": "to", + "type": "any" + } + ] + }, + { + "blocktype": "step", + "id": "9AED48C9-A90B-49FB-9C1A-FD632F0388F5", + "script": "{{1}} += {{2}};", + "help": "first argument must be a variable", + "sockets": [ + { + "name": "increment variable", + "type": "any" + }, + { + "name": "by", + "type": "any", + "value": 1 + } + ] + }, + { + "blocktype": "context", + "id": "66b33236-c9ce-4b6c-9b69-e8c4fdadbf52", + "script": "setTimeout(function(){[[1]]},1000*{{1}});", + "help": "pause before running the following blocks", + "sockets": [ + { + "name": "schedule in", + "type": "number", + "value": "1" + }, + { + "name": "secs" + } + ] + }, + { + "blocktype": "context", + "id": "aa146082-9a9c-4ae7-a409-a89e84dc113a", + "script": "range({{1}}).forEach(function(idx, item){local.count## = idx;[[1]]});", + "help": "repeat the contained blocks so many times", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "count##" + } + ], + "script": "local.count##", + "type": "number" + } + ], + "sockets": [ + { + "name": "repeat", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "step", + "id": "b7079d91-f76d-41cc-a6aa-43fc2749429c", + "script": "global.stage.dispatchEvent(new CustomEvent(\"wb_\" + {{1}}));", + "help": "send this message to any listeners", + "sockets": [ + { + "name": "broadcast", + "type": "string", + "value": "ack", + "suffix": "message" + } + ] + }, + { + "blocktype": "step", + "id": "d175bd7d-c7fd-4465-8b1f-c82687f35577", + "script": "global.stage.dispatchEvent(new CustomEvent(\"wb_\" + {{1}}, {detail: {{2}}}));", + "help": "send this message with an object argument to any listeners", + "sockets": [ + { + "name": "broadcast", + "type": "string", + "value": "ping" + }, + { + "name": "message with data", + "type": "any" + } + ] + }, + { + "blocktype": "eventhandler", + "id": "3931a20c-f510-45e4-83d2-4005983d5cae", + "script": "global.stage.addEventListener(\"wb_\" + {{1}}, function(){[[1]]});", + "help": "add a listener for the given message, run these blocks when it is received", + "sockets": [ + { + "name": "when I receive", + "type": "string", + "value": "ack", + "suffix": "message" + } + ] + }, + { + "blocktype": "eventhandler", + "id": "a0496339-c405-4d1c-8185-9bc211bf5a56", + "script": "global.stage.addEventListener(\"wb_\" + {{1}}, function(event){local.data##=event.detail;[[1]]});", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "data##" + } + ], + "script": "local.data##", + "type": "any" + } + ], + "help": "add a listener for the given message which receives data, run these blocks when it is received", + "sockets": [ + { + "name": "when I receive", + "type": "string", + "value": "ping", + "suffix": "message with data" + } + ] + }, + { + "blocktype": "context", + "id": "b1e43170-800a-4e9b-af82-0ed5c62c47a0", + "script": "while({{1}}){[[1]]}", + "help": "repeat until the condition is false", + "sockets": [ + { + "name": "forever if", + "type": "boolean", + "value": "false" + } + ] + }, + { + "blocktype": "context", + "id": "20ba3e08-74c0-428e-b612-53545de63ce0", + "script": "if({{1}}){[[1]]}", + "help": "run the following blocks only if the condition is true", + "sockets": [ + { + "name": "if", + "type": "boolean" + } + ] + }, + { + "blocktype": "context", + "id": "6dddaf61-caf0-4976-a3f1-9d9c3bbbf5a4", + "script": "if( ! {{1}} ){ [[1]] }", + "help": "run the blocks if the condition is not true", + "sockets": [ + { + "name": "if not", + "type": "boolean" + } + ] + }, + { + "blocktype": "expression", + "id": "AB5EB656-EF22-4DD3-9B5B-9A5187DF2F2F", + "script": "(({{1}}) ? ({{2}}) : ({{3}}))", + "help": "select a result based on a condition", + "type": "any", + "sockets": [ + { + "name": "if", + "type": "boolean", + "value": null + }, + { + "name": "then", + "type": "any", + "value": null + }, + { + "name": "else", + "type": "any", + "value": null + } + ] + }, + { + "blocktype": "context", + "id": "5a09e58a-4f45-4fa8-af98-84de735d0fc8", + "script": "while(!({{1}})){[[1]]}", + "help": "repeat forever until condition is true", + "sockets": [ + { + "name": "repeat until", + "type": "boolean" + } + ] + } + ] +} \ No newline at end of file diff --git a/languages/javascript/localizations/zh-tw/date.json b/languages/javascript/localizations/zh-tw/date.json new file mode 100644 index 00000000..7e587840 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/date.json @@ -0,0 +1,114 @@ +{ + "name": "Date", + "help": "Date blocks are used to work with dates and times", + "blocks": [ + { + "blocktype": "step", + "id": "31007d66-3b78-43d8-a295-89bc81cb62d9", + "script": "local.date## = new Date();", + "help": "create a date block", + "sockets": [ + { + "name": "date##" + } + ], + "locals": [ + { + "blocktype": "expression", + "type": "date", + "script": "local.date##", + "help": "current location", + "sockets": [ + { + "name": "date##" + } + ] + } + ] + }, + { + "blocktype": "expression", + "id": "795bacf1-3abd-4e04-b181-baab9bcf6721", + "type": "number", + "script": "{{1}}.getFullYear()", + "help": "get the year (four digits)", + "sockets": [ + { + "name": "get the year", + "type": "date", + "block": "" + } + ] + }, + { + "blocktype": "expression", + "id": "1a14fa64-bf53-4584-95fe-9d6bf0cc823a", + "type": "number", + "script": "({{1}}.getMonth() + 1)", + "help": "get the month (from 1-12)", + "sockets": [ + { + "name": "get the month", + "type": "date", + "block": "" + } + ] + }, + { + "blocktype": "expression", + "id": "c2aa55be-42a0-4831-b554-b35680f81dfd", + "type": "number", + "script": "{{1}}.getDate()", + "help": "get the day of the month (from 1-31)", + "sockets": [ + { + "name": "get the date", + "type": "date", + "block": "" + } + ] + }, + { + "blocktype": "expression", + "id": "f5958007-0839-4491-a176-e2599169cb16", + "type": "number", + "script": "{{1}}.getHours()", + "help": "get the hour (from 0-23)", + "sockets": [ + { + "name": "get the hour", + "type": "date", + "block": "" + } + ] + }, + { + "blocktype": "expression", + "id": "00128be4-a08d-44cc-99a1-47eaaff6ecf4", + "type": "number", + "script": "{{1}}.getMinutes()", + "help": "get the minutes (from 0-59)", + "sockets": [ + { + "name": "get the minutes", + "type": "date", + "block": "" + } + ] + }, + { + "blocktype": "expression", + "id": "f26108f4-3427-4489-abd3-af9e26315f2f", + "type": "number", + "script": "{{1}}.getSeconds()", + "help": "get the seconds (from 0-59)", + "sockets": [ + { + "name": "get the seconds", + "type": "date", + "block": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/languages/javascript/localizations/zh-tw/fb.json b/languages/javascript/localizations/zh-tw/fb.json new file mode 100644 index 00000000..1000e2ab --- /dev/null +++ b/languages/javascript/localizations/zh-tw/fb.json @@ -0,0 +1,98 @@ +{ + "name": "Facebook", + "help": "Blocks for interacting with Facebook", + "blocks": [ + { + "blocktype": "step", + "id": "4a2fd78c-4d0e-4c96-8ec3-52a96b2d6920", + "script": "FB.api(\"/me/feed/\", \"post\", { message : {{1}} }, $.noop );", + "sockets": [ + { + "name": "share", + "type": "string" + } + ] + }, + { + "blocktype": "expression", + "id": "4f41013c-b053-439a-b284-769525f6df5d", + "script": "fb.friends.data", + "type": "array", + "sockets": [ + { + "name": "all my friends" + } + ] + }, + { + "blocktype": "expression", + "id": "9f987bdb-87f4-4cf7-aea7-6d282bc0276e", + "script": "fb.me", + "type": "object", + "sockets": [ + { + "name": "me" + } + ] + }, + { + "blocktype": "expression", + "id": "c290da4a-c84d-46ac-a6c8-20b367283ea1", + "script": "{{1}}.name", + "type": "string", + "sockets": [ + { + "name": "name of", + "type": "any" + } + ] + }, + { + "blocktype": "expression", + "id": "f0361c85-7ed9-4ecf-b5dc-c08da20034e1", + "script": "(function(){var img = new Image(); img.src=\"https://graph.facebook.com/\" + {{1}}.id + \"/picture\"; return img;})", + "type": "image", + "sockets": [ + { + "name": "image of", + "type": "any" + } + ] + }, + { + "blocktype": "expression", + "id": "6a4bbc09-5782-43b9-968b-4610c7664d29", + "type": "string", + "script": "\"https://graph.facebook.com/\" + {{1}}.id + \"/picture\"", + "sockets": [ + { + "name": "images url of", + "type": "any" + } + ] + }, + { + "blocktype": "expression", + "id": "ac41fb9e-c0c6-4e41-b190-87ba3fdb258d", + "script": "(function(){var correct = {id: \"\", name: \"\"}; $.each( fb.friends.data , function(i, user) { if( user.name.indexOf( {{1}} ) != -1 ) correct = user; } ); return correct;})()", + "type": "object", + "sockets": [ + { + "name": "friend with name like", + "type": "string" + } + ] + }, + { + "blocktype": "step", + "id": "cc6fa7cf-fa7e-47fc-b97a-27f5c83d8d4b", + "script": "FB.api( \"/search\", { \"type\" : \"place\", \"center\" : \"{{1}}.latitude,{{1}}.longitude\", \"distance\": \"1000\" }, function(r){ FB.api(\"/me/feed/\", \"post\", { place : r.data[0].id }, $.noop ); } );", + "sockets": [ + { + "name": "checkin at", + "type": "location" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/geolocation.json b/languages/javascript/localizations/zh-tw/geolocation.json new file mode 100644 index 00000000..adfa0a44 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/geolocation.json @@ -0,0 +1,132 @@ +{ + "name": "Geolocation", + "help": "Geolocation blocks are for getting your position on Earth", + "blocks": [ + { + "blocktype": "eventhandler", + "id": "0da815af-6010-48b6-838d-f7dd0999b07d", + "script": "global.location.watchPosition(function(){[[1]]});", + "help": "called every time current location is updated", + "sockets": [ + { + "name": "track my location" + } + ], + "locals": [ + { + "blocktype": "expression", + "type": "location", + "script": "global.location.currentLocation", + "help": "current location", + "sockets": [ + { + "name": "my location" + } + ] + } + ] + }, + { + "blocktype": "eventhandler", + "id": "a7b25224-a030-4cf5-8f30-026a379d958b", + "script": "global.location.whenWithinXOf({{1}},{{2}},function(){[[1]]});", + "help": "script to call when the distance from a position is less than specified distance", + "sockets": [ + { + "name": "when within", + "type": "number", + "value": 1 + }, + { + "name": "km of", + "type": "location" + } + ] + }, + { + "blocktype": "expression", + "id": "e3bcf430-979b-4fff-a856-d10071c63708", + "script": "global.location.distance({{1}},{{2}})", + "type": "number", + "help": "return distance in kilometers between two locations", + "sockets": [ + { + "name": "distance between", + "type": "location" + }, + { + "name": "and", + "type": "location" + }, + { + "name": "in km" + } + ] + }, + { + "blocktype": "expression", + "id": "84583276-c54c-4db0-b703-e0a7bdc81e71", + "script": "{{1}}.latitude", + "type": "number", + "help": "returns the latitude of a location", + "sockets": [ + { + "name": "latitude", + "type": "location" + } + ] + }, + { + "blocktype": "expression", + "id": "0afffda9-ef4f-40dc-8ac7-96354417030e", + "script": "{{1}}.longitude", + "type": "number", + "help": "returns the longitude of a location", + "sockets": [ + { + "name": "longitude", + "type": "location" + } + ] + }, + { + "blocktype": "expression", + "id": "36d3af40-e1ae-4e72-9d7e-26c64938c6ba", + "script": "{{1}}.altitude", + "type": "number", + "help": "returns the altitude of a location, or null if not available", + "sockets": [ + { + "name": "altitude (m)", + "type": "location" + } + ] + }, + { + "blocktype": "expression", + "id": "86c429bf-2d8d-45fc-8869-7d93f3821032", + "script": "{{1}}.heading", + "type": "number", + "help": "returns the heading of a location update, if moving", + "sockets": [ + { + "name": "heading (degrees from north)", + "type": "location" + } + ] + }, + { + "blocktype": "expression", + "id": "5454a36d-ed35-4c7e-880a-31849d6bbe98", + "script": "{{1}}.speed", + "type": "number", + "help": "returns the speed of a location update, if moving", + "sockets": [ + { + "name": "speed (m/s)", + "type": "location" + } + ] + } + ] +} \ No newline at end of file diff --git a/languages/javascript/localizations/zh-tw/image.json b/languages/javascript/localizations/zh-tw/image.json new file mode 100644 index 00000000..666c2b56 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/image.json @@ -0,0 +1,292 @@ +{ + "name": "Images", + "help": "Image blocks are for loading image files to use in other blocks and for manipulating images. See Sprite and Canvas menus.", + "blocks": [ + { + "blocktype": "step", + "id": "7c40299d-ca48-4aba-a326-45ccb5f9d37b", + "script": "local.image##=new Image();local.image##.src={{1}};", + "help": "Create a new image from a URL", + "sockets": [ + { + "name": "load image##", + "type": "url" + } + ], + "locals": [ + { + "blocktype": "asset", + "type": "image", + "script": "local.image##", + "help": "reference to an image", + "sockets": [ + { + "name": "image##" + } + ] + } + ] + }, + { + "blocktype": "step", + "id": "1a6150d8-b3d5-46e3-83e5-a4fe3b00f7db", + "script": "local.ctx.drawImage({{1}},{{2}}.x,{{2}}.y);", + "help": "draw the HTML <img> into the canvas without resizing", + "sockets": [ + { + "name": "draw image", + "type": "image" + }, + { + "name": "at point", + "type": "point" + } + ] + }, + { + "blocktype": "step", + "id": "da300b03-1d39-4865-ab99-beec07b53bb2", + "script": "local.ctx.drawImage({{1}},{{2}}.x,{{2}}.y,{{2}}.w,{{2}}.h);", + "help": "draw the HTML <img> into the canvas sized to the given dimension", + "sockets": [ + { + "name": "draw image", + "type": "image" + }, + { + "name": "in rect", + "type": "rect" + } + ] + }, + { + "blocktype": "step", + "id": "5514e085-970f-48c2-b6bf-a443488c3c07", + "script": "local.ctx.drawImage({{2}},{{1}}.x,{{1}}.y,{{1}}.w,{{1}}.h,{{3}}.x,{{3}}.y,{{3}}.w,{{3}}.h);", + "help": "draw a rect extracted from image into a rect specified on the canvas", + "sockets": [ + { + "name": "draw a rect", + "type": "rect" + }, + { + "name": "from image", + "type": "image" + }, + { + "name": "to rect", + "type": "rect" + } + ] + }, + { + "blocktype": "step", + "id": "6c79800c-af02-48e1-b9cb-d043e8299f7a", + "script": "local.imageData## = local.ctx.createImageData({{1}}.w,{{1}}.h);", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "imageData##" + } + ], + "script": "local.imageData##", + "type": "imagedata" + } + ], + "help": "initialize a new imageData with the specified dimensions", + "sockets": [ + { + "name": "create ImageData ImageData## with size", + "type": "size" + } + ] + }, + { + "blocktype": "step", + "id": "2137c296-1666-499c-871c-60226188f031", + "script": "local.imageData## = local.ctx.createImageData({{1}});", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "imageData##" + } + ], + "script": "local.imageData##", + "type": "imagedata" + } + ], + "help": "initialized a new imageData the same size as an existing imageData", + "sockets": [ + { + "name": "create ImageData ImageData## from imageData", + "type": "imageData" + } + ] + }, + { + "blocktype": "step", + "id": "a2745268-a506-46b6-8d96-e4c275dd5584", + "script": "local.imageData## = local.ctx.getImageData({{1}}.x,{{1}}.y,{{1}}.w,{{1}}.h);", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "imageData##" + } + ], + "script": "local.imageData##", + "type": "imagedata" + } + ], + "help": "returns the image data from the specified rectangle", + "sockets": [ + { + "name": "get imageData## for rect", + "type": "rect" + } + ] + }, + { + "blocktype": "step", + "id": "207c93f2-d8c7-4b87-99bf-d79b61faafc2", + "script": "local.ctx.putImageData({{1}},{{2}}.x,{{2}}.y);", + "help": "draw the given image data into the canvas at the given coordinates", + "sockets": [ + { + "name": "draw imageData", + "type": "imagedata" + }, + { + "name": "at point", + "type": "point" + } + ] + }, + { + "blocktype": "step", + "id": "52ecfee7-005f-45ef-8c2a-df7b15dd974f", + "script": "local.ctx.putImageData({{2}},{{3}}.x,{{3}}.y,{{1}}.x,{{1}}.y,{{1}}.w,{{1}}.h);", + "help": "draw the given image data into the canvas from the given rect to the given position", + "sockets": [ + { + "name": "draw a rect", + "type": "rect" + }, + { + "name": "from imageData", + "type": "imagedata" + }, + { + "name": "at point", + "type": "point" + } + ] + }, + { + "blocktype": "expression", + "id": "578ba232-d1c2-4354-993d-8538bbaf4de2", + "script": "{{1}}.width", + "type": "number", + "sockets": [ + { + "name": "imageData", + "type": "imagedata", + "suffix": "width" + } + ] + }, + { + "blocktype": "expression", + "id": "01bc0775-1a0b-4d0f-b009-786e18417703", + "script": "{{1}}.height", + "type": "number", + "sockets": [ + { + "name": "imageData", + "type": "imagedata", + "suffix": "height" + } + ] + }, + { + "blocktype": "expression", + "id": "5e97eed9-acf7-45af-838e-fae9bf85921c", + "script": "{{1}}.data", + "type": "array", + "sockets": [ + { + "name": "imageData", + "type": "imagedata", + "suffix": "as array" + } + ] + }, + { + "blocktype": "step", + "id": "7fa79655-4c85-45b3-be9e-a19aa038feae", + "script": "global.preloadImage('##', {{1}});", + "sockets": [ + { + "name": "create ImageData image## from url", + "type": "string" + } + ], + "locals": [ + { + "blocktype": "asset", + "sockets": [ + { + "name": "image ##" + } + ], + "script": "global.images[\"##\"]", + "type": "image" + } + ] + }, + { + "blocktype": "expression", + "id": "a7e59ad2-47ab-4240-8801-5d66d8f57fc9", + "script": "{{1}}.width", + "type": "number", + "sockets": [ + { + "name": "image", + "type": "image", + "suffix": "width" + } + ] + }, + { + "blocktype": "expression", + "id": "d9c7d36e-d15f-48a9-9423-1a6497727221", + "script": "{{1}}.height", + "type": "number", + "sockets": [ + { + "name": "image", + "type": "image", + "suffix": "height" + } + ] + }, + { + "blocktype": "expression", + "id": "8d90b1fa-2791-4381-add5-c3c5d238ac0d", + "script": "{{1}}.width", + "type": "string", + "sockets": [ + { + "name": "image", + "type": "image", + "suffix": "url" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/math.json b/languages/javascript/localizations/zh-tw/math.json new file mode 100644 index 00000000..0aaee38d --- /dev/null +++ b/languages/javascript/localizations/zh-tw/math.json @@ -0,0 +1,768 @@ +{ + "name": "Math", + "help": "Math blocks are for manipulating numbers", + "blocks": [ + { + "blocktype": "expression", + "id": "CC2FD987-1EFC-483C-BDA3-71C839E4BAC4", + "type": "number", + "script": "({{1}}E{{2}})", + "help": "scientific notation", + "sockets": [ + { + "name": "", + "type": "number", + "value": "0" + }, + { + "name": "× 10 ^", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "406d4e12-7dbd-4f94-9b0e-e2a66d960b3c", + "type": "number", + "script": "({{1}} + {{2}})", + "help": "sum of the two operands", + "sockets": [ + { + "name": "", + "type": "number", + "value": 0 + }, + { + "name": "+", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "d7082309-9f02-4cf9-bcd5-d0cac243bff9", + "type": "number", + "script": "({{1}} - {{2}})", + "help": "difference of the two operands", + "sockets": [ + { + "name": "", + "type": "number", + "value": 0 + }, + { + "name": "-", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "bd3879e6-e440-49cb-b10b-52d744846341", + "type": "number", + "script": "({{1}} * {{2}})", + "help": "product of the two operands", + "sockets": [ + { + "name": "", + "type": "number", + "value": 0 + }, + { + "name": "×", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "7f51bf70-a48d-4fda-ab61-442a0766abc4", + "type": "number", + "script": "({{1}} / {{2}})", + "help": "quotient of the two operands", + "sockets": [ + { + "name": "", + "type": "number", + "value": 0 + }, + { + "name": "÷", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "e3a5ea20-3ca9-42cf-ac02-77ff06836a7e", + "type": "boolean", + "script": "({{1}} === {{2}})", + "help": "two operands are equal", + "sockets": [ + { + "name": "", + "type": "number", + "value": 0 + }, + { + "name": "=", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "11f59515-8061-4c96-a358-4944ad58cd18", + "type": "boolean", + "script": "({{1}} !== {{2}})", + "help": "two operands are not equal", + "sockets": [ + { + "name": "", + "type": "number", + "value": "0" + }, + { + "name": "≠", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "d753757b-a7d4-4d84-99f1-cb9b8c7e62da", + "type": "boolean", + "script": "({{1}} < {{2}})", + "help": "first operand is less than second operand", + "sockets": [ + { + "name": "", + "type": "number", + "value": 0 + }, + { + "name": "<", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "A6725EBC-C1A2-4BB4-8A34-396F2CC5D833", + "type": "boolean", + "script": "({{1}} <= {{2}})", + "help": "first operand is less than or equal to second operand", + "sockets": [ + { + "name": "", + "type": "number", + "value": "0" + }, + { + "name": "≤", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "5a1f5f68-d74b-4154-b376-6a0200f585ed", + "type": "boolean", + "script": "({{1}} > {{2}})", + "help": "first operand is greater than second operand", + "sockets": [ + { + "name": "", + "type": "number", + "value": 0 + }, + { + "name": ">", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "75B859E7-9244-45DE-BA08-C3D09F67069F", + "type": "boolean", + "script": "({{1}} >= {{2}})", + "help": "first operand is greater than or equal to second operand", + "sockets": [ + { + "name": "", + "type": "number", + "value": "0" + }, + { + "name": "≥", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "a2647515-2f14-4d0f-84b1-a6e288823630", + "type": "number", + "script": "({{1}} % {{2}})", + "help": "modulus of a number is the remainder after whole number division", + "sockets": [ + { + "name": "", + "type": "number", + "value": 0 + }, + { + "name": "mod", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "4f7803c0-24b1-4a0c-a461-d46acfe9ab25", + "type": "number", + "script": "Math.round({{1}})", + "help": "rounds to the nearest whole number", + "sockets": [ + { + "name": "round", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "c38383df-a765-422e-b215-7d1cfb7557a1", + "type": "number", + "script": "Math.abs({{1}})", + "help": "converts a negative number to positive, leaves positive alone", + "sockets": [ + { + "name": "absolute value of", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "expression", + "id": "46bcac2d-eb76-417c-81af-cb894a54a86c", + "type": "number", + "script": "Math.floor({{1}})", + "help": "rounds down to nearest whole number", + "sockets": [ + { + "name": "floor of", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "expression", + "id": "4945df27-f4f3-490b-94ae-67c7081f744b", + "type": "number", + "script": "Math.ceil({{1}})", + "help": "rounds up to nearest whole number", + "sockets": [ + { + "name": "ceiling of", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "expression", + "id": "24A7ACF3-13A7-4150-8740-CB9F2B963789", + "type": "number", + "script": "gcd({{1}},{{2}})", + "help": "greatest common divisor - the largest number that is a factor of both arguments", + "sockets": [ + { + "name": "gcd of", + "type": "number", + "value": "1" + }, + { + "name": "and", + "type": "number", + "value": "2" + } + ] + }, + { + "blocktype": "expression", + "id": "E764FF62-BB0D-477E-85A2-8C0EA050904E", + "type": "number", + "script": "lcm({{1}},{{2}})", + "help": "least common multiple - the smallest number divisible by both arguments", + "sockets": [ + { + "name": "lcm of", + "type": "number", + "value": "1" + }, + { + "name": "and", + "type": "number", + "value": "2" + } + ] + }, + { + "blocktype": "expression", + "id": "F3A723AF-B17C-4549-AC7F-2FFF451A2B1E", + "type": "number", + "script": "Math.max({{1}},{{2}})", + "help": "the larger of the two arguments", + "sockets": [ + { + "name": "maximum of", + "type": "number", + "value": "1" + }, + { + "name": "or", + "type": "number", + "value": "2" + } + ] + }, + { + "blocktype": "expression", + "id": "FEA46803-0FEF-418E-9B7B-C289BE50A060", + "type": "number", + "script": "Math.min({{1}},{{2}})", + "help": "the smaller of the two arguments", + "sockets": [ + { + "name": "minimum of", + "type": "number", + "value": "1" + }, + { + "name": "or", + "type": "number", + "value": "2" + } + ] + }, + { + "blocktype": "expression", + "id": "5178A7D0-9D89-49EC-AA53-D3FA9AEDA6A4", + "type": "number", + "script": "gamma({{1}}+1)", + "help": "the product of all numbers less than or equal to the input - technically, Γ(n+1)", + "sockets": [ + { + "name": "factorial of", + "type": "number", + "value": "5" + } + ] + }, + { + "blocktype": "expression", + "id": "ce4bf2bc-a06a-47f4-ac05-df2213d087a5", + "type": "number", + "script": "Math.cos(deg2rad({{1}}))", + "help": "ratio of the length of the adjacent side to the length of the hypotenuse", + "sockets": [ + { + "name": "cosine of", + "type": "number", + "value": 10, + "suffix": "degrees" + } + ] + }, + { + "blocktype": "expression", + "id": "1a8f6a28-14e9-4400-8e80-31217309ebc9", + "type": "number", + "script": "Math.sin(deg2rad({{1}}))", + "help": "ratio of the length of the opposite side to the length of the hypotenuse", + "sockets": [ + { + "name": "sine of", + "type": "number", + "value": 10, + "suffix": "degrees" + } + ] + }, + { + "blocktype": "expression", + "id": "fcecb61b-7fd9-4a92-b6cb-77d0a2fc8541", + "type": "number", + "script": "Math.tan(deg2rad({{1}}))", + "help": "ratio of the length of the opposite side to the length of the adjacent side", + "sockets": [ + { + "name": "tangent of", + "type": "number", + "value": 10, + "suffix": "degrees" + } + ] + }, + { + "blocktype": "expression", + "id": "9bf66bb0-c182-42e5-b3a7-cf10de26b08c", + "type": "number", + "script": "rad2deg(Math.acos({{1}}))", + "help": "inverse of cosine", + "sockets": [ + { + "name": "arccosine degrees of", + "type": "number", + "value": "10" + } + ] + }, + { + "blocktype": "expression", + "id": "92f79a75-e3f4-4fc7-8f17-bf586aef180b", + "type": "number", + "script": "rad2deg(Math.asin({{1}}))", + "help": "inverse of sine", + "sockets": [ + { + "name": "arcsine degrees of", + "type": "number", + "value": "10" + } + ] + }, + { + "blocktype": "expression", + "id": "1f5ee069-148e-4e4a-a514-5179af86be15", + "type": "number", + "script": "rad2deg(Math.atan({{1}}))", + "help": "inverse of tangent", + "sockets": [ + { + "name": "arctangent degrees of", + "type": "number", + "value": "10" + } + ] + }, + { + "blocktype": "expression", + "id": "52AA07F8-7C71-4BE1-902A-3F3AC88822B0", + "type": "number", + "script": "Math.cosh(deg2rad({{1}}))", + "help": "ratio of the length of the adjacent side to the length of the hypotenuse", + "sockets": [ + { + "name": "hyperbolic cosine of", + "type": "number", + "value": "10" + }, + { + "name": "degrees" + } + ] + }, + { + "blocktype": "expression", + "id": "D5D68651-B6A1-44EE-8246-87060C62860F", + "type": "number", + "script": "Math.sinh(deg2rad({{1}}))", + "help": "ratio of the length of the opposite side to the length of the hypotenuse", + "sockets": [ + { + "name": "hyperbolic sine of", + "type": "number", + "value": "10" + }, + { + "name": "degrees" + } + ] + }, + { + "blocktype": "expression", + "id": "72442F9D-0AA5-4A0E-A3E0-7D6E46A944CF", + "type": "number", + "script": "Math.tanh(deg2rad({{1}}))", + "help": "ratio of the length of the opposite side to the length of the adjacent side", + "sockets": [ + { + "name": "hyperbolic tangent of", + "type": "number", + "value": "10" + }, + { + "name": "degrees" + } + ] + }, + { + "blocktype": "expression", + "id": "8BCC0FB3-878C-4BA8-A4A1-A73C6FE9F71B", + "type": "number", + "script": "rad2deg(Math.acosh({{1}}))", + "help": "inverse of hyperbolic cosine", + "sockets": [ + { + "name": "hyperbolic arccosine degrees of", + "type": "number", + "value": "10" + } + ] + }, + { + "blocktype": "expression", + "id": "03A6DA1C-F1AB-499C-A97E-0F59E0A6A371", + "type": "number", + "script": "rad2deg(Math.asinh({{1}}))", + "help": "inverse of hyperbolic sine", + "sockets": [ + { + "name": "hyperbolic arcsine degrees of", + "type": "number", + "value": "10" + } + ] + }, + { + "blocktype": "expression", + "id": "A114C2B7-3334-4DCB-9418-F1BB40F8604D", + "type": "number", + "script": "rad2deg(Math.atanh({{1}}))", + "help": "inverse of hyperbolic tangent", + "sockets": [ + { + "name": "hyperbolic arctangent degrees of", + "type": "number", + "value": "10" + } + ] + }, + { + "blocktype": "expression", + "id": "8a4a81d8-de25-46f0-b610-97d4f6fffbff", + "type": "number", + "script": "Math.pow({{1}}, {{2}})", + "help": "multiply a number by itself the given number of times", + "sockets": [ + { + "name": "", + "type": "number", + "value": 10 + }, + { + "name": "to the power of", + "type": "number", + "value": 2 + } + ] + }, + { + "blocktype": "expression", + "id": "668798a3-f15e-4839-b4b3-da5db380aa5a", + "type": "number", + "script": "Math.sqrt({{1}})", + "help": "the square root is the same as taking the power of 1/2", + "sockets": [ + { + "name": "square root of", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "expression", + "id": "30513651-eab2-4f85-9ec5-725df5d62851", + "type": "number", + "script": "(Math.log({{2}})/Math.log({{1}}))", + "help": "logarithm", + "sockets": [ + { + "name": "log base", + "type": "number", + "value": "10" + }, + { + "name": "of", + "type": "number", + "value": "1" + } + ] + }, + { + "blocktype": "expression", + "id": "93708036-080B-49FE-942E-E65CBC72BE44", + "script": "Math.E", + "type": "number", + "help": "base of natural logarithm", + "sockets": [ + { + "name": "e" + } + ] + }, + { + "blocktype": "expression", + "id": "a34c51d9-bfa0-49ad-8e7d-b653611836d3", + "script": "Math.PI", + "type": "number", + "help": "pi is the ratio of a circle's circumference to its diameter", + "sockets": [ + { + "name": "pi" + } + ] + }, + { + "blocktype": "expression", + "id": "da2c8203-bf80-4617-a762-92dd4d7bfa27", + "script": "(Math.PI * 2)", + "type": "number", + "help": "tau is 2 times pi, a generally more useful number", + "sockets": [ + { + "name": "tau" + } + ] + }, + { + "blocktype": "expression", + "id": "076E0F96-52EA-466E-84BC-FE41A2399510", + "type": "number", + "script": "({{1}} & {{2}})", + "help": "bitwise AND of the two operands - useful to select only specific bits", + "sockets": [ + { + "name": "bitwise", + "type": "number", + "value": "0" + }, + { + "name": "and", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "74C039B2-988F-4571-8AEB-C79F772D8F2D", + "type": "number", + "script": "({{1}} | {{2}})", + "help": "bitwise OR of the two operands - useful to set specific bits", + "sockets": [ + { + "name": "bitwise", + "type": "number", + "value": "0" + }, + { + "name": "or", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "DA40D6D3-0052-4187-92EB-2F4C0A64C39F", + "type": "number", + "script": "({{1}} ^ {{2}})", + "help": "bitwise XOR of the two operands - useful to toggle specific bits", + "sockets": [ + { + "name": "bitwise", + "type": "number", + "value": "0" + }, + { + "name": "xor", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "D58C0616-1CE4-4588-90C5-B57E1221E831", + "type": "number", + "script": "({{1}} &~ {{2}})", + "help": "bitwise NAND of the two operands - useful to unset specific bits", + "sockets": [ + { + "name": "bitwise", + "type": "number", + "value": "0" + }, + { + "name": "nand", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "43109945-DA0A-4B16-84A5-17727C0EF994", + "type": "number", + "script": "({{1}} << Math.floor({{2}}))", + "help": "left bit shift", + "sockets": [ + { + "name": "bit shift", + "type": "number", + "value": "0" + }, + { + "name": "left by", + "type": "number", + "value": "0" + }, + { + "name": "bits" + } + ] + }, + { + "blocktype": "expression", + "id": "4EE8184B-52A8-40E8-ACC6-C7D21BA90742", + "type": "number", + "script": "({{1}} >> Math.floor({{2}}))", + "help": "right bit shift", + "sockets": [ + { + "name": "bit shift", + "type": "number", + "value": "0" + }, + { + "name": "right by", + "type": "number", + "value": "0" + }, + { + "name": "bits" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/matrix.json b/languages/javascript/localizations/zh-tw/matrix.json new file mode 100644 index 00000000..578da51d --- /dev/null +++ b/languages/javascript/localizations/zh-tw/matrix.json @@ -0,0 +1,30 @@ +{ + "name": "Matrix", + "help": "Matrix blocks can be used to store more complex tranformations on the canvas", + "blocks": [ + { + "blocktype": "step", + "script": "if ({{1}}.length !== 6){alert(\"Array must have 6 numbers\"); return false;}local.ctx.transform.apply(local.ctx, {{1}});", + "help": "transform by an arbitrary matrix [a,b,c,d,e,f]", + "sockets": [ + { + "name": "transform by 6-matrix", + "type": "array" + } + ], + "id": "b65e02c5-b990-4ceb-ab18-2593337103d9" + }, + { + "blocktype": "step", + "id": "e4787583-77ce-4d45-a863-50dcb4e87af0", + "script": "if ({{1}}.length !== 6){alert(\"Array must have 6 numbers\"); return false;}local.ctx.setTransform.apply(local.ctx, {{1}});", + "help": "set transform to an arbitrary array [a,b,c,d,e,f]", + "sockets": [ + { + "name": "set transform to 6-matrix", + "type": "array" + } + ] + } + ] +} \ No newline at end of file diff --git a/languages/javascript/localizations/zh-tw/motion.json b/languages/javascript/localizations/zh-tw/motion.json new file mode 100644 index 00000000..487165ce --- /dev/null +++ b/languages/javascript/localizations/zh-tw/motion.json @@ -0,0 +1,32 @@ +{ + "name": "Motion", + "help": "Motion blocks are for detecting the motion of devices equipped with accelerometers", + "blocks": [ + { + "blocktype": "expression", + "id": "f1a792df-9508-4ad5-90f8-aa9cd60d46bc", + "type": "string", + "script": "global.accelerometer.direction", + "help": "which way is the device moving?", + "sockets": [ + { + "name": "tilt direction" + } + ] + }, + { + "blocktype": "eventhandler", + "id": "74f8f7c0-f2f9-4ea4-9888-49110785b26d", + "script": "global.accelerometer.whenTurned({{1}}, function(){[[1]]});", + "help": "handler for accelerometer events", + "sockets": [ + { + "name": "when device turned", + "type": "string", + "options": "directions" + } + ] + } + ] +} + diff --git a/languages/javascript/localizations/zh-tw/object.json b/languages/javascript/localizations/zh-tw/object.json new file mode 100644 index 00000000..bb535213 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/object.json @@ -0,0 +1,123 @@ +{ + "name": "Objects", + "help": "Objects are key/value containers. Keys must be strings, but values can be any type.", + "blocks": [ + { + "blocktype": "step", + "id": "26ee5e5c-5405-453f-8941-26ac6ea009ec", + "script": "local.object## = {};", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "object##" + } + ], + "script": "local.object##", + "type": "object" + } + ], + "help": "create a new, empty object", + "sockets": [ + { + "name": "new object##" + } + ] + }, + { + "blocktype": "step", + "id": "ee86bcd0-10e3-499f-9a81-6738374c0c1f", + "script": "{{1}}[{{2}}] = {{3}};", + "help": "set the key/value of an object", + "sockets": [ + { + "name": "object", + "type": "any" + }, + { + "name": "key", + "type": "string" + }, + { + "name": "= value", + "type": "any" + } + ] + }, + { + "blocktype": "expression", + "id": "7ca6df56-7c25-4c8c-98ef-8dfef90eff36", + "script": "{{1}}[{{2}}]", + "type": "any", + "help": "return the value of the key in an object", + "sockets": [ + { + "name": "object", + "type": "any" + }, + { + "name": "value at key", + "type": "string" + } + ] + }, + { + "blocktype": "step", + "id": "cd07f8d6-d2cb-475b-b1fb-1ee8392e0b14", + "script": "{{1}}[{{2}}].apply({{1}},{{3}});", + "help": "call instance method", + "sockets": [ + { + "name": "object", + "type": "any" + }, + { + "name": "method name", + "type": "string" + }, + { + "name": "arguments", + "type": "array" + } + ] + }, + { + "blocktype": "context", + "id": "322da80d-d8e2-4261-bab7-6ff0ae89e5f4", + "script": "Object.keys({{1}}).forEach(function(key){local.key = key; local.item = {{1}}[key]; [[1]] });", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "key" + } + ], + "script": "local.key", + "help": "key of current item in object", + "type": "string" + }, + { + "blocktype": "expression", + "sockets": [ + { + "name": "item" + } + ], + "script": "local.item", + "help": "the current item in the iteration", + "type": "any" + } + ], + "help": "run the blocks with each item of a object", + "sockets": [ + { + "name": "for each item in", + "type": "any", + "suffix": "do" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/path.json b/languages/javascript/localizations/zh-tw/path.json new file mode 100644 index 00000000..fd48fd98 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/path.json @@ -0,0 +1,183 @@ +{ + "name": "Paths", + "help": "Path blocks are for construction more complex shapes for drawing, masking, and other uses.", + "blocks": [ + { + "blocktype": "context", + "id": "5bd66c5d-1a66-4cbb-8984-a4361270c2c6", + "script": "local.ctx.beginPath();[[1]];local.ctx.closePath();", + "help": "create a path, run the contained steps, close the path", + "sockets": [ + { + "name": "with path" + } + ] + }, + { + "blocktype": "step", + "id": "f9c9328b-746c-468b-90fa-4d3da4cb1479", + "script": "local.ctx.moveTo({{1}}.x,{{1}}.y);", + "help": "move to...", + "sockets": [ + { + "name": "move to point", + "type": "point" + } + ] + }, + { + "blocktype": "step", + "id": "1dec1d26-282b-4d14-b943-6c06ebdd5ceb", + "script": "local.ctx.lineTo({{1}}.x,{{1}}.y);", + "help": "line to...", + "sockets": [ + { + "name": "line to point", + "type": "point" + } + ] + }, + { + "blocktype": "step", + "id": "e79ff085-fb9a-46cb-8e4f-f61c5563d73b", + "script": "local.ctx.quadraticCurveTo({{2}}.x, {{2}}.y, {{1}}.x, {{1}}.y);", + "help": "quad curve to ...", + "sockets": [ + { + "name": "quadradic curve to point", + "type": "point" + }, + { + "name": "with control point", + "type": "point" + } + ] + }, + { + "blocktype": "step", + "id": "f311980c-eb49-4e42-9e9b-a4bdf428d5b5", + "script": "local.ctx.bezierCurveTo({{2}}.x,{{2}}.y,{{3}}.x,{{3}}.y,{{1}}.x,{{1}}.y);", + "help": "bezier curve to...", + "sockets": [ + { + "name": "bezier curve to point", + "type": "point" + }, + { + "name": "with control points", + "type": "point" + }, + { + "name": "and", + "type": "point" + } + ] + }, + { + "blocktype": "step", + "id": "adf632ea-02e1-4087-8dfd-91e41ec520b1", + "script": "local.ctx.arcTo({{1}}.x,{{1}}.y,{{2}}.x,{{2}}.y,{{3}});", + "help": "I wish I understood this well enough to explain it better", + "sockets": [ + { + "name": "arc to point1", + "type": "point" + }, + { + "name": "point1", + "type": "point" + }, + { + "name": "with radius", + "type": "number", + "value": 1.0 + } + ] + }, + { + "blocktype": "step", + "id": "5b46a44d-6974-4eb9-ac35-ba1ec5a79304", + "script": "local.ctx.arc({{1}}.x,{{1}}.y,{{2}},deg2rad({{3}}),deg2rad({{4}}),{{5}});", + "help": "arc...", + "sockets": [ + { + "name": "arc with origin", + "type": "point" + }, + { + "name": "radius", + "type": "number" + }, + { + "name": "start angle", + "type": "number", + "value": 0 + }, + { + "name": "deg, end angle", + "type": "number", + "value": 45 + }, + { + "name": "deg", + "type": "boolean", + "value": true + } + ] + }, + { + "blocktype": "step", + "id": "236e2fb4-3705-4465-9aa8-d7128e1f1c7f", + "script": "local.ctx.rect({{1}},{{1}},{{1}},{{1}});", + "help": "rect...", + "sockets": [ + { + "name": "rect", + "type": "rect" + } + ] + }, + { + "blocktype": "step", + "id": "e4198722-951c-4dd9-8396-a70813478152", + "script": "local.ctx.arc({{1}}.x,{{1}}.y,{{2}},0,Math.PI*2,true);", + "help": "circle...", + "sockets": [ + { + "name": "circle at point", + "type": "point" + }, + { + "name": "with radius", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "step", + "id": "db455432-c7dd-4cba-af80-1802e38446c2", + "script": "local.ctx.clip();", + "help": "adds current path to the clip area", + "sockets": [ + { + "name": "clip" + } + ] + }, + { + "blocktype": "expression", + "id": "5b0fd9a6-39e7-4a70-86f8-1e7dc1c7166f", + "script": "local.ctx.isPointInPath({{1}}.x,{{1}}.y)", + "type": "boolean", + "help": "test a point against the current path", + "sockets": [ + { + "name": "is point", + "type": "point", + "suffix": "in path?" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/point.json b/languages/javascript/localizations/zh-tw/point.json new file mode 100644 index 00000000..7e0ac34f --- /dev/null +++ b/languages/javascript/localizations/zh-tw/point.json @@ -0,0 +1,92 @@ +{ + "name": "Points", + "help": "Point blocks represent and manipulate x,y coordinates.", + "blocks": [ + { + "blocktype": "expression", + "id": "71eb3271-6dc0-4a82-81cc-4c50d8acb9e7", + "script": "{x: {{1}}, y: {{2}} }", + "type": "point", + "help": "create a new point", + "sockets": [ + { + "name": "point at x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "efe5e679-8336-4e5a-ade0-4bd930826096", + "type": "point", + "script": "{x: {{1}}[0], y: {{1}}[1]}", + "help": "convert array to point", + "sockets": [ + { + "name": "point from array", + "type": "array" + } + ] + }, + { + "blocktype": "expression", + "id": "29803c49-5bd5-4473-bff7-b3cf66ab9711", + "type": "point", + "script": "{x: randint(0, global.stage_width), y: randint(0, global.stage_height)}", + "help": "returns a point at a random location on the stage", + "sockets": [ + { + "name": "random point" + } + ] + }, + { + "blocktype": "expression", + "id": "36f0eb56-9370-402d-83ef-99201a62c732", + "script": "{{1}}.x", + "type": "number", + "help": "get the x value of a point", + "sockets": [ + { + "name": "point", + "type": "point", + "suffix": "x" + } + ] + }, + { + "blocktype": "expression", + "id": "90b42cf3-185d-4556-b7e8-d9682c187425", + "script": "{{1}}.y", + "type": "number", + "help": "get the y value of a point", + "sockets": [ + { + "name": "point", + "type": "point", + "suffix": "y" + } + ] + }, + { + "blocktype": "expression", + "id": "743cba63-11d4-4a84-a3b6-a98480bdd731", + "script": "[{{1}}.x, {{1}}.y]", + "type": "array", + "help": "convert a point to an array", + "sockets": [ + { + "name": "point", + "type": "point", + "suffix": "as array" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/random.json b/languages/javascript/localizations/zh-tw/random.json new file mode 100644 index 00000000..271612a8 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/random.json @@ -0,0 +1,120 @@ +{ + "name": "Random", + "help": "Various forms of randomness for your code", + "blocks": [ + { + "blocktype": "expression", + "id": "12488f92-1fc4-41fe-a882-95c5d5fe72dd", + "type": "number", + "script": "Math.random()", + "help": "returns a random number between 0.0 and 1.0", + "sockets": [ + { + "name": "random float" + } + ] + }, + { + "blocktype": "expression", + "id": "a35fb291-e2fa-42bb-a5a6-2124bb33157d", + "type": "number", + "script": "randint({{1}}, {{2}})", + "help": "random number between two numbers (inclusive)", + "sockets": [ + { + "name": "pick random integer from", + "type": "number", + "value": 1 + }, + { + "name": "to", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "expression", + "id": "4bc09592-ed3c-4a0c-b0bd-8e520d5385b6", + "type": "number", + "script": "noise({{1}},{{2}},{{3}})", + "help": "generates Perlin noise from 3 dimensions", + "sockets": [ + { + "name": "noise from x", + "type": "number", + "value": 0.001 + }, + { + "name": "y", + "type": "number", + "value": 0.002 + }, + { + "name": "z", + "type": "number", + "value": 0.003 + } + ] + }, + { + "blocktype": "expression", + "id": "24bd9687-b29d-45af-9a00-b7961bcbd65d", + "type": "number", + "script": "noise({{1}},{{2}},1)", + "help": "generates Perlin noise from 2 dimensions", + "sockets": [ + { + "name": "noise from x", + "type": "number", + "value": 0.001 + }, + { + "name": "y", + "type": "number", + "value": 0.002 + } + ] + }, + { + "blocktype": "expression", + "id": "e3a04097-3fb2-44f8-abe4-2047e15fab21", + "type": "number", + "script": "noise({{1}},1,1)", + "help": "generates Perlin noise from 1 dimension", + "sockets": [ + { + "name": "noise from x", + "type": "number", + "value": 0.001 + } + ] + }, + { + "blocktype": "expression", + "id": "649ec162-8584-4aeb-b75d-2e55f0551015", + "type": "any", + "script": "choice({{1}})", + "help": "returns a random item from an array, without changing the array", + "sockets": [ + { + "name": "choose item from", + "type": "array" + } + ] + }, + { + "blocktype": "expression", + "id": "f444a3cd-2f1c-48e7-a2df-a2881e7a18fb", + "type": "any", + "script": "removeChoice({{1}})", + "help": "removes a random item from a array and returns the array", + "sockets": [ + { + "name": "remove random item from", + "type": "array" + } + ] + } + ] +} \ No newline at end of file diff --git a/languages/javascript/localizations/zh-tw/rect.json b/languages/javascript/localizations/zh-tw/rect.json new file mode 100644 index 00000000..7364c6de --- /dev/null +++ b/languages/javascript/localizations/zh-tw/rect.json @@ -0,0 +1,158 @@ +{ + "name": "Rects", + "help": "Rect blocks represent and manipulate rectangles represented by x,y coordinates for the top left corner of the rectangle, plus a size (width,height).", + "blocks": [ + { + "deprecated": true, + "blocktype": "expression", + "id": "67924ef4-71eb-4793-9599-d8605b14320a", + "script": "{x: {{1}}, y: {{2}}, w: {{3}}, h: {{4}} }", + "type": "rect", + "sockets": [ + { + "name": "rect at x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + }, + { + "name": "with width", + "type": "number", + "value": 10 + }, + { + "name": "height", + "type": "number", + "value": 10 + } + ] + }, + { + "deprecated": true, + "blocktype": "expression", + "id": "24b44fea-7be1-472a-a203-2a0d97515311", + "script": "{x: {{1}}.x, y: {{1}}.y, w: {{2}}.w, h: {{2}}.h}", + "type": "rect", + "sockets": [ + { + "name": "rect at point", + "type": "point" + }, + { + "name": "with size", + "type": "size" + } + ] + }, + { + "deprecated": true, + "blocktype": "expression", + "id": "68c9cfd0-d06b-41ae-9eac-d762126f6bd7", + "script": "{x: {{1}}[0], y: {{1}}[1], w: {{1}}[2], h: {{1}}[3] };", + "type": "rect", + "sockets": [ + { + "name": "rect from array", + "type": "array" + } + ] + }, + { + "deprecated": true, + "blocktype": "expression", + "id": "aed385a0-7439-4b36-ad3e-fd07c562523a", + "script": "{x: {{1}}.x, y: {{1}}.y}", + "type": "point", + "sockets": [ + { + "name": "rect", + "type": "rect", + "suffix": "position" + } + ] + }, + { + "deprecated": true, + "blocktype": "expression", + "id": "453db037-c418-467b-8808-52d84c7a3273", + "script": "{w: {{1}}.w, h: {{1}}.h}", + "type": "size", + "sockets": [ + { + "name": "rect", + "type": "rect", + "suffix": "size" + } + ] + }, + { + "blocktype": "expression", + "id": "599f6375-e26e-414c-9740-fa9fcfc8ff00", + "script": "[{{1}}.x, {{1}}.y, {{1}}.w, {{1}}.h]", + "type": "array", + "sockets": [ + { + "name": "rect", + "type": "rect", + "suffix": "as array" + } + ] + }, + { + "blocktype": "expression", + "id": "c95a1658-e1ec-4500-8766-abab8f67f865", + "script": "{{1}}.x", + "type": "number", + "sockets": [ + { + "name": "rect", + "type": "rect", + "suffix": "x" + } + ] + }, + { + "blocktype": "expression", + "id": "7ee1fb57-7a16-4eff-9077-ade7fad60e86", + "script": "{{1}}.y", + "type": "number", + "sockets": [ + { + "name": "rect", + "type": "rect", + "suffix": "y" + } + ] + }, + { + "blocktype": "expression", + "id": "79df9d07-6894-45bc-bcc8-fc565e66df0c", + "script": "{{1}}.w", + "type": "number", + "sockets": [ + { + "name": "rect", + "type": "rect", + "suffix": "width" + } + ] + }, + { + "blocktype": "expression", + "id": "8ae2a7ee-712d-4288-ac55-957a7e2b2b72", + "script": "{{1}}.h", + "type": "number", + "sockets": [ + { + "name": "rect", + "type": "rect", + "suffix": "height" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/sensing.json b/languages/javascript/localizations/zh-tw/sensing.json new file mode 100644 index 00000000..79675533 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/sensing.json @@ -0,0 +1,179 @@ +{ + "name": "Sensing", + "help": "Sensing blocks are for getting information from the environment, like user responses, mouse clicks, keyboard presses, and the size of the drawing area.", + "blocks": [ + { + "blocktype": "context", + "id": "916c79df-40f1-4280-a093-6d9dfe54d87e", + "script": "local.answer## = prompt({{1}});[[1]]", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "answer##" + } + ], + "type": "string", + "script": "local.answer##" + } + ], + "help": "Prompt the user for information", + "sockets": [ + { + "name": "ask", + "type": "string", + "value": "What's your name?", + "suffix": "and wait" + } + ] + }, + { + "blocktype": "expression", + "id": "2504cc6a-0053-4acc-8594-a00fa8a078cb", + "type": "number", + "script": "global.mouse_x", + "help": "The current horizontal mouse position", + "sockets": [ + { + "name": "mouse x" + } + ] + }, + { + "blocktype": "expression", + "id": "80600e66-f99e-4270-8c32-a2bb8d1dafe0", + "type": "number", + "script": "global.mouse_y", + "help": "the current vertical mouse position", + "sockets": [ + { + "name": "mouse y" + } + ] + }, + { + "blocktype": "expression", + "id": "ce1026a0-9acf-4d8f-a7c0-0759115af1ca", + "type": "boolean", + "script": "global.mouse_down", + "help": "true if the mouse is down, false otherwise", + "sockets": [ + { + "name": "mouse down" + } + ] + }, + { + "blocktype": "expression", + "id": "4321cef6-6365-4885-9a3c-1fd0db2b4eab", + "type": "boolean", + "script": "global.isKeyDown({{1}})", + "help": "is the given key down when this block is run?", + "sockets": [ + { + "name": "key", + "type": "string", + "options": "keys", + "value": "a", + "suffix": "pressed?" + } + ] + }, + { + "blocktype": "expression", + "id": "048218dd-0b8d-4bc9-b310-480e93232665", + "type": "number", + "script": "global.stage_width", + "help": "width of the stage where scripts are run. This may change if the browser window changes", + "sockets": [ + { + "name": "stage width" + } + ] + }, + { + "blocktype": "expression", + "id": "6f9031c6-579b-4e24-b5d1-f648aab6e0aa", + "type": "number", + "script": "global.stage_height", + "help": "height of the stage where scripts are run. This may change if the browser window changes.", + "sockets": [ + { + "name": "stage height" + } + ] + }, + { + "blocktype": "expression", + "id": "f85d3bfd-b58c-458f-b4a9-68538302aa12", + "type": "number", + "script": "global.stage_center_x", + "help": "horizontal center of the stage", + "sockets": [ + { + "name": "center x" + } + ] + }, + { + "blocktype": "expression", + "id": "083bee4f-ee36-4a35-98df-587ed586d623", + "type": "number", + "script": "global.stage_center_y", + "help": "vertical center of the stage", + "sockets": [ + { + "name": "center y" + } + ] + }, + { + "blocktype": "expression", + "id": "76184edb-ac2c-4809-899d-7b105776ba12", + "type": "number", + "script": "randint(0,global.stage_width)", + "help": "return a number between 0 and the stage width", + "sockets": [ + { + "name": "random x" + } + ] + }, + { + "blocktype": "expression", + "id": "8e749092-327d-4921-a50e-c87acefe7102", + "type": "number", + "script": "randint(0, global.stage_height)", + "help": "return a number between 0 and the stage height", + "sockets": [ + { + "name": "random y" + } + ] + }, + { + "blocktype": "step", + "id": "6b924f28-9bba-4257-a80b-2f2a591128a5", + "script": "global.timer.reset();", + "help": "set the global timer back to zero", + "sockets": [ + { + "name": "reset timer" + } + ] + }, + { + "blocktype": "expression", + "id": "f04b0e0a-b591-4eaf-954d-dea412cbfd61", + "type": "number", + "script": "global.timer.value()", + "help": "seconds since the script began running", + "sockets": [ + { + "name": "timer" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/shape.json b/languages/javascript/localizations/zh-tw/shape.json new file mode 100644 index 00000000..cfaf8ef2 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/shape.json @@ -0,0 +1,369 @@ +{ + "name": "Shapes", + "help": "Shape blocks are for creating shapes that can then be drawn or used to create sprites", + "blocks": [ + { + "deprecated": true, + "blocktype": "step", + "script": "local.ctx.clearRect({{1}}.x,{{1}}.y,{{1}}.w,{{1}}.h);", + "help": "clear...", + "id": "3d714bd6-8d02-49cb-8e56-ece642b295ad", + "sockets": [ + { + "name": "clear rect", + "type": "rect" + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "script": "var point## = {{1}}; var radius## = {{2}};local.ctx.beginPath();local.ctx.arc(point##.x,point##.y,radius##,0,Math.PI*2,true);local.ctx.closePath();local.ctx.fill();", + "help": "circle...", + "id": "3ae0e65c-1d1c-4976-8807-799b0408984b", + "sockets": [ + { + "name": "fill circle at point", + "type": "point" + }, + { + "name": "with radius", + "type": "number", + "value": 10 + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "script": "var point## = {{1}}; var radius## = {{2}}; var color## = {{3}};local.ctx.save();local.ctx.fillStyle = color##;local.ctx.beginPath();local.ctx.arc(point##.x,point##.y,radius##,0,Math.PI*2,true);local.ctx.closePath();local.ctx.fill();local.ctx.restore();", + "id": "e399d950-4d91-49aa-ac42-bfc58299633c", + "sockets": [ + { + "name": "fill circle at point", + "type": "point", + "block": "29803c49-5bd5-4473-bff7-b3cf66ab9711" + }, + { + "name": "with radius", + "type": "number", + "value": 30 + }, + { + "name": "and color", + "type": "color", + "block": "da9a266b-8ec0-4b97-bd79-b18dc7d4596f" + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "script": "var point## = {{1}}; var radius## = {{2}};local.ctx.beginPath();local.ctx.arc(point##.x,point##.y,radius##,0,Math.PI*2,true);local.ctx.closePath();local.ctx.stroke();", + "help": "circle...", + "id": "79133274-d53f-4ef4-8b17-9259fe25fb87", + "sockets": [ + { + "name": "stroke circle at point", + "type": "point" + }, + { + "name": "with radius", + "type": "number", + "value": 10 + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "script": "var point## = {{1}}; var radius## = {{2}}; var color## = {{3}};local.ctx.save();local.ctx.strokeStyle = color##;local.ctx.beginPath();local.ctx.arc(point##.x,point##.y,radius##,0,Math.PI*2,true);local.ctx.closePath();local.ctx.stroke();local.ctx.restore();", + "id": "8a091a21-1fa9-49b6-a622-696c38556a2e", + "sockets": [ + { + "name": "stroke circle at point", + "type": "point" + }, + { + "name": "with radius", + "type": "number", + "value": 10 + }, + { + "name": "and color", + "type": "color" + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "script": "var point## = {{1}}; var radius## = {{2}};local.ctx.beginPath();local.ctx.arc(point##.x,point##.y,radius##,0,Math.PI*2,true);local.ctx.closePath();local.ctx.fill();local.ctx.stroke();", + "help": "circle...", + "id": "094fa424-8b6f-4759-a9bc-f4dbf289f697", + "sockets": [ + { + "name": "stroke and fill circle at point", + "type": "point" + }, + { + "name": "with radius", + "type": "number", + "value": 10 + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "script": "var rect## = {{1}};local.ctx.fillRect(rect##.x,rect##.y,rect##.w,rect##.h);", + "help": "fill...", + "id": "bf909ec4-5387-4baf-ba43-f17df493f9bd", + "sockets": [ + { + "name": "fill rect", + "type": "rect" + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "id": "7a342b2b-f169-4071-8771-34394cc07393", + "script": "var rect## = {{1}};var color## = {{2}};local.ctx.save();local.ctx.fillStyle = color##; local.ctx.fillRect(rect##.x, rect##.y, rect##.w, rect##.h);local.ctx.restore();", + "sockets": [ + { + "name": "fill rect", + "type": "rect" + }, + { + "name": "with color", + "type": "color" + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "id": "cbc60543-0a14-4f5c-af14-a2b55148b4e0", + "script": "var rect## = {{1}};var borderRadius## = {{2}};var color## = {{3}};local.ctx.save();local.ctx.strokeStyle=color##;local.ctx.fillStyle=color##;local.ctx.lineJoin='round';local.ctx.lineWidth=borderRadius##;local.ctx.strokeRect(rect##.x+(borderRadius##/2), rect##.y+(borderRadius##/2), rect##.w-borderRadius##, rect##.h-borderRadius##);local.ctx.fillRect(rect##.x+(borderRadius##/2), rect##.y+(borderRadius##/2), rect##.w-borderRadius##, rect##.h-borderRadius##);local.ctx.restore();", + "sockets": [ + { + "name": "fill round rect", + "type": "rect", + "value": null + }, + { + "name": "with border-radius", + "type": "number", + "value": 0 + }, + { + "name": "and color", + "type": "color", + "value": null + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "id": "9cf3a017-ab20-4987-875a-5d8436377bd0", + "script": "var rect## = {{1}};var color## = {{2}};local.ctx.save();local.ctx.strokeStyle = color##; local.ctx.strokeRect(rect##.x, rect##.y, rect##.w, rect##.h);local.ctx.restore();", + "sockets": [ + { + "name": "stroke rect", + "type": "rect" + }, + { + "name": "with color", + "type": "color" + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "id": "b28a6aeb-bbad-4828-8ff1-2f846e556e1a", + "script": "var rect## = {{1}};local.ctx.strokeRect(rect##.x,rect##.y,rect##.w,rect##.h);", + "help": "stroke...", + "sockets": [ + { + "name": "stroke rect", + "type": "rect" + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "id": "ebe1b968-f117-468d-91cb-1e67c5776030", + "script": "local.ctx.fillRect({{1}},{{2}},{{3}},{{4}});local.ctx.strokeRect({{1}},{{2}},{{3}},{{4}});", + "help": "fill and stroke...", + "sockets": [ + { + "name": "fill and stroke rect x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + }, + { + "name": "width", + "type": "number", + "value": 10 + }, + { + "name": "height", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "step", + "id": "e93b909e-19f8-4f80-8308-ae896bd63189", + "script": "var points## = {{1}}; var color## = {{2}}; local.ctx.save();local.ctx.beginPath(); local.ctx.moveTo(points##[0].x, points##[0].y); for (var i = 1; i < points##.length; i ++ ) { local.ctx.lineTo(points##[i].x, points##[i].y); } local.ctx.closePath(); local.ctx.fillStyle = color##; local.ctx.fill();local.ctx.restore();", + "help": "fill the polygon defined by array of points", + "sockets": [ + { + "name": "fill polygon ", + "type": "array", + "value": null + }, + { + "name": "with color", + "type": "color", + "value": null + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "id": "c0416416-9a75-4202-b3cf-54b03f9a28ee", + "script": "var points## = {{1}}; var color## = {{2}}; local.ctx.save();local.ctx.beginPath(); local.ctx.moveTo(points##[0].x, points##[0].y); for (var i = 1; i < points##.length; i ++ ) { local.ctx.lineTo(points##[i].x, points##[i].y); } local.ctx.closePath(); local.ctx.strokeStyle = color##; local.ctx.stroke();local.ctx.restore()", + "help": "stroke the polygon defined by array of points", + "sockets": [ + { + "name": "stroke polygon ", + "type": "array", + "value": null + }, + { + "name": "with color", + "type": "color", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "8219fa9f-caeb-42cf-a3e5-9cd5066b707c", + "script": "{type: 'circle', x: {{1}}, y: {{2}}, r: {{3}}}", + "type": "shape", + "sockets": [ + { + "name": "circle at x", + "type": "number", + "value": "0" + }, + { + "name": "y", + "type": "number", + "value": "0" + }, + { + "name": "with radius", + "type": "number", + "value": "10" + } + ] + }, + { + "blocktype": "expression", + "id": "957e8a12-b933-4489-ba55-8d9a08d511a5", + "script": "{type: 'poly', points: {{1}}}", + "type": "shape", + "sockets": [ + { + "name": "polygon with points ", + "type": "array", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "7c7e116b-3035-43d7-9230-4d1b6cc4a7dd", + "script": "{type: 'rect', x: {{1}}, y: {{2}}, w: {{3}}, h: {{4}}, r:{{5}}}", + "type": "shape", + "sockets": [ + { + "name": "rect at x", + "type": "number", + "value": "0" + }, + { + "name": "y", + "type": "number", + "value": "0" + }, + { + "name": "with width", + "type": "number", + "value": "10" + }, + { + "name": "height", + "type": "number", + "value": "10" + }, + { + "name": "border-radius", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "a51afa9e-f6be-444c-a591-1ca0d0ab697f", + "script": "{type: 'rect', x: {{1}}.x, y: {{1}}.y, w: {{2}}.w, h: {{2}}.h, r: {{3}}", + "type": "shape", + "sockets": [ + { + "name": "rect at point", + "type": "point", + "value": null + }, + { + "name": "with size", + "type": "size", + "value": null + }, + { + "name": "border-radius", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "b2b9d08f-5d21-4742-a1fd-3f118c254c17", + "script": "{type: 'rect', x: {{1}}[0], y: {{1}}[1], w: {{1}}[2], h: {{1}}[3] }, r:{{1}}[4];", + "type": "shape", + "sockets": [ + { + "name": "rect from array", + "type": "array", + "value": null + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/size.json b/languages/javascript/localizations/zh-tw/size.json new file mode 100644 index 00000000..bdbee107 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/size.json @@ -0,0 +1,75 @@ +{ + "name": "Sizes", + "help": "Size blocks represent a width and height. They are often used as components of Rects.", + "blocks": [ + { + "blocktype": "expression", + "id": "d8e71067-afc2-46be-8bb5-3527b36474d7", + "script": "{w: {{1}}, h: {{2}} }", + "type": "size", + "sockets": [ + { + "name": "size with width", + "type": "number", + "value": 32 + }, + { + "name": "height", + "type": "number", + "value": 32 + } + ] + }, + { + "blocktype": "expression", + "id": "404cb2f4-abe5-4c3b-a9da-9b44050e012d", + "script": "{w: {{1}}[0], h: {{1}}[1]", + "type": "size", + "sockets": [ + { + "name": "size from array", + "type": "array" + } + ] + }, + { + "blocktype": "expression", + "id": "33f2a3b7-5d87-4481-ad1c-f2970915db51", + "script": "{{1}}.w", + "type": "number", + "sockets": [ + { + "name": "size", + "type": "size", + "suffix": "width" + } + ] + }, + { + "blocktype": "expression", + "id": "2d449e0e-cb18-473f-a574-614320b7ba22", + "script": "{{1}}.h", + "type": "number", + "sockets": [ + { + "name": "size", + "type": "size", + "suffix": "height" + } + ] + }, + { + "blocktype": "expression", + "id": "7ca31ad7-946a-4587-a5c8-d6b8879dc4e2", + "script": "[{{1}}.w, {{1}}.h]", + "type": "array", + "sockets": [ + { + "name": "size", + "type": "size", + "suffix": "as array" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/social.json b/languages/javascript/localizations/zh-tw/social.json new file mode 100644 index 00000000..898c43f4 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/social.json @@ -0,0 +1,30 @@ +{ + "name": "Twitter", + "help": "Social blocks are intended for working with social networking sites", + "blocks": [ + { + "blocktype": "eventhandler", + "id": "467848f3-3493-439a-9228-d6f83007e886", + "script": "local.getTweet({{1}}, function(tweet){local.tweet## = tweet;[[1]]});", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "last tweet##" + } + ], + "script": "local.tweet## || \"waiting…\"", + "type": "string" + } + ], + "help": "asynchronous call to get the last tweet of the named account", + "sockets": [ + { + "name": "get tweet for", + "type": "string" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/sound.json b/languages/javascript/localizations/zh-tw/sound.json new file mode 100644 index 00000000..5b8da288 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/sound.json @@ -0,0 +1,69 @@ +{ + "name": "Sound", + "help": "Sound blocks can load and play sound files (wav, mp3, ogg) if those files are supported by your browser.", + "blocks": [ + { + "blocktype": "step", + "id": "59f338b4-0f2f-489a-b4bd-b458fcb48e37", + "script": "global.preloadAudio('##', {{1}});", + "sockets": [ + { + "name": "load audio## from url", + "type": "string" + } + ], + "locals": [ + { + "blocktype": "asset", + "sockets": [ + { + "name": "audio ##" + } + ], + "script": "global.audio[\"##\"]", + "type": "sound" + } + ], + "help": "Load a sound for playback" + }, + { + "blocktype": "step", + "id": "4deb2817-6dfc-44e9-a885-7f4b350cc81f", + "script": "{{1}}.currentTime=0;{{1}}.play();", + "sockets": [ + { + "name": "play sound", + "type": "sound" + } + ], + "help": "play a sound" + }, + { + "blocktype": "step", + "id": "eb715a54-c1f2-4677-819a-9427537bad72", + "script": "{{1}}.pause();", + "sockets": [ + { + "name": "pause sound", + "type": "sound" + } + ] + }, + { + "blocktype": "step", + "id": "79f14360-3a3b-48de-83ae-240977cf343b", + "script": "{{1}}.loop={{2}};", + "sockets": [ + { + "name": "set sound", + "type": "sound" + }, + { + "name": "looping to", + "type": "boolean" + } + + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/sprite.json b/languages/javascript/localizations/zh-tw/sprite.json new file mode 100644 index 00000000..801b94af --- /dev/null +++ b/languages/javascript/localizations/zh-tw/sprite.json @@ -0,0 +1,633 @@ +{ + "name": "Sprites", + "help": "Sprites are graphics that can be repositioned, rotated, and have a vector of motion. They can also check for collision with other Sprites.", + "blocks": [ + { + "blocktype": "step", + "id": "a5ec5438-a3e5-4949-a3d6-296f959670b1", + "script": "local.ctx.save();local.ctx.fillStyle = {{1}};local.ctx.fillRect(0,0,global.stage_width, global.stage_height);local.ctx.restore();", + "help": "clear the stage to a solid color", + "sockets": [ + { + "name": "clear stage to color", + "type": "color", + "block": "13236aef-cccd-42b3-a041-e26528174323" + } + ] + }, + { + "blocktype": "step", + "id": "44d98663-d4fd-4fc8-8b65-0cde22deced6", + "script": "local.ctx.save();local.ctx.canvas.width = global.stage_width;local.ctx.canvas.height = global.stage_height;var w = local.ctx.canvas.width;var h = local.ctx.canvas.height;var size = {{1}};local.ctx.beginPath();if (size <= 0){size = 0.1;};for (var x=0;x<=w;x+=size){local.ctx.moveTo(x,0);local.ctx.lineTo(x,h);};for (var y=0;y<=h;y+=size){local.ctx.moveTo(0,y);local.ctx.lineTo(w,y);};local.ctx.strokeStyle ={{2}};local.ctx.stroke();", + "help": "set a grid background", + "sockets": [ + { + "name": "set grid with interval", + "type": "number", + "block": "" + }, + { + "name": "with color", + "type": "point", + "block": "13236aef-cccd-42b3-a041-e26528174323" + } + ] + }, + { + "blocktype": "step", + "id": "9d6b3a43-8319-482e-b0f8-2ce0fe7c2f3a", + "script": "local.ctx.drawImage(img, 0,0,img.width,img.height,0,0,global.stage_width,global.stage_height);", + "help": "clear the stage to a background image", + "sockets": [ + { + "name": "clear stage to image", + "type": "image" + } + ] + }, + { + "deprecated": true, + "blocktype": "step", + "id": "eb889480-c381-4cfa-a6ee-7c6928c08817", + "script": "local.sprite## = createRectSprite({{1}}, {{2}}, {{3}});", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "sprite##" + } + ], + "script": "local.sprite##", + "type": "sprite" + } + ], + "help": "create a simple rectangle sprite", + "sockets": [ + { + "name": "rectangle sprite##", + "type": "size", + "block": "d8e71067-afc2-46be-8bb5-3527b36474d7" + }, + { + "name": "big at", + "type": "point", + "block": "29803c49-5bd5-4473-bff7-b3cf66ab9711" + }, + { + "name": "with color", + "type": "color", + "block": "da9a266b-8ec0-4b97-bd79-b18dc7d4596f" + } + ] + }, + { + "blocktype": "step", + "id": "c876f5e8-87e9-4dc5-a6ee-8cf8e0188988", + "script": "local.sprite## = createImageSprite({{1}}, {{2}}, {{3}});", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "sprite##" + } + ], + "script": "local.sprite##", + "type": "sprite" + } + ], + "help": "create a simple image sprite", + "sockets": [ + { + "name": "image sprite##", + "type": "size", + "block": "" + }, + { + "name": "big at", + "type": "point", + "block": "" + }, + { + "name": "with image", + "type": "image", + "block": "" + } + ] + }, + { + "blocktype": "step", + "id": "43b28edf-c77f-422f-be5b-5217c9da93c9", + "script": "local.sprite## = createTextSprite({{1}}, {{2}}, {{3}}, {{4}}, {{5}});", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "sprite##" + } + ], + "script": "local.sprite##", + "type": "sprite" + } + ], + "help": "create a simple text sprite", + "sockets": [ + { + "name": "text sprite##", + "type": "size", + "block": "" + }, + { + "name": "big at", + "type": "point", + "block": "" + }, + { + "name": "with block color", + "type": "color", + "block": "" + }, + { + "name": "with text", + "type": "string", + "block": "" + }, + { + "name": "with text color", + "type": "color", + "block": "" + } + ] + }, + { + "blocktype": "step", + "id": "6e0689f9-c731-4874-9ba8-5228c1ff335a", + "script": "local.sprite## = createSprite({{1}}, {{2}});", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "sprite##" + } + ], + "script": "local.sprite##", + "type": "sprite" + } + ], + "help": "create a simple rectangle sprite", + "sockets": [ + { + "name": "shape sprite##", + "type": "shape", + "block": null + }, + { + "name": "with color", + "type": "color", + "block": null + } + ] + }, + { + "blocktype": "step", + "id": "db5f8b4e-93f2-4f88-934b-5eb4bac40e0d", + "script": "{{1}}.draw(local.ctx);", + "help": "draw the sprite at its current location", + "sockets": [ + { + "name": "draw sprite", + "type": "sprite" + } + ] + }, + { + "blocktype": "step", + "id": "468e4180-2221-11e3-8224-0800200c9a66", + "script": "{{1}}.setFacingDirectionBy({{2}});", + "help": "Rotate the sprites facing direction absolutely", + "sockets": [ + { + "name": "Turn sprite", + "type": "sprite" + }, + { + "name": "by", + "type": "number", + "value": 0 + }, + { + "name": "degrees" + } + ] + }, + { + "blocktype": "step", + "id": "69998440-22f4-11e3-8224-0800200c9a66", + "script": "{{1}}.setFacingDirection({{2}});", + "help": "Rotate the sprites facing direction", + "sockets": [ + { + "name": "Turn sprite", + "type": "sprite" + }, + { + "name": "to", + "type": "number", + "value": 0, + "suffix": "degrees" + } + ] + }, + { + "blocktype": "step", + "id": "71c09d20-22f4-11e3-8224-0800200c9a66", + "script": "{{1}}.setMovementDirectionBy({{2}});", + "help": "Rotate the sprites movement direction", + "sockets": [ + { + "name": "Steer sprite", + "type": "sprite" + }, + { + "name": "by", + "type": "number", + "value": 0 + }, + { + "name": "degrees" + } + ] + }, + { + "blocktype": "step", + "id": "7ecb947f-28ac-4418-bc44-cd797be697c9", + "script": "{{1}}.setMovementDirection({{2}});", + "help": "Rotate the sprites movement direction", + "sockets": [ + { + "name": "Steer sprite", + "type": "sprite" + }, + { + "name": "to", + "type": "number", + "value": 0 + }, + { + "name": "degrees" + } + ] + }, + { + "blocktype": "step", + "id": "7381ea40-22f6-11e3-8224-0800200c9a66", + "script": "{{1}}.autosteer = ({{2}});", + "help": "Set the sprite to sync facing and movement directions", + "sockets": [ + { + "name": "Autosteer sprite", + "type": "sprite" + }, + { + "name": "", + "type": "boolean", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "04c9dfd8-82eb-4f64-9d1c-54b78d744c21", + "script": "{{1}}.collides({{2}})", + "type": "boolean", + "help": "test for collision", + "sockets": [ + { + "name": "sprite", + "type": "sprite" + }, + { + "name": "collides with sprite", + "type": "sprite" + } + ] + }, + { + "blocktype": "expression", + "id": "f874f2af-c15e-44d2-9728-c14a774f22fb", + "script": "isSpriteClicked({{1}})", + "type": "boolean", + "help": "test for click", + "sockets": [ + { + "name": "sprite", + "type": "sprite" + }, + { + "name": "is clicked?" + } + ] + }, + { + "blocktype": "step", + "id": "aaa2f728-cae3-4368-b241-e80f94c360d3", + "script": "{{1}}.bounceOff({{2}});", + "help": "Bounce the sprite off of the passed in sprite", + "sockets": [ + { + "name": "bounce sprite", + "type": "sprite" + }, + { + "name": "off of sprite", + "type": "sprite" + } + ] + }, + { + "blocktype": "step", + "id": "d1521a30-c7bd-4f42-b21d-6330a2a73631", + "script": "{{1}}.moveRelative({{2}},{{3}});", + "help": "move a sprite relatively", + "sockets": [ + { + "name": "move", + "type": "sprite" + }, + { + "name": "by x", + "type": "number" + }, + { + "name": "y", + "type": "number" + } + ] + }, + { + "blocktype": "step", + "id": "372de8c1-5f72-49cb-a2bd-faf66c36e318", + "help": "move a sprite by its own speed and direction", + "script": "{{1}}.move();", + "sockets": [ + { + "name": "move", + "type": "sprite" + } + ] + }, + { + "blocktype": "step", + "id": "4d7d6b10-222b-11e3-8224-0800200c9a66", + "help": "set the speed of a sprite", + "script": "{{1}}.setSpeed({{2}});", + "sockets": [ + { + "name": "set sprite", + "type": "sprite" + }, + { + "name": "speed", + "type": "number", + "value": 3 + } + ] + }, + { + "blocktype": "step", + "id": "30d3103b-6657-4233-bd57-47bd5050704b", + "help": "set the movement vector of a sprite (speed and steer)", + "script": "{{1}}.movementDirection = {{2}};", + "sockets": [ + { + "name": "set sprite", + "type": "sprite" + }, + { + "name": "movement vector", + "type": "vector" + } + ] + }, + { + "blocktype": "step", + "id": "a110b9d4-34bc-4d3f-a7b1-dbc7885eb977", + "help": "bounce in the x and/or y direction if the stage is exceeded", + "script": "{{1}}.stageBounce(global.stage_width, global.stage_height);", + "sockets": [ + { + "name": "bounce", + "type": "sprite" + } + ] + }, + { + "blocktype": "step", + "id": "039a62e2-fbde-4fd0-9fa6-1e5383434698", + "help": "if the sprite moves to the edge of the screen, stop it at the edge", + "script": "{{1}}.edgeStop(global.stage_width, global.stage_height);", + "sockets": [ + { + "name": "stop sprite ", + "type": "sprite", + "suffix": "at edge of stage" + } + ] + }, + { + "blocktype": "step", + "id": "a4caaf13-514a-499a-a406-f88bfc9ddccd", + "help": "if the sprite moves to the edge of the screen, slide it along the edge", + "script": "{{1}}.edgeSlide(global.stage_width, global.stage_height);", + "sockets": [ + { + "name": "slide sprite ", + "type": "sprite", + "suffix": "at edge of stage" + } + ] + }, + { + "blocktype": "step", + "id": "45f73aca-bf93-4249-9da4-1c089d6c8537", + "help": "if the sprite moves to the edge of the screen, wrap it around to the other side", + "script": "{{1}}.edgeWrap(global.stage_width, global.stage_height);", + "sockets": [ + { + "name": "wrap sprite ", + "type": "sprite", + "suffix": "around edge of stage" + } + ] + }, + { + "blocktype": "step", + "id": "88c75c2b-18f1-4195-92bc-a90d99743551", + "script": "{{1}}.moveAbsolute({{2}}.x, {{2}}.y);", + "help": "move a sprite absolutely", + "sockets": [ + { + "name": "move", + "type": "sprite" + }, + { + "name": "to", + "type": "point" + } + ] + }, + { + "blocktype": "step", + "id": "badee0b6-8f7c-4cbd-9173-f450c765045d", + "script": "{{1}}.color = {{2}};", + "help": "Recolor a sprite", + "sockets": [ + { + "name": "Color sprite", + "type": "sprite" + }, + { + "name": "to color", + "type": "color", + "block": "13236aef-cccd-42b3-a041-e26528174323" + } + ] + }, + { + "blocktype": "expression", + "id": "36DD3165-1168-4345-9198-E9B230FF84A3", + "script": "{{1}}.facingDirection", + "type": "vector", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "facing direction" + } + ] + }, + { + "blocktype": "expression", + "id": "495336f3-68ed-4bc7-a145-11756803876b", + "script": "{{1}}.movementDirection", + "type": "vector", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "movement vector" + } + ] + }, + { + "blocktype": "expression", + "id": "86aa39be-5419-4abb-9765-e63f824608f0", + "script": "{{1}}.polygon.average", + "type": "point", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "center" + } + ] + }, + { + "blocktype": "expression", + "id": "DF9E52B5-CE65-477A-BE10-95DF88C53FD0", + "script": "{{1}}.speed", + "type": "number", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "speed" + } + ] + }, + { + "blocktype": "expression", + "id": "8D0880EA-1722-435A-989D-06E8A9B62FB0", + "script": "{{1}}.movementDirection.x", + "type": "number", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "horizontal speed" + } + ] + }, + { + "blocktype": "expression", + "id": "21A7A835-9647-4DC2-80AE-AE9B06346706", + "script": "{{1}}.movementDirection.y", + "type": "number", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "vertical speed" + } + ] + }, + { + "blocktype": "expression", + "id": "a0c6d157-7fc7-4819-9b97-7b81d4c49a83", + "script": "{{1}}.x", + "help": "get x (left) position of sprite", + "type": "number", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "left" + } + ] + }, + { + "blocktype": "expression", + "id": "23b4ffd1-3812-4372-8873-8a1b3107bdac", + "script": "({{1}}.x + {{1}}.w)", + "help": "get x+w (right) position of sprite", + "type": "number", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "right" + } + ] + }, + { + "blocktype": "expression", + "id": "898208b7-4d38-4c24-ba23-0b0443089435", + "script": "{{1}}.y", + "help": "get y (top) position of sprite", + "type": "number", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "top" + } + ] + }, + { + "blocktype": "expression", + "id": "8c73e3fd-7c53-4c92-be1d-286db5357cbb", + "script": "({{1}}.y + {{1}}.h)", + "type": "number", + "sockets": [ + { + "name": "sprite", + "type": "sprite", + "suffix": "bottom" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/string.json b/languages/javascript/localizations/zh-tw/string.json new file mode 100644 index 00000000..9ad3b663 --- /dev/null +++ b/languages/javascript/localizations/zh-tw/string.json @@ -0,0 +1,550 @@ +{ + "name": "Strings", + "help": "String blocks represent or manipulate bits of text (strings of characters)", + "blocks": [ + { + "blocktype": "expression", + "id": "cdf5fa88-0d87-45d1-bf02-9ee4ec4c5565", + "script": "{{1}}.split({{2}})", + "type": "array", + "help": "create an array by splitting the named string on the given string", + "sockets": [ + { + "name": "split string", + "type": "string" + }, + { + "name": "on separator", + "type": "string" + } + ] + }, + { + "blocktype": "expression", + "id": "e1951d04-dc2f-459e-9d7a-4796f29169ea", + "type": "string", + "script": "({{1}} + {{2}})", + "help": "returns a string by joining together two strings", + "sockets": [ + { + "name": "concatenate", + "type": "string", + "value": "hello" + }, + { + "name": "with", + "type": "string", + "value": "world" + } + ] + }, + { + "blocktype": "expression", + "id": "3889BB61-FC62-4BED-B0EC-792AF636EC18", + "type": "string", + "script": "{{1}}.repeat({{2}})", + "help": "returns a string by joining together copies of the original string", + "sockets": [ + { + "name": "repeat", + "type": "string", + "value": "hello" + }, + { + "name": "", + "type": "number", + "value": "2" + }, + { + "name": "times" + } + ] + }, + { + "blocktype": "expression", + "id": "e71d4b0b-f32e-4b02-aa9d-5cbe76a8abcb", + "script": "{{1}}[{{2}}]", + "type": "string", + "help": "get the single character string at the given index of named string", + "sockets": [ + { + "name": "string", + "type": "string" + }, + { + "name": "character at", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "expression", + "id": "304A88C6-FFF3-4DA5-9522-6DAF99E89F10", + "script": "{{1}}[{{1}}.length-{{2}}]", + "type": "string", + "help": "get the single character string at the given index from the end of named string", + "sockets": [ + { + "name": "string", + "type": "string", + "value": null + }, + { + "name": "character at", + "type": "number", + "value": "0" + }, + { + "name": "from the end" + } + ] + }, + { + "blocktype": "expression", + "id": "6BA0B0CF-6F22-4384-8A16-630C745FA3D3", + "script": "{{1}}.substr({{2}},{{3}})", + "type": "string", + "help": "get the substring of specified length starting at the given index of named string", + "sockets": [ + { + "name": "string", + "type": "string", + "value": null + }, + { + "name": "substring at", + "type": "number", + "value": "0" + }, + { + "name": "of length", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "A41F840C-C64A-4047-9EBD-CF7152EA5D7B", + "script": "{{1}}.slice({{2}},{{3}}+1)", + "type": "string", + "help": "get the substring starting at the given index of named string and ending at the second given index", + "sockets": [ + { + "name": "string", + "type": "string", + "value": null + }, + { + "name": "substring from", + "type": "number", + "value": "0" + }, + { + "name": "to", + "type": "number", + "value": "0" + } + ] + }, + { + "blocktype": "expression", + "id": "c1eda8ae-b77c-4f5f-9b9f-c11b65235765", + "script": "{{1}}.length", + "type": "number", + "help": "get the length of named string", + "sockets": [ + { + "name": "string", + "type": "string", + "suffix": "length" + } + ] + }, + { + "blocktype": "expression", + "id": "cc005f19-e1b9-4f74-8fd0-91faccedd370", + "script": "{{1}}.indexOf({{2}})", + "type": "number", + "help": "get the index of the substring within the named string", + "sockets": [ + { + "name": "search string", + "type": "string" + }, + { + "name": "for substring", + "type": "string" + } + ] + }, + { + "blocktype": "expression", + "id": "037BB272-ADA5-41E4-BE9E-5FACA42F02C8", + "script": "{{1}}.contains({{2}})", + "type": "boolean", + "help": "check for the substring within the named string", + "sockets": [ + { + "name": "test string", + "type": "string" + }, + { + "name": "for substring", + "type": "string" + } + ] + }, + { + "blocktype": "expression", + "id": "8b536c13-4c56-471e-83ac-cf8648602df4", + "script": "{{1}}.replace({{2}}, {{3}})", + "type": "string", + "help": "get a new string by replacing a substring with a new string", + "sockets": [ + { + "name": "replace", + "type": "string" + }, + { + "name": "with", + "type": "string" + } + ] + }, + { + "blocktype": "expression", + "id": "3047CA98-2E78-4D0B-BD88-6F4D1B3E8420", + "script": "{{1}}.replace({{2}}g, {{3}})", + "type": "string", + "help": "get a new string by replacing a pattern with a new string using regular expressions", + "sockets": [ + { + "name": "in string", + "type": "string", + "value": null + }, + { + "name": "replace pattern", + "type": "regex", + "value": null + }, + { + "name": "with", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "1D76122E-1E5D-4A19-AA5E-267B41A788FA", + "script": "{{1}}.trim()", + "type": "string", + "help": "remove trailing and leading whitespace", + "sockets": [ + { + "name": "trim whitespace from", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "85CA02CB-229F-4DF5-8400-4AFA2BA8E627", + "script": "{{1}}.toUpperCase()", + "type": "string", + "help": "change to uppercase", + "sockets": [ + { + "name": "to uppercase", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "5AD79C7C-321E-4588-B05D-DB1FEF86B82D", + "script": "{{1}}.toLowerCase()", + "type": "string", + "help": "change to lowercase", + "sockets": [ + { + "name": "to lowercase", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "DBA355CF-0F3A-4BA1-BBD7-2F8BDCE8C3CC", + "type": "boolean", + "script": "({{1}} === {{2}})", + "help": "two strings are equal", + "sockets": [ + { + "name": "", + "type": "string", + "value": null + }, + { + "name": "=", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "46391AF0-3002-4A58-85BA-C670FE743219", + "type": "boolean", + "script": "({{1}} !== {{2}})", + "help": "two strings are not equal", + "sockets": [ + { + "name": "", + "type": "string", + "value": null + }, + { + "name": "≠", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "C9B4EC06-0C82-458F-AB99-E5BB620269D7", + "type": "boolean", + "script": "({{1}} < {{2}})", + "help": "first string precedes second string in lexicographical ordering", + "sockets": [ + { + "name": "", + "type": "string", + "value": null + }, + { + "name": "<", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "085AD019-E831-4501-A058-34A7A1E6744D", + "type": "boolean", + "script": "({{1}} <= {{2}})", + "help": "first precedes or is equal to second string", + "sockets": [ + { + "name": "", + "type": "string", + "value": null + }, + { + "name": "≤", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "684A6EDF-7351-4DCF-AE93-EEA4AF1B41A5", + "type": "boolean", + "script": "({{1}} > {{2}})", + "help": "second string precedes first string in lexicographical ordering", + "sockets": [ + { + "name": "", + "type": "string", + "value": null + }, + { + "name": ">", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "149FFB1E-4143-4724-BBBA-EEE133F517A7", + "type": "boolean", + "script": "({{1}} >= {{2}})", + "help": "first string succeeds or is equal to second string", + "sockets": [ + { + "name": "", + "type": "string", + "value": null + }, + { + "name": "≥", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "55FC2AC3-7C0E-43CD-BDDE-8E890073EDAC", + "type": "boolean", + "script": "{{1}}.startsWith({{2}})", + "help": "first string starts with to second string", + "sockets": [ + { + "name": "", + "type": "string", + "value": null + }, + { + "name": "starts with", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "2F3963B1-1FAC-402A-B5B6-86927DCD3241", + "type": "boolean", + "script": "{{1}}.endsWith({{2}})", + "help": "first string ends with to second string", + "sockets": [ + { + "name": "", + "type": "string", + "value": null + }, + { + "name": "ends with", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "73A7E675-E152-454A-9B60-A7C3D54F603C", + "type": "boolean", + "script": "{{2}}.test({{1}})", + "help": "first string matches the given regular expression", + "sockets": [ + { + "name": "", + "type": "string", + "value": null + }, + { + "name": "matches pattern", + "type": "regex", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "D8EF192D-16BD-42AA-98A0-C6C2236392F7", + "script": "levenshtein({{1}},{{2}})", + "type": "number", + "help": "calculate how much two strings are different using Levenshtein difference", + "sockets": [ + { + "name": "difference of strings", + "type": "string", + "value": null + }, + { + "name": "and", + "type": "string", + "value": null + } + ] + }, + { + "blocktype": "expression", + "id": "8eaacf8a-18eb-4f21-a1ab-a356326f7eae", + "script": "{{1}}.toString()", + "type": "string", + "help": "convert any object to a string", + "sockets": [ + { + "name": "to string", + "type": "any" + } + ] + }, + { + "blocktype": "step", + "id": "48bb8639-0092-4384-b5a0-3a772699dea9", + "script": "/* {{1}} */", + "help": "this is a comment and will not be run by the program", + "sockets": [ + { + "name": "comment", + "type": "any" + } + ] + }, + { + "blocktype": "step", + "id": "2f178d61-e619-47d0-b9cf-fcb52625c2a3", + "script": "window.alert({{1}});", + "help": "pop up an alert window with string", + "sockets": [ + { + "name": "alert", + "type": "string" + } + ] + }, + { + "blocktype": "step", + "id": "8496b7af-129f-48eb-b15b-8803b7617493", + "script": "console.log({{1}});", + "help": "Send any object as a message to the console", + "sockets": [ + { + "name": "console log", + "type": "any" + } + ] + }, + { + "blocktype": "step", + "id": "8bfaf131-d169-4cf4-afe4-1d7f02a55341", + "script": "var __a={{2}};__a.unshift({{1}});console.log.apply(console, __a);", + "help": "send a message to the console with a format string and multiple objects", + "sockets": [ + { + "name": "console log format", + "type": "string" + }, + { + "name": "arguments", + "type": "array" + } + ] + }, + { + "blocktype": "expression", + "id": "06ddcfee-76b7-4be4-856d-44cda3fb109b", + "script": "global.keys", + "help": "for debugging", + "type": "object", + "sockets": [ + { + "name": "global keys object" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/text.json b/languages/javascript/localizations/zh-tw/text.json new file mode 100644 index 00000000..716ce87d --- /dev/null +++ b/languages/javascript/localizations/zh-tw/text.json @@ -0,0 +1,169 @@ +{ + "name": "Text", + "help": "Text blocks represent and manipulate the way text is drawn to the screen, things like alignment, font, and size.", + "blocks": [ + { + "blocktype": "step", + "id": "d16df0dc-f90a-4e21-967d-f054956c8135", + "script": "local.ctx.font = {{1}}+{{2}}+\" \"+{{3}};", + "help": "set the current font", + "sockets": [ + { + "name": "font", + "type": "number", + "value": 10 + }, + { + "name": "", + "type": "string", + "options": "unit", + "value": "px" + }, + { + "name": "", + "type": "string", + "value": "sans-serif" + } + ] + }, + { + "blocktype": "step", + "id": "7ea4ef80-8355-4987-8d3b-165367b97cc1", + "script": "local.ctx.textAlign = {{1}};", + "help": "how should the text align?", + "sockets": [ + { + "name": "text align", + "type": "string", + "options": "align", + "value": "left" + } + ] + }, + { + "blocktype": "step", + "id": "46345cbf-e095-4b34-9d37-c9dcc22da7db", + "script": "local.ctx.textBaseline = {{1}};", + "help": "set the text baseline", + "sockets": [ + { + "name": "text baseline", + "type": "string", + "options": "baseline", + "value": "" + } + ] + }, + { + "blocktype": "step", + "id": "9f3fb819-f8a9-4929-87c8-6c6742b4cb2d", + "script": "local.ctx.fillText({{1}},{{2}},{{3}});", + "help": "basic text operation", + "sockets": [ + { + "name": "fill text", + "type": "string" + }, + { + "name": "x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "step", + "id": "742ee568-8a27-49d5-9dce-8b9151b30bef", + "script": "local.ctx.fillText({{1}},{{2}},{{3}},{{4}});", + "help": "basic text operation with optional max width", + "sockets": [ + { + "name": "fill text", + "type": "string" + }, + { + "name": "x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + }, + { + "name": "max width", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "step", + "id": "b9bfe426-3110-4b67-bc4e-5da48103e890", + "script": "local.ctx.strokeText({{1}},{{2}},{{3}});", + "help": "outline the text", + "sockets": [ + { + "name": "stroke text", + "type": "string" + }, + { + "name": "x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "step", + "id": "6d03d273-8c5d-4059-b525-641ceb7ed662", + "script": "local.ctx.strokeText({{1}},{{2}},{{3}},{{4}});", + "help": "outline the text with optional max width", + "sockets": [ + { + "name": "stroke text", + "type": "string" + }, + { + "name": "x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + }, + { + "name": "max width", + "type": "number", + "value": 10 + } + ] + }, + { + "blocktype": "expression", + "id": "7edfa688-bdbb-491b-9011-4cb866b7dc2e", + "script": "local.ctx.measureText({{1}}).width", + "type": "number", + "sockets": [ + { + "name": "text", + "type": "string", + "suffix": "width" + } + ] + } + ] +} diff --git a/languages/javascript/localizations/zh-tw/vector.json b/languages/javascript/localizations/zh-tw/vector.json new file mode 100644 index 00000000..7a6c9e3c --- /dev/null +++ b/languages/javascript/localizations/zh-tw/vector.json @@ -0,0 +1,149 @@ +{ + "name": "Vectors", + "help": "Vector blocks have a direction and a magnitude, which can represent speed of movement for a Sprite. Vectors can be added to or subtracted from other Vectors, among other things.", + "blocks": [ + { + "blocktype": "step", + "id": "874f1097-2aa2-4056-8a8f-de88f73f39e2", + "script": "local.vector## = new SAT.Vector({{1}}, {{2}});", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "vector##" + } + ], + "script": "local.vector##", + "type": "vector" + } + ], + "help": "create a vector", + "sockets": [ + { + "name": "vector##", + "type": "number", + "value": 0, + "suffix": "x," + }, + { + "name": "", + "type": "number", + "value": 0, + "suffix": "y" + } + ] + }, + { + "blocktype": "step", + "id": "61d265c9-7314-45c9-89cd-16e5ae26b258", + "script": "{{1}}.add({{2}});", + "help": "Add a second vector to this vector", + "sockets": [ + { + "name": "Vector", + "type": "vector" + }, + { + "name": "add vector", + "type": "vector" + } + ] + }, + { + "blocktype": "step", + "id": "e82c5f05-ba59-4267-b817-f1e44b4d31c4", + "script": "{{1}}.sub({{2}});", + "help": "Subtract a second vector from this vector", + "sockets": [ + { + "name": "Vector", + "type": "vector" + }, + { + "name": "subtract vector", + "type": "vector" + } + ] + }, + { + "blocktype": "expression", + "id": "c6edb126-6306-44e4-a5f9-44728ae1cbb4", + "script": "{{1}}.dot({{2}})", + "type": "number", + "help": "Get the dot product of two vectors", + "sockets": [ + { + "name": "Dot product of vector", + "type": "vector" + }, + { + "name": "and vector", + "type": "vector" + } + ] + }, + { + "blocktype": "step", + "id": "d6204ed1-3b28-41af-8574-fac393df75f1", + "script": "{{1}}.reverse();", + "help": "Reverse the vector", + "sockets": [ + { + "name": "Reverse vector", + "type": "vector" + } + ] + }, + { + "blocktype": "step", + "id": "D7374103-3C03-40E8-A215-45BEFF97F0BC", + "script": "{{1}}.normalize();", + "help": "Normalize the vector", + "sockets": [ + { + "name": "Normalize vector", + "type": "vector" + } + ] + }, + { + "blocktype": "step", + "id": "612C4569-9715-48E6-ADA0-C978386D9922", + "script": "{{1}}.scale({{2}},{{3}});", + "help": "Scale the vector by the x and y", + "sockets": [ + { + "name": "Scale vector", + "type": "vector" + }, + { + "name": "by x", + "type": "number", + "value": 1 + }, + { + "name": "and y", + "type": "number", + "value": 1 + } + ] + }, + { + "blocktype": "step", + "id": "f7937709-f449-4480-927d-3bcfe33d2f65", + "script": "{{2}}.project({{1}});", + "help": "Project the first vector onto the second", + "sockets": [ + { + "name": "Vector", + "type": "vector" + }, + { + "name": "project onto vector", + "type": "vector" + } + ] + } + ] +} \ No newline at end of file diff --git a/languages/javascript/localizations/zh-tw/voice.json b/languages/javascript/localizations/zh-tw/voice.json new file mode 100644 index 00000000..00a5014b --- /dev/null +++ b/languages/javascript/localizations/zh-tw/voice.json @@ -0,0 +1,237 @@ +{ + "name": "Music", + "help": "Music blocks are for creating and manipulating sound programmatically, generating the sounds rather than playing back a recorded audio file (see the Sound menu for that).", + "blocks": [ + { + "blocktype": "step", + "id": "ac1d8b1a-013c-46e0-b5e7-f241c594a7c7", + "script": "local.voice## = new Voice();", + "locals": [ + { + "blocktype": "expression", + "sockets": [ + { + "name": "voice##" + } + ], + "script": "local.voice##", + "type": "voice" + } + ], + "help": "create a simple voice to play tones", + "sockets": [ + { + "name": "voice##" + } + ] + }, + { + "blocktype": "step", + "id": "ee91b7ec-d52b-45ff-bd13-ff8a8e5e50fb", + "help": "set the frequency of the voice", + "script": "(function(voice, freq){voice.frequency = freq; voice.updateTone();})({{1}}, {{2}});", + "sockets": [ + { + "name": "set voice", + "type": "voice" + }, + { + "name": "tone", + "type": "number", + "value": 440, + "suffix": "Hz" + } + ] + }, + { + "blocktype": "step", + "id": "60984C26-0854-4075-994B-9573B3F48E95", + "help": "set the note of the voice", + "script": "(function(voice, note){voice.setNote(note); voice.updateTone();})({{1}}, {{2}});", + "sockets": [ + { + "name": "set voice", + "type": "voice" + }, + { + "name": "note", + "type": "string", + "options": "notes", + "value": "A4" + } + ] + }, + { + "blocktype": "step", + "id": "a133f0ad-27e6-444c-898a-66410c447a07", + "help": "set the volume of the voice", + "script": "(function(voice, vol){voice.volume = vol; voice.updateTone();})({{1}}, {{2}});", + "sockets": [ + { + "name": "set voice", + "type": "voice" + }, + { + "name": "volume", + "type": "number", + "value": 1 + } + ] + }, + { + "blocktype": "step", + "id": "A64A4BC7-4E93-47B4-910B-F185BC42E366", + "help": "set the tempo of the voice, for determining the length of a quarter note", + "script": "(function(voice, tempo){voice.tempo = tempo; voice.updateTone();})({{1}}, {{2}});", + "sockets": [ + { + "name": "set voice", + "type": "voice" + }, + { + "name": "tempo quarter note =", + "type": "number", + "value": 120, + "suffix": "beats per minute" + } + ] + }, + { + "blocktype": "expression", + "id": "c1ce82b2-9810-41e0-b96e-44702982372b", + "script": "{{1}}.frequency", + "help": "get frequency of a voice", + "type": "number", + "sockets": [ + { + "name": "voice", + "type": "voice", + "suffix": "Hz" + } + ] + }, + { + "blocktype": "step", + "id": "e4a4949f-1010-4026-a070-2555dbf3be0e", + "script": "{{1}}.startOsc();", + "help": "turn the voice on", + "sockets": [ + { + "name": "turn voice", + "type": "voice", + "suffix": "on" + } + ] + }, + { + "blocktype": "step", + "id": "c471bc07-fe25-4c6d-a5ef-4ee7f3076561", + "script": "{{1}}.stopOsc();", + "help": "turn the voice off", + "sockets": [ + { + "name": "turn voice", + "type": "voice", + "suffix": "off" + } + ] + }, + { + "blocktype": "step", + "id": "2003f5ae-0bef-4517-aad4-7baf4457a823", + "script": "(function(voice, sec){voice.startOsc();setTimeout(function() {voice.stopOsc();}, 1000 * sec);})({{1}},{{2}});", + "help": "play the voice for a number of seconds", + "sockets": [ + { + "name": "play voice", + "type": "voice" + }, + { + "name": "for ", + "type": "number", + "value": 2, + "suffix": "seconds" + } + ] + }, + { + "blocktype": "step", + "id": "1F98BD7B-8E13-4334-854B-6B9C1B31C99D", + "script": "(function(voice, note, len, dots){voice.push(note,len,dots);})({{1}},{{2}},{{3}},{{4}});", + "help": "schedule a note to be played as part of a song", + "sockets": [ + { + "name": "schedule voice", + "type": "voice" + }, + { + "name": "to play note", + "type": "string", + "options": "notes", + "value": "A4" + }, + { + "name": "as ", + "type": "string", + "options": "durations", + "value": "quarter note" + }, + { + "name": "dotted", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "step", + "id": "24875971-7CB4-46A6-8A53-D966424A3E70", + "script": "(function(voice, note, len, dots){voice.push(note,len,dots);})({{1}},'none',{{2}},{{3}});", + "help": "schedule a note to be played as part of a song", + "sockets": [ + { + "name": "schedule voice", + "type": "voice" + }, + { + "name": "to rest for a ", + "type": "string", + "options": "durations", + "value": "quarter note" + }, + { + "name": "dotted", + "type": "number", + "value": 0 + } + ] + }, + { + "blocktype": "step", + "id": "34788069-BF4F-46DB-88DC-FC437F484A80", + "script": "(function(voice){voice.play();})({{1}});", + "help": "play the scheduled song", + "sockets": [ + { + "name": "play voice", + "type": "voice", + "suffix": "stored song" + } + ] + }, + { + "blocktype": "expression", + "id": "112ffdd3-7832-43df-85a5-85587e951295", + "script": "{{1}}.on", + "help": "get whether the voice is turned on or off", + "type": "boolean", + "sockets": [ + { + "name": "voice", + "type": "voice", + "suffix": "is on?" + } + ] + } + ] +} \ No newline at end of file From a6576d0d265a4303025dd89296f367e475603cdc Mon Sep 17 00:00:00 2001 From: yiting Date: Sat, 15 Mar 2014 16:50:41 -0400 Subject: [PATCH 02/16] translate control.json rename locale directory to zh and recopy json files to include sectionkey field --- bin/build | 3 + dist/arduino.js | 2 +- dist/javascript.js | 2 +- dist/node.js | 2 +- dist/processingjs.js | 2 +- .../localizations/zh-tw/control.json | 353 ------------------ .../localizations/{zh-tw => zh}/array.json | 1 + .../localizations/{zh-tw => zh}/boolean.json | 1 + .../localizations/{zh-tw => zh}/canvas.json | 1 + .../javascript/localizations/zh/cleanup.py | 18 + .../localizations/{zh-tw => zh}/color.json | 1 + .../javascript/localizations/zh/control.json | 268 +++++++++++++ .../localizations/{zh-tw => zh}/date.json | 1 + .../localizations/{zh-tw => zh}/fb.json | 1 + .../{zh-tw => zh}/geolocation.json | 1 + .../localizations/{zh-tw => zh}/image.json | 1 + .../localizations/{zh-tw => zh}/math.json | 1 + .../localizations/{zh-tw => zh}/matrix.json | 1 + .../localizations/{zh-tw => zh}/motion.json | 1 + .../localizations/{zh-tw => zh}/object.json | 1 + .../localizations/{zh-tw => zh}/path.json | 1 + .../localizations/{zh-tw => zh}/point.json | 1 + .../localizations/{zh-tw => zh}/random.json | 3 +- .../localizations/{zh-tw => zh}/rect.json | 1 + .../localizations/{zh-tw => zh}/sensing.json | 1 + .../localizations/{zh-tw => zh}/shape.json | 1 + .../localizations/{zh-tw => zh}/size.json | 1 + .../localizations/{zh-tw => zh}/social.json | 1 + .../localizations/{zh-tw => zh}/sound.json | 1 + .../localizations/{zh-tw => zh}/sprite.json | 1 + .../localizations/{zh-tw => zh}/string.json | 1 + .../localizations/{zh-tw => zh}/text.json | 1 + .../localizations/{zh-tw => zh}/vector.json | 1 + .../localizations/{zh-tw => zh}/voice.json | 1 + 34 files changed, 320 insertions(+), 358 deletions(-) delete mode 100644 languages/javascript/localizations/zh-tw/control.json rename languages/javascript/localizations/{zh-tw => zh}/array.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/boolean.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/canvas.json (99%) create mode 100644 languages/javascript/localizations/zh/cleanup.py rename languages/javascript/localizations/{zh-tw => zh}/color.json (99%) create mode 100644 languages/javascript/localizations/zh/control.json rename languages/javascript/localizations/{zh-tw => zh}/date.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/fb.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/geolocation.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/image.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/math.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/matrix.json (97%) rename languages/javascript/localizations/{zh-tw => zh}/motion.json (96%) rename languages/javascript/localizations/{zh-tw => zh}/object.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/path.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/point.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/random.json (98%) rename languages/javascript/localizations/{zh-tw => zh}/rect.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/sensing.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/shape.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/size.json (98%) rename languages/javascript/localizations/{zh-tw => zh}/social.json (97%) rename languages/javascript/localizations/{zh-tw => zh}/sound.json (98%) rename languages/javascript/localizations/{zh-tw => zh}/sprite.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/string.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/text.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/vector.json (99%) rename languages/javascript/localizations/{zh-tw => zh}/voice.json (99%) diff --git a/bin/build b/bin/build index aff8d215..cf2d5afd 100755 --- a/bin/build +++ b/bin/build @@ -47,6 +47,9 @@ var libs = { }; var localizations = { + javascript: { + 'zh': ['control'] + } }; diff --git a/dist/arduino.js b/dist/arduino.js index daa29d16..c569ae84 100644 --- a/dist/arduino.js +++ b/dist/arduino.js @@ -18,7 +18,7 @@ var Events=new function(){var a=this,b=[],c="0.2.3-beta",d=function(){var a=docu /* list of files used for localization of blocks */ -var l10nFiles = {}; +var l10nFiles = {"javascript":{"zh":["control"]}}; /*begin ajax.js*/ diff --git a/dist/javascript.js b/dist/javascript.js index 69398162..b2855c44 100644 --- a/dist/javascript.js +++ b/dist/javascript.js @@ -1841,7 +1841,7 @@ var Events=new function(){var a=this,b=[],c="0.2.3-beta",d=function(){var a=docu /* list of files used for localization of blocks */ -var l10nFiles = {}; +var l10nFiles = {"javascript":{"zh":["control"]}}; /*begin ajax.js*/ diff --git a/dist/node.js b/dist/node.js index 71da9a92..c7eeaf2d 100644 --- a/dist/node.js +++ b/dist/node.js @@ -1841,7 +1841,7 @@ var Events=new function(){var a=this,b=[],c="0.2.3-beta",d=function(){var a=docu /* list of files used for localization of blocks */ -var l10nFiles = {}; +var l10nFiles = {"javascript":{"zh":["control"]}}; /*begin ajax.js*/ diff --git a/dist/processingjs.js b/dist/processingjs.js index 6606ffd3..de978780 100644 --- a/dist/processingjs.js +++ b/dist/processingjs.js @@ -12048,7 +12048,7 @@ var Events=new function(){var a=this,b=[],c="0.2.3-beta",d=function(){var a=docu /* list of files used for localization of blocks */ -var l10nFiles = {}; +var l10nFiles = {"javascript":{"zh":["control"]}}; /*begin ajax.js*/ diff --git a/languages/javascript/localizations/zh-tw/control.json b/languages/javascript/localizations/zh-tw/control.json deleted file mode 100644 index c2ec2de6..00000000 --- a/languages/javascript/localizations/zh-tw/control.json +++ /dev/null @@ -1,353 +0,0 @@ -{ - "name": "Controls", - "help": "Contains control flow, variables, setters, and messaging blocks.", - "blocks": [ - { - "blocktype": "eventhandler", - "id": "1cf8132a-4996-47db-b482-4e336200e3ca", - "script": "function _start(){[[1]]}_start();", - "help": "this trigger will run its scripts once when the program starts", - "sockets": [ - { - "name": "when program runs" - } - ] - }, - { - "blocktype": "eventhandler", - "id": "f4a604cd-f0b5-4133-9f91-4e1abe48fb6a", - "script": "document.addEventListener('keydown', function(event){ if (global.keyForEvent(event) === {{1}}){[[1]];}});", - "help": "this trigger will run the attached blocks every time this key is pressed", - "sockets": [ - { - "name": "when", - "type": "string", - "options": "keys", - "value": "a", - "suffix": "key pressed" - } - ] - }, - { - "blocktype": "eventhandler", - "id": "f13fcf60-a7e4-4672-9ff8-06197a65af94", - "locals": [ - { - "blocktype": "expression", - "sockets": [ - { - "name": "event##" - } - ], - "script": "local.event##", - "type": "object" - } - ], - "script": "document.addEventListener({{1}}, function(event){local.event##=event;[[1]]; });", - "help": "this trigger will run the attached blocks every time the chosen mouse event happens", - "sockets": [ - { - "name": "when", - "type": "string", - "options": "pointerEvents", - "value": "" - } - ] - }, - { - "blocktype": "eventhandler", - "id": "cfea9087-3d7c-46ad-aa41-579bba2f4709", - "locals": [ - { - "blocktype": "expression", - "sockets": [ - { - "name": "count##" - } - ], - "script": "local.count##", - "type": "number" - } - ], - "script": "(function(){local.count##=0;requestAnimationFrame(function eachFrame(){local.count##++;[[1]];requestAnimationFrame(eachFrame);})})();", - "help": "this trigger will run the attached blocks periodically", - "sockets": [ - { - "name": "each frame" - } - ] - }, - { - "blocktype": "eventhandler", - "id": "47AA31E2-5A90-4AF1-8F98-5FDD437561B6", - "locals": [ - { - "blocktype": "expression", - "sockets": [ - { - "name": "count##" - } - ], - "script": "local.count##", - "type": "number" - } - ], - "script": "(function(){local.count##=0;local.timerid##=setInterval(function(){local.count##++;if({{2}}){clearInterval(local.timerid##);return;}[[1]]},1000/{{1}});})();", - "help": "this trigger will run the attached blocks periodically", - "sockets": [ - { - "name": "repeat", - "type": "number", - "value": "30" - }, - { - "name": "times a second until", - "type": "boolean", - "value": true - } - ] - }, - { - "blocktype": "step", - "id": "079b2b89-41c2-4d00-8e21-bcb86574bf80", - "script": "local.variable## = {{1}};", - "locals": [ - { - "blocktype": "expression", - "script": "local.variable##", - "type": "any", - "sockets": [ - { - "name": "variable##" - } - ] - } - ], - "help": "create a reference to re-use the any", - "sockets": [ - { - "name": "variable variable##", - "type": "any" - } - ] - }, - { - "blocktype": "step", - "id": "b4036693-8645-4852-a4de-9e96565f9aec", - "script": "{{1}} = {{2}};", - "help": "first argument must be a variable", - "sockets": [ - { - "name": "set variable", - "type": "any" - }, - { - "name": "to", - "type": "any" - } - ] - }, - { - "blocktype": "step", - "id": "9AED48C9-A90B-49FB-9C1A-FD632F0388F5", - "script": "{{1}} += {{2}};", - "help": "first argument must be a variable", - "sockets": [ - { - "name": "increment variable", - "type": "any" - }, - { - "name": "by", - "type": "any", - "value": 1 - } - ] - }, - { - "blocktype": "context", - "id": "66b33236-c9ce-4b6c-9b69-e8c4fdadbf52", - "script": "setTimeout(function(){[[1]]},1000*{{1}});", - "help": "pause before running the following blocks", - "sockets": [ - { - "name": "schedule in", - "type": "number", - "value": "1" - }, - { - "name": "secs" - } - ] - }, - { - "blocktype": "context", - "id": "aa146082-9a9c-4ae7-a409-a89e84dc113a", - "script": "range({{1}}).forEach(function(idx, item){local.count## = idx;[[1]]});", - "help": "repeat the contained blocks so many times", - "locals": [ - { - "blocktype": "expression", - "sockets": [ - { - "name": "count##" - } - ], - "script": "local.count##", - "type": "number" - } - ], - "sockets": [ - { - "name": "repeat", - "type": "number", - "value": 10 - } - ] - }, - { - "blocktype": "step", - "id": "b7079d91-f76d-41cc-a6aa-43fc2749429c", - "script": "global.stage.dispatchEvent(new CustomEvent(\"wb_\" + {{1}}));", - "help": "send this message to any listeners", - "sockets": [ - { - "name": "broadcast", - "type": "string", - "value": "ack", - "suffix": "message" - } - ] - }, - { - "blocktype": "step", - "id": "d175bd7d-c7fd-4465-8b1f-c82687f35577", - "script": "global.stage.dispatchEvent(new CustomEvent(\"wb_\" + {{1}}, {detail: {{2}}}));", - "help": "send this message with an object argument to any listeners", - "sockets": [ - { - "name": "broadcast", - "type": "string", - "value": "ping" - }, - { - "name": "message with data", - "type": "any" - } - ] - }, - { - "blocktype": "eventhandler", - "id": "3931a20c-f510-45e4-83d2-4005983d5cae", - "script": "global.stage.addEventListener(\"wb_\" + {{1}}, function(){[[1]]});", - "help": "add a listener for the given message, run these blocks when it is received", - "sockets": [ - { - "name": "when I receive", - "type": "string", - "value": "ack", - "suffix": "message" - } - ] - }, - { - "blocktype": "eventhandler", - "id": "a0496339-c405-4d1c-8185-9bc211bf5a56", - "script": "global.stage.addEventListener(\"wb_\" + {{1}}, function(event){local.data##=event.detail;[[1]]});", - "locals": [ - { - "blocktype": "expression", - "sockets": [ - { - "name": "data##" - } - ], - "script": "local.data##", - "type": "any" - } - ], - "help": "add a listener for the given message which receives data, run these blocks when it is received", - "sockets": [ - { - "name": "when I receive", - "type": "string", - "value": "ping", - "suffix": "message with data" - } - ] - }, - { - "blocktype": "context", - "id": "b1e43170-800a-4e9b-af82-0ed5c62c47a0", - "script": "while({{1}}){[[1]]}", - "help": "repeat until the condition is false", - "sockets": [ - { - "name": "forever if", - "type": "boolean", - "value": "false" - } - ] - }, - { - "blocktype": "context", - "id": "20ba3e08-74c0-428e-b612-53545de63ce0", - "script": "if({{1}}){[[1]]}", - "help": "run the following blocks only if the condition is true", - "sockets": [ - { - "name": "if", - "type": "boolean" - } - ] - }, - { - "blocktype": "context", - "id": "6dddaf61-caf0-4976-a3f1-9d9c3bbbf5a4", - "script": "if( ! {{1}} ){ [[1]] }", - "help": "run the blocks if the condition is not true", - "sockets": [ - { - "name": "if not", - "type": "boolean" - } - ] - }, - { - "blocktype": "expression", - "id": "AB5EB656-EF22-4DD3-9B5B-9A5187DF2F2F", - "script": "(({{1}}) ? ({{2}}) : ({{3}}))", - "help": "select a result based on a condition", - "type": "any", - "sockets": [ - { - "name": "if", - "type": "boolean", - "value": null - }, - { - "name": "then", - "type": "any", - "value": null - }, - { - "name": "else", - "type": "any", - "value": null - } - ] - }, - { - "blocktype": "context", - "id": "5a09e58a-4f45-4fa8-af98-84de735d0fc8", - "script": "while(!({{1}})){[[1]]}", - "help": "repeat forever until condition is true", - "sockets": [ - { - "name": "repeat until", - "type": "boolean" - } - ] - } - ] -} \ No newline at end of file diff --git a/languages/javascript/localizations/zh-tw/array.json b/languages/javascript/localizations/zh/array.json similarity index 99% rename from languages/javascript/localizations/zh-tw/array.json rename to languages/javascript/localizations/zh/array.json index b388a73c..b1ed792e 100644 --- a/languages/javascript/localizations/zh-tw/array.json +++ b/languages/javascript/localizations/zh/array.json @@ -1,4 +1,5 @@ { + "sectionkey": "arrays", "name": "Arrays", "help": "Arrays are lists of items. Items can be added and removed, located, sorted and more.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/boolean.json b/languages/javascript/localizations/zh/boolean.json similarity index 99% rename from languages/javascript/localizations/zh-tw/boolean.json rename to languages/javascript/localizations/zh/boolean.json index 7f32c969..3d132671 100644 --- a/languages/javascript/localizations/zh-tw/boolean.json +++ b/languages/javascript/localizations/zh/boolean.json @@ -1,4 +1,5 @@ { + "sectionkey": "boolean", "name": "Boolean", "help": "Booleans are true or false and expressions which evaluate to true or false", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/canvas.json b/languages/javascript/localizations/zh/canvas.json similarity index 99% rename from languages/javascript/localizations/zh-tw/canvas.json rename to languages/javascript/localizations/zh/canvas.json index b818147d..c34838a9 100644 --- a/languages/javascript/localizations/zh-tw/canvas.json +++ b/languages/javascript/localizations/zh/canvas.json @@ -1,4 +1,5 @@ { + "sectionkey": "canvas", "name": "Canvas", "help": "Canvas blocks are blocks that are about drawing on the canvas but don't fit elsewhere. Also look at the Sprites, Shapes, and Path menus.", "blocks": [ diff --git a/languages/javascript/localizations/zh/cleanup.py b/languages/javascript/localizations/zh/cleanup.py new file mode 100644 index 00000000..657a1b50 --- /dev/null +++ b/languages/javascript/localizations/zh/cleanup.py @@ -0,0 +1,18 @@ +import os +import json +import pdb +for root, dirs, files in os.walk("."): + for filename in files: + if os.path.splitext(filename)[-1] == ".json": + f = open(filename) + j = json.loads(f.read()) + f.close() + pdb.set_trace() + blocks = j['blocks'] + for block in blocks: + for k in block.keys(): + if k not in ['id','name','help']: + block.pop(k) + f = open(filename,"w") + f.write(json.dumps(j, indent=4)) + f.close() diff --git a/languages/javascript/localizations/zh-tw/color.json b/languages/javascript/localizations/zh/color.json similarity index 99% rename from languages/javascript/localizations/zh-tw/color.json rename to languages/javascript/localizations/zh/color.json index 1b795ca4..06fd887e 100644 --- a/languages/javascript/localizations/zh-tw/color.json +++ b/languages/javascript/localizations/zh/color.json @@ -1,4 +1,5 @@ { + "sectionkey": "color", "name": "Color", "help": "Color blocks are for creating, converting, and manipulating colors", "blocks": [ diff --git a/languages/javascript/localizations/zh/control.json b/languages/javascript/localizations/zh/control.json new file mode 100644 index 00000000..5e3fed2d --- /dev/null +++ b/languages/javascript/localizations/zh/control.json @@ -0,0 +1,268 @@ +{ + "sectionkey": "controls", + "name": "控制", + "help": "包含控制流程、變數、指派、訊息廣播", + "blocks": [ + { + "id": "1cf8132a-4996-47db-b482-4e336200e3ca", + "help": "當程序開始運行時,方框裡的腳本就會被運行", + "sockets": [ + { + "name": "程序開始運行時" + } + ] + }, + { + "id": "f4a604cd-f0b5-4133-9f91-4e1abe48fb6a", + "help": "每當此鍵被按下時,方框裡的腳本就會被運行", + "sockets": [ + { + "name": "按下", + "suffix": "鍵時" + } + ] + }, + { + "id": "f13fcf60-a7e4-4672-9ff8-06197a65af94", + "locals": [ + { + "sockets": [ + { + "name": "事件##" + } + ] + } + ], + "help": "每當選擇的滑鼠事件發生時,方框裡的腳本就會被運行", + "sockets": [ + { + "name": "當", + "suffix": "事件發生時" + } + ] + }, + { + "id": "cfea9087-3d7c-46ad-aa41-579bba2f4709", + "locals": [ + { + "sockets": [ + { + "name": "計數器##" + } + ] + } + ], + "help": "方框裡面的腳本每個影格裡會被運行一次", + "sockets": [ + { + "name": "每個影格" + } + ] + }, + { + "id": "47AA31E2-5A90-4AF1-8F98-5FDD437561B6", + "locals": [ + { + "sockets": [ + { + "name": "計數器##" + } + ] + } + ], + "help": "每秒運行運行方框裡的腳本那麼多次", + "sockets": [ + { + "name": "每秒重複", + "suffix": "次" + }, + { + "name": "直到", + "suffix": "為止" + } + ] + }, + { + "id": "079b2b89-41c2-4d00-8e21-bcb86574bf80", + "locals": [ + { + "sockets": [ + { + "name": "變數##" + } + ] + } + ], + "help": "建立一個變數", + "sockets": [ + { + "name": "變數 變數##" + } + ] + }, + { + "id": "b4036693-8645-4852-a4de-9e96565f9aec", + "help": "更新變數的值", + "sockets": [ + { + "name": "將變數", + "suffix": "的值" + }, + { + "name": "更新為" + } + ] + }, + { + "id": "9AED48C9-A90B-49FB-9C1A-FD632F0388F5", + "help": "將增加變數的值", + "sockets": [ + { + "name": "將變數", + "suffix": "的值" + }, + { + "name": "加" + } + ] + }, + { + "id": "66b33236-c9ce-4b6c-9b69-e8c4fdadbf52", + "help": "在運行方框內的腳本之前先暫停指定的時間", + "sockets": [ + { + "name": "暫停" + }, + { + "name": "秒後運行" + } + ] + }, + { + "id": "aa146082-9a9c-4ae7-a409-a89e84dc113a", + "help": "重複運行方框內的腳本這麼多次", + "locals": [ + { + "sockets": [ + { + "name": "計數器##" + } + ] + } + ], + "sockets": [ + { + "name": "重複" + } + ] + }, + { + "id": "b7079d91-f76d-41cc-a6aa-43fc2749429c", + "help": "將指定的訊息發送給所有的收聽者", + "sockets": [ + { + "name": "廣播訊息", + "suffix": "" + } + ] + }, + { + "id": "d175bd7d-c7fd-4465-8b1f-c82687f35577", + "help": "將指定的訊息和参量發送給所有的收聽者", + "sockets": [ + { + "name": "廣播訊息" + }, + { + "name": "和參數" + } + ] + }, + { + "id": "3931a20c-f510-45e4-83d2-4005983d5cae", + "help": "建立一個訊息收聽者,當接受到指定的訊息時,運行方框裡的腳本", + "sockets": [ + { + "name": "當接收到訊息", + "suffix": "時" + } + ] + }, + { + "id": "a0496339-c405-4d1c-8185-9bc211bf5a56", + "locals": [ + { + "sockets": [ + { + "name": "參數##" + } + ] + } + ], + "help": "建立一個訊息收聽者,當接受到指定的訊息時,運行方框裡的腳本", + "sockets": [ + { + "name": "當接受到訊息", + "suffix": "和參數時" + } + ] + }, + { + "id": "b1e43170-800a-4e9b-af82-0ed5c62c47a0", + "help": "無限重複運行方框內的腳本,直到條件不符合", + "sockets": [ + { + "name": "無限重複直到條件", + "suffix": "為假" + } + ] + }, + { + "id": "20ba3e08-74c0-428e-b612-53545de63ce0", + "help": "當條件滿足時,運行方框內的腳本", + "sockets": [ + { + "name": "如果條件", + "suffix": "為真" + } + ] + }, + { + "id": "6dddaf61-caf0-4976-a3f1-9d9c3bbbf5a4", + "help": "當條件不滿足時,運行方框內的腳本", + "sockets": [ + { + "name": "如果條件", + "suffix": "為假" + } + ] + }, + { + "id": "AB5EB656-EF22-4DD3-9B5B-9A5187DF2F2F", + "help": "根據條件滿足與否,選擇指定的值", + "type": "any", + "sockets": [ + { + "name": "若", + "suffix": "為真" + }, + { + "name": "則" + }, + { + "name": "否則" + } + ] + }, + { + "id": "5a09e58a-4f45-4fa8-af98-84de735d0fc8", + "help": "無重複直到條件滿足為止", + "sockets": [ + { + "name": "無限重複直到", + "suffix": "為止" + } + ] + } + ] +} \ No newline at end of file diff --git a/languages/javascript/localizations/zh-tw/date.json b/languages/javascript/localizations/zh/date.json similarity index 99% rename from languages/javascript/localizations/zh-tw/date.json rename to languages/javascript/localizations/zh/date.json index 7e587840..ff50c3f7 100644 --- a/languages/javascript/localizations/zh-tw/date.json +++ b/languages/javascript/localizations/zh/date.json @@ -1,4 +1,5 @@ { + "sectionkey": "date", "name": "Date", "help": "Date blocks are used to work with dates and times", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/fb.json b/languages/javascript/localizations/zh/fb.json similarity index 99% rename from languages/javascript/localizations/zh-tw/fb.json rename to languages/javascript/localizations/zh/fb.json index 1000e2ab..1e299764 100644 --- a/languages/javascript/localizations/zh-tw/fb.json +++ b/languages/javascript/localizations/zh/fb.json @@ -1,4 +1,5 @@ { + "sectionkey": "facebook", "name": "Facebook", "help": "Blocks for interacting with Facebook", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/geolocation.json b/languages/javascript/localizations/zh/geolocation.json similarity index 99% rename from languages/javascript/localizations/zh-tw/geolocation.json rename to languages/javascript/localizations/zh/geolocation.json index adfa0a44..7adc10f5 100644 --- a/languages/javascript/localizations/zh-tw/geolocation.json +++ b/languages/javascript/localizations/zh/geolocation.json @@ -1,4 +1,5 @@ { + "sectionkey": "geolocation", "name": "Geolocation", "help": "Geolocation blocks are for getting your position on Earth", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/image.json b/languages/javascript/localizations/zh/image.json similarity index 99% rename from languages/javascript/localizations/zh-tw/image.json rename to languages/javascript/localizations/zh/image.json index 666c2b56..ca6fdc93 100644 --- a/languages/javascript/localizations/zh-tw/image.json +++ b/languages/javascript/localizations/zh/image.json @@ -1,4 +1,5 @@ { + "sectionkey": "images", "name": "Images", "help": "Image blocks are for loading image files to use in other blocks and for manipulating images. See Sprite and Canvas menus.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/math.json b/languages/javascript/localizations/zh/math.json similarity index 99% rename from languages/javascript/localizations/zh-tw/math.json rename to languages/javascript/localizations/zh/math.json index 0aaee38d..3e52b82e 100644 --- a/languages/javascript/localizations/zh-tw/math.json +++ b/languages/javascript/localizations/zh/math.json @@ -1,4 +1,5 @@ { + "sectionkey": "math", "name": "Math", "help": "Math blocks are for manipulating numbers", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/matrix.json b/languages/javascript/localizations/zh/matrix.json similarity index 97% rename from languages/javascript/localizations/zh-tw/matrix.json rename to languages/javascript/localizations/zh/matrix.json index 578da51d..82958154 100644 --- a/languages/javascript/localizations/zh-tw/matrix.json +++ b/languages/javascript/localizations/zh/matrix.json @@ -1,4 +1,5 @@ { + "sectionkey": "matrix", "name": "Matrix", "help": "Matrix blocks can be used to store more complex tranformations on the canvas", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/motion.json b/languages/javascript/localizations/zh/motion.json similarity index 96% rename from languages/javascript/localizations/zh-tw/motion.json rename to languages/javascript/localizations/zh/motion.json index 487165ce..15908911 100644 --- a/languages/javascript/localizations/zh-tw/motion.json +++ b/languages/javascript/localizations/zh/motion.json @@ -1,4 +1,5 @@ { + "sectionkey": "motion", "name": "Motion", "help": "Motion blocks are for detecting the motion of devices equipped with accelerometers", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/object.json b/languages/javascript/localizations/zh/object.json similarity index 99% rename from languages/javascript/localizations/zh-tw/object.json rename to languages/javascript/localizations/zh/object.json index bb535213..686be192 100644 --- a/languages/javascript/localizations/zh-tw/object.json +++ b/languages/javascript/localizations/zh/object.json @@ -1,4 +1,5 @@ { + "sectionkey": "objects", "name": "Objects", "help": "Objects are key/value containers. Keys must be strings, but values can be any type.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/path.json b/languages/javascript/localizations/zh/path.json similarity index 99% rename from languages/javascript/localizations/zh-tw/path.json rename to languages/javascript/localizations/zh/path.json index fd48fd98..ba39c720 100644 --- a/languages/javascript/localizations/zh-tw/path.json +++ b/languages/javascript/localizations/zh/path.json @@ -1,4 +1,5 @@ { + "sectionkey": "paths", "name": "Paths", "help": "Path blocks are for construction more complex shapes for drawing, masking, and other uses.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/point.json b/languages/javascript/localizations/zh/point.json similarity index 99% rename from languages/javascript/localizations/zh-tw/point.json rename to languages/javascript/localizations/zh/point.json index 7e0ac34f..4516d32a 100644 --- a/languages/javascript/localizations/zh-tw/point.json +++ b/languages/javascript/localizations/zh/point.json @@ -1,4 +1,5 @@ { + "sectionkey": "points", "name": "Points", "help": "Point blocks represent and manipulate x,y coordinates.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/random.json b/languages/javascript/localizations/zh/random.json similarity index 98% rename from languages/javascript/localizations/zh-tw/random.json rename to languages/javascript/localizations/zh/random.json index 271612a8..376f1b9d 100644 --- a/languages/javascript/localizations/zh-tw/random.json +++ b/languages/javascript/localizations/zh/random.json @@ -1,5 +1,6 @@ { - "name": "Random", + "sectionkey": "random", + "name": "Random", "help": "Various forms of randomness for your code", "blocks": [ { diff --git a/languages/javascript/localizations/zh-tw/rect.json b/languages/javascript/localizations/zh/rect.json similarity index 99% rename from languages/javascript/localizations/zh-tw/rect.json rename to languages/javascript/localizations/zh/rect.json index 7364c6de..e7539983 100644 --- a/languages/javascript/localizations/zh-tw/rect.json +++ b/languages/javascript/localizations/zh/rect.json @@ -1,4 +1,5 @@ { + "sectionkey": "rects", "name": "Rects", "help": "Rect blocks represent and manipulate rectangles represented by x,y coordinates for the top left corner of the rectangle, plus a size (width,height).", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/sensing.json b/languages/javascript/localizations/zh/sensing.json similarity index 99% rename from languages/javascript/localizations/zh-tw/sensing.json rename to languages/javascript/localizations/zh/sensing.json index 79675533..03319788 100644 --- a/languages/javascript/localizations/zh-tw/sensing.json +++ b/languages/javascript/localizations/zh/sensing.json @@ -1,4 +1,5 @@ { + "sectionkey": "sensing", "name": "Sensing", "help": "Sensing blocks are for getting information from the environment, like user responses, mouse clicks, keyboard presses, and the size of the drawing area.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/shape.json b/languages/javascript/localizations/zh/shape.json similarity index 99% rename from languages/javascript/localizations/zh-tw/shape.json rename to languages/javascript/localizations/zh/shape.json index cfaf8ef2..7af333e9 100644 --- a/languages/javascript/localizations/zh-tw/shape.json +++ b/languages/javascript/localizations/zh/shape.json @@ -1,4 +1,5 @@ { + "sectionkey": "shapes", "name": "Shapes", "help": "Shape blocks are for creating shapes that can then be drawn or used to create sprites", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/size.json b/languages/javascript/localizations/zh/size.json similarity index 98% rename from languages/javascript/localizations/zh-tw/size.json rename to languages/javascript/localizations/zh/size.json index bdbee107..116bc064 100644 --- a/languages/javascript/localizations/zh-tw/size.json +++ b/languages/javascript/localizations/zh/size.json @@ -1,4 +1,5 @@ { + "sectionkey": "sizes", "name": "Sizes", "help": "Size blocks represent a width and height. They are often used as components of Rects.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/social.json b/languages/javascript/localizations/zh/social.json similarity index 97% rename from languages/javascript/localizations/zh-tw/social.json rename to languages/javascript/localizations/zh/social.json index 898c43f4..8d330a18 100644 --- a/languages/javascript/localizations/zh-tw/social.json +++ b/languages/javascript/localizations/zh/social.json @@ -1,4 +1,5 @@ { + "sectionkey": "twitter", "name": "Twitter", "help": "Social blocks are intended for working with social networking sites", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/sound.json b/languages/javascript/localizations/zh/sound.json similarity index 98% rename from languages/javascript/localizations/zh-tw/sound.json rename to languages/javascript/localizations/zh/sound.json index 5b8da288..fffe9638 100644 --- a/languages/javascript/localizations/zh-tw/sound.json +++ b/languages/javascript/localizations/zh/sound.json @@ -1,4 +1,5 @@ { + "sectionkey": "sound", "name": "Sound", "help": "Sound blocks can load and play sound files (wav, mp3, ogg) if those files are supported by your browser.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/sprite.json b/languages/javascript/localizations/zh/sprite.json similarity index 99% rename from languages/javascript/localizations/zh-tw/sprite.json rename to languages/javascript/localizations/zh/sprite.json index 801b94af..1b63b9b6 100644 --- a/languages/javascript/localizations/zh-tw/sprite.json +++ b/languages/javascript/localizations/zh/sprite.json @@ -1,4 +1,5 @@ { + "sectionkey": "sprites", "name": "Sprites", "help": "Sprites are graphics that can be repositioned, rotated, and have a vector of motion. They can also check for collision with other Sprites.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/string.json b/languages/javascript/localizations/zh/string.json similarity index 99% rename from languages/javascript/localizations/zh-tw/string.json rename to languages/javascript/localizations/zh/string.json index 9ad3b663..76bc7f61 100644 --- a/languages/javascript/localizations/zh-tw/string.json +++ b/languages/javascript/localizations/zh/string.json @@ -1,4 +1,5 @@ { + "sectionkey": "strings", "name": "Strings", "help": "String blocks represent or manipulate bits of text (strings of characters)", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/text.json b/languages/javascript/localizations/zh/text.json similarity index 99% rename from languages/javascript/localizations/zh-tw/text.json rename to languages/javascript/localizations/zh/text.json index 716ce87d..986a6215 100644 --- a/languages/javascript/localizations/zh-tw/text.json +++ b/languages/javascript/localizations/zh/text.json @@ -1,4 +1,5 @@ { + "sectionkey": "text", "name": "Text", "help": "Text blocks represent and manipulate the way text is drawn to the screen, things like alignment, font, and size.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/vector.json b/languages/javascript/localizations/zh/vector.json similarity index 99% rename from languages/javascript/localizations/zh-tw/vector.json rename to languages/javascript/localizations/zh/vector.json index 7a6c9e3c..d5e14d81 100644 --- a/languages/javascript/localizations/zh-tw/vector.json +++ b/languages/javascript/localizations/zh/vector.json @@ -1,4 +1,5 @@ { + "sectionkey": "vectors", "name": "Vectors", "help": "Vector blocks have a direction and a magnitude, which can represent speed of movement for a Sprite. Vectors can be added to or subtracted from other Vectors, among other things.", "blocks": [ diff --git a/languages/javascript/localizations/zh-tw/voice.json b/languages/javascript/localizations/zh/voice.json similarity index 99% rename from languages/javascript/localizations/zh-tw/voice.json rename to languages/javascript/localizations/zh/voice.json index 00a5014b..745ed647 100644 --- a/languages/javascript/localizations/zh-tw/voice.json +++ b/languages/javascript/localizations/zh/voice.json @@ -1,4 +1,5 @@ { + "sectionkey": "music", "name": "Music", "help": "Music blocks are for creating and manipulating sound programmatically, generating the sounds rather than playing back a recorded audio file (see the Sound menu for that).", "blocks": [ From f0333d0e279b7668d8589ee6a1e00f823f9f3fea Mon Sep 17 00:00:00 2001 From: yiting Date: Sun, 16 Mar 2014 13:25:31 -0400 Subject: [PATCH 03/16] translate array.json --- bin/build | 2 +- dist/arduino.js | 2 +- dist/javascript.js | 4 +- dist/node.js | 2 +- dist/processingjs.js | 2 +- languages/javascript/array.json | 2 +- .../javascript/localizations/zh/array.json | 169 ++++++------------ .../javascript/localizations/zh/control.json | 4 +- 8 files changed, 65 insertions(+), 122 deletions(-) diff --git a/bin/build b/bin/build index cf2d5afd..38ff97f0 100755 --- a/bin/build +++ b/bin/build @@ -48,7 +48,7 @@ var libs = { var localizations = { javascript: { - 'zh': ['control'] + 'zh': ['control', 'array'] } }; diff --git a/dist/arduino.js b/dist/arduino.js index c569ae84..9b36ce78 100644 --- a/dist/arduino.js +++ b/dist/arduino.js @@ -18,7 +18,7 @@ var Events=new function(){var a=this,b=[],c="0.2.3-beta",d=function(){var a=docu /* list of files used for localization of blocks */ -var l10nFiles = {"javascript":{"zh":["control"]}}; +var l10nFiles = {"javascript":{"zh":["control","array"]}}; /*begin ajax.js*/ diff --git a/dist/javascript.js b/dist/javascript.js index b2855c44..5d323bae 100644 --- a/dist/javascript.js +++ b/dist/javascript.js @@ -1841,7 +1841,7 @@ var Events=new function(){var a=this,b=[],c="0.2.3-beta",d=function(){var a=docu /* list of files used for localization of blocks */ -var l10nFiles = {"javascript":{"zh":["control"]}}; +var l10nFiles = {"javascript":{"zh":["control","array"]}}; /*begin ajax.js*/ @@ -7027,7 +7027,7 @@ wb.menu({ ], "sockets": [ { - "name": "new array with array##", + "name": "new array## with array", "type": "array" } ] diff --git a/dist/node.js b/dist/node.js index c7eeaf2d..2ba3c628 100644 --- a/dist/node.js +++ b/dist/node.js @@ -1841,7 +1841,7 @@ var Events=new function(){var a=this,b=[],c="0.2.3-beta",d=function(){var a=docu /* list of files used for localization of blocks */ -var l10nFiles = {"javascript":{"zh":["control"]}}; +var l10nFiles = {"javascript":{"zh":["control","array"]}}; /*begin ajax.js*/ diff --git a/dist/processingjs.js b/dist/processingjs.js index de978780..e841a1b7 100644 --- a/dist/processingjs.js +++ b/dist/processingjs.js @@ -12048,7 +12048,7 @@ var Events=new function(){var a=this,b=[],c="0.2.3-beta",d=function(){var a=docu /* list of files used for localization of blocks */ -var l10nFiles = {"javascript":{"zh":["control"]}}; +var l10nFiles = {"javascript":{"zh":["control","array"]}}; /*begin ajax.js*/ diff --git a/languages/javascript/array.json b/languages/javascript/array.json index b1ed792e..978a4417 100644 --- a/languages/javascript/array.json +++ b/languages/javascript/array.json @@ -45,7 +45,7 @@ ], "sockets": [ { - "name": "new array with array##", + "name": "new array## with array", "type": "array" } ] diff --git a/languages/javascript/localizations/zh/array.json b/languages/javascript/localizations/zh/array.json index b1ed792e..9f3f3cdb 100644 --- a/languages/javascript/localizations/zh/array.json +++ b/languages/javascript/localizations/zh/array.json @@ -1,248 +1,191 @@ { "sectionkey": "arrays", - "name": "Arrays", - "help": "Arrays are lists of items. Items can be added and removed, located, sorted and more.", + "name": "陣列", + "help": "陣列是一連串有順序的變數,支持的運算包含可以增加、刪除、排序、尋找...。", "blocks": [ { - "blocktype": "step", "id": "e6a297e9-1255-4701-91d8-80548489ee9a", "script": "local.array## = [];", - "help": "Create an empty array", + "help": "建立一個新的空白的陣列", "locals": [ { - "blocktype": "expression", "sockets": [ { - "name": "array##" + "name": "陣列##" } - ], - "script": "local.array##", - "type": "array" + ] } ], "sockets": [ { - "name": "new array##" + "name": "宣告陣列 陣列##" } ] }, { - "blocktype": "step", "id": "83d67170-4ba7-45ac-95ae-bb2f314c3ae0", - "script": "local.array## = {{1}}.slice();", - "help": "create a new array with the contents of another array", + "help": "建立一個新的陣列,但是內容與另外一個陣列相同。", "locals": [ { - "blocktype": "expression", "sockets": [ { - "name": "array##" + "name": "陣列##" } - ], - "script": "local.array##", - "type": "array" + ] } ], "sockets": [ { - "name": "new array with array##", - "type": "array" + "name": "宣告陣列 陣列## 並複製陣列", + "suffix": "的內容" } ] }, { - "blocktype": "expression", "id": "3e56f9c1-29b9-4d0c-99bd-05ccabfa29c2", - "script": "{{1}}[{{2}}]", - "type": "any", - "help": "get an item from an index in the array", + "help": "找到陣列裡面第n+1個值。(例,0代表第一項)", "sockets": [ { - "name": "array", - "type": "array" + "name": "陣列", + "suffix": "的" }, { - "name": "item", - "type": "number", - "value": 0 + "name": "第", + "suffix": "+1項" } ] }, { - "blocktype": "expression", "id": "5b1cc330-b9b1-4062-b8d4-e5032c7a5776", - "script": "{{1}}.join({{2}})", - "type": "string", - "help": "join items of an array into a string, each item separated by given string", + + "help": "將陣列裡面的項目轉換成字符串,並且用指定的字符串隔開", "sockets": [ { - "name": "array", - "type": "array" + "name": "將陣列" }, { - "name": "join with", - "type": "string", - "value": ", " + "name": "用", + "suffix": "分隔" } ] }, { - "blocktype": "step", "id": "3fab2b88-430a-401e-88b2-2703d614780a", - "script": "{{1}}.push({{2}});", - "help": "add any object to the end of an array", + "help": "把值放到陣列裡的最後一項", "sockets": [ { - "name": "array", - "type": "array" + "name": "在陣列", + "suffix": "的最後" }, { - "name": "append", - "type": "any" + "name": "加入" } ] }, { - "blocktype": "step", "id": "77edf0e9-e5df-4294-81ef-bfa363cda3ee", - "script": "{{1}}.unshift({{2}});", - "help": "add any object to the beginning of an array", + "help": "把值放到陣列裡的第一項", "sockets": [ { - "name": "array", - "type": "array" + "name": "在陣列", + "suffix": "的最前方" }, { - "name": "prepend", - "type": "any" + "name": "加入" } ] }, { - "blocktype": "expression", "id": "bf3ed213-4435-4152-bb2c-573ce1721036", - "script": "{{1}}.length", - "type": "number", - "help": "get the length of an array", + "help": "陣列的長度", "sockets": [ { - "name": "array", - "type": "array", - "suffix": "length" + "name": "陣列", + "suffix": "的長度" } ] }, { - "blocktype": "expression", "id": "f4870f0f-1dbb-4bc7-b8e3-3a00af613689", - "script": "{{1}}.splice({{2}}, 1)[0]", - "type": "any", - "help": "remove item at index from an array", + "help": "從陣列裡面移除第n+1項。(例,0代表第一項)", "sockets": [ { - "name": "array", - "type": "array" + "name": "將陣列", + "suffix": "的" }, { - "name": "remove item", - "type": "number", - "value": 0 + "name": "第", + "suffix": "+1項移除" } ] }, { - "blocktype": "expression", "id": "e137e1a3-fe66-4d15-ae2a-596050acb6a7", - "script": "{{1}}.pop()", - "type": "any", - "help": "remove and return the last item from an array", + "help": "回傳陣列裡最後一項的值,並將之移除", "sockets": [ { - "name": "array", - "type": "array", - "suffix": "pop" + "name": "移出陣列", + "suffix": "的最後一項" } ] }, { - "blocktype": "expression", "id": "00685267-c279-4fc1-bdbd-a07742a76b1e", - "script": "{{1}}.shift()", - "type": "any", - "help": "remove and return the first item from an array", + "help": "回傳陣列裡第一項的值,並將之移除", "sockets": [ { - "name": "array", - "type": "array", - "suffix": "shift" + "name": "移出陣列", + "suffix": "的第一項" } ] }, { - "blocktype": "expression", "id": "b4f115d3-fc52-4d75-a363-5119de21e97c", - "script": "{{1}}.slice().reverse()", - "type": "array", - "help": "reverse a copy of array", + "help": "回傳指定的陣列反序的複本", "sockets": [ { - "name": "array", - "type": "array", - "suffix": "reversed" + "name": "陣列", + "suffix": "的反序" } ] }, { - "blocktype": "expression", "id": "0931d219-707c-41dd-92e6-b1a7c2a0f6b3", - "script": "{{1}}.concat({{2}});", - "type": "array", - "help": "a new array formed by joining the arrays", + "help": "將兩個陣列連接起來並形成新的陣列", "sockets": [ { - "name": "array", - "type": "array" + "name": "陣列" }, { - "name": "concat", - "type": "array" + "name": "串聯陣列" } ] }, { - "blocktype": "context", "id": "9f6f4e21-7abf-4e6f-b9bf-4ce8a1086a21", - "script": "{{1}}.forEach(function(item, idx){local.index = idx; local.item = item; [[1]] });", "locals": [ { - "blocktype": "expression", "sockets": [ { - "name": "index" + "name": "索引值" } ], - "script": "local.index", - "help": "index of current item in array", - "type": "number" + "help": "目前項目在陣列中的索引值。(第n項的索引值是n-1。比如說第一項的索引值是0)" }, { - "blocktype": "expression", "sockets": [ { - "name": "item" + "name": "項目" } ], - "script": "local.item", - "help": "the current item in the iteration", - "type": "any" + "help": "目前循環到的項目" } ], - "help": "run the blocks with each item of a named array", + "help": "對陣列中的每個項目運行方框中的腳本", "sockets": [ { - "name": "array", - "type": "array", - "suffix": "for each" + "name": "對陣列", + "suffix": "中的每個項目" } ] } diff --git a/languages/javascript/localizations/zh/control.json b/languages/javascript/localizations/zh/control.json index 5e3fed2d..663ebcf2 100644 --- a/languages/javascript/localizations/zh/control.json +++ b/languages/javascript/localizations/zh/control.json @@ -96,7 +96,7 @@ "help": "建立一個變數", "sockets": [ { - "name": "變數 變數##" + "name": "宣告變數 變數##" } ] }, @@ -256,7 +256,7 @@ }, { "id": "5a09e58a-4f45-4fa8-af98-84de735d0fc8", - "help": "無重複直到條件滿足為止", + "help": "無限重複運行方框內的腳本直到條件滿足為止", "sockets": [ { "name": "無限重複直到", From 243ff7c9e0c59ae1e61be17c3039d1b957f45c58 Mon Sep 17 00:00:00 2001 From: yiting Date: Tue, 18 Mar 2014 14:20:27 -0400 Subject: [PATCH 04/16] trasnlate boolean.json --- .../javascript/localizations/zh/boolean.json | 60 +++++-------------- 1 file changed, 16 insertions(+), 44 deletions(-) diff --git a/languages/javascript/localizations/zh/boolean.json b/languages/javascript/localizations/zh/boolean.json index 3d132671..3b4e1c1d 100644 --- a/languages/javascript/localizations/zh/boolean.json +++ b/languages/javascript/localizations/zh/boolean.json @@ -1,65 +1,47 @@ { "sectionkey": "boolean", - "name": "Boolean", - "help": "Booleans are true or false and expressions which evaluate to true or false", + "name": "真假值", + "help": "布爾代數包含真值、假值以及可以演算得到真假值的表達式", "blocks": [ { - "blocktype": "expression", "id": "770756e8-3a10-4993-b02e-3d1333c98958", - "type": "boolean", - "script": "({{1}} && {{2}})", - "help": "both operands are true", + "help": "若兩者皆為真,則真", "sockets": [ { - "name": "", - "type": "boolean" + "name": "" }, { - "name": "and", - "type": "boolean" + "name": "且" } ] }, { - "blocktype": "expression", "id": "a56c0d03-5c5c-4459-9aaf-cbbea6eb3abf", - "type": "boolean", - "script": "({{1}} || {{2}})", - "help": "either or both operands are true", + "help": "若兩者有一者以上為真,則真", "sockets": [ { - "name": "", - "type": "boolean" + "name": "" }, { - "name": "or", - "type": "boolean" + "name": "或" } ] }, { - "blocktype": "expression", "id": "cb9ddee8-5ee1-423b-9559-6d2cbb379b80", - "type": "boolean", - "script": "({{1}} ? !{{2}} : {{2}})", - "help": "either, but not both, operands are true", + "help": "若兩者中有一者為真、一者為假,則真", "sockets": [ { - "name": "", - "type": "boolean" + "name": "" }, { - "name": "xor", - "type": "boolean" + "name": "異或" } ] }, { - "blocktype": "expression", "id": "138a6840-37cc-4e2d-b44a-af32e673ba56", - "type": "boolean", - "script": "(! {{1}})", - "help": "operand is false", + "help": "若參數為假,則真", "sockets": [ { "name": "not", @@ -68,32 +50,22 @@ ] }, { - "blocktype": "expression", "id": "de9f5ebd-2408-4c72-9705-786b1eec2b14", - "type": "boolean", - "script": "!({{1}}%2)", - "help": "true when the parameter is even", + "help": "若參數為偶數,則真", "sockets": [ { "name": "", - "type": "number", - "value": 2, - "suffix": "is even" + "suffix": "為偶數" } ] }, { - "blocktype": "expression", "id": "0ac50ac9-2af6-4073-83cf-4f79b4bde163", - "type": "boolean", - "script": "!!({{1}}%2)", - "help": "true when the parameter is odd", + "help": "若參數為奇數,則真", "sockets": [ { "name": "", - "type": "number", - "value": 1, - "suffix": "is odd" + "suffix": "為奇數" } ] } From fd66744c56a915ce9ad44b7ab0539087c28038ca Mon Sep 17 00:00:00 2001 From: yiting Date: Tue, 18 Mar 2014 14:27:46 -0400 Subject: [PATCH 05/16] correct terminology in boolean.json --- .../javascript/localizations/zh/boolean.json | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/languages/javascript/localizations/zh/boolean.json b/languages/javascript/localizations/zh/boolean.json index 3b4e1c1d..855a0563 100644 --- a/languages/javascript/localizations/zh/boolean.json +++ b/languages/javascript/localizations/zh/boolean.json @@ -1,11 +1,11 @@ { "sectionkey": "boolean", "name": "真假值", - "help": "布爾代數包含真值、假值以及可以演算得到真假值的表達式", + "help": "布爾代數包含真值、假值以及可以演算得到真假值的運算式", "blocks": [ { "id": "770756e8-3a10-4993-b02e-3d1333c98958", - "help": "若兩者皆為真,則真", + "help": "若運算元皆為真,則真", "sockets": [ { "name": "" @@ -17,7 +17,7 @@ }, { "id": "a56c0d03-5c5c-4459-9aaf-cbbea6eb3abf", - "help": "若兩者有一者以上為真,則真", + "help": "若運算元中有一者以上為真,則真", "sockets": [ { "name": "" @@ -29,7 +29,7 @@ }, { "id": "cb9ddee8-5ee1-423b-9559-6d2cbb379b80", - "help": "若兩者中有一者為真、一者為假,則真", + "help": "若運算元中有一者為真、一者為假,則真", "sockets": [ { "name": "" @@ -41,17 +41,16 @@ }, { "id": "138a6840-37cc-4e2d-b44a-af32e673ba56", - "help": "若參數為假,則真", + "help": "若運算元為假,則真", "sockets": [ { - "name": "not", - "type": "boolean" + "name": "非" } ] }, { "id": "de9f5ebd-2408-4c72-9705-786b1eec2b14", - "help": "若參數為偶數,則真", + "help": "若運算元為偶數,則真", "sockets": [ { "name": "", @@ -61,7 +60,7 @@ }, { "id": "0ac50ac9-2af6-4073-83cf-4f79b4bde163", - "help": "若參數為奇數,則真", + "help": "若運算元為奇數,則真", "sockets": [ { "name": "", From 5463d9caa61681b9ac101d76d1f22beee2a15fb0 Mon Sep 17 00:00:00 2001 From: Wai Ho Leung Date: Fri, 28 Mar 2014 12:49:12 -0700 Subject: [PATCH 06/16] Added chinese (zh-tw) localization for math. --- .../javascript/localizations/zh/math.json | 493 ++++++++++++++---- 1 file changed, 389 insertions(+), 104 deletions(-) diff --git a/languages/javascript/localizations/zh/math.json b/languages/javascript/localizations/zh/math.json index 3e52b82e..47085ad0 100644 --- a/languages/javascript/localizations/zh/math.json +++ b/languages/javascript/localizations/zh/math.json @@ -1,14 +1,14 @@ { "sectionkey": "math", - "name": "Math", - "help": "Math blocks are for manipulating numbers", + "name": "數學", + "help": "包含基本算術、三角函數、常數等數學運算。", "blocks": [ { "blocktype": "expression", "id": "CC2FD987-1EFC-483C-BDA3-71C839E4BAC4", "type": "number", "script": "({{1}}E{{2}})", - "help": "scientific notation", + "help": "科學記數法", "sockets": [ { "name": "", @@ -20,6 +20,10 @@ "type": "number", "value": "0" } + ], + "keywords": [ + "exponent", + "科學記數法" ] }, { @@ -27,7 +31,7 @@ "id": "406d4e12-7dbd-4f94-9b0e-e2a66d960b3c", "type": "number", "script": "({{1}} + {{2}})", - "help": "sum of the two operands", + "help": "將引數相加", "sockets": [ { "name": "", @@ -39,6 +43,13 @@ "type": "number", "value": 0 } + ], + "keywords": [ + "addition", + "plus", + "sum", + "加法", + "和" ] }, { @@ -46,7 +57,7 @@ "id": "d7082309-9f02-4cf9-bcd5-d0cac243bff9", "type": "number", "script": "({{1}} - {{2}})", - "help": "difference of the two operands", + "help": "將引數相減", "sockets": [ { "name": "", @@ -58,6 +69,13 @@ "type": "number", "value": 0 } + ], + "keywords": [ + "subtraction", + "minus", + "difference", + "減法", + "差" ] }, { @@ -65,7 +83,7 @@ "id": "bd3879e6-e440-49cb-b10b-52d744846341", "type": "number", "script": "({{1}} * {{2}})", - "help": "product of the two operands", + "help": "將引數相乘", "sockets": [ { "name": "", @@ -77,6 +95,13 @@ "type": "number", "value": 0 } + ], + "keywords": [ + "multiplication", + "times", + "product", + "乘法", + "積" ] }, { @@ -84,7 +109,7 @@ "id": "7f51bf70-a48d-4fda-ab61-442a0766abc4", "type": "number", "script": "({{1}} / {{2}})", - "help": "quotient of the two operands", + "help": "將引數相除", "sockets": [ { "name": "", @@ -96,6 +121,13 @@ "type": "number", "value": 0 } + ], + "keywords": [ + "division", + "divide", + "quotient", + "除法", + "商" ] }, { @@ -103,7 +135,7 @@ "id": "e3a5ea20-3ca9-42cf-ac02-77ff06836a7e", "type": "boolean", "script": "({{1}} === {{2}})", - "help": "two operands are equal", + "help": "兩個引數是相等的", "sockets": [ { "name": "", @@ -115,6 +147,11 @@ "type": "number", "value": 0 } + ], + "keywords": [ + "comparison", + "equal", + "等於" ] }, { @@ -122,7 +159,7 @@ "id": "11f59515-8061-4c96-a358-4944ad58cd18", "type": "boolean", "script": "({{1}} !== {{2}})", - "help": "two operands are not equal", + "help": "兩個引數是不相等的", "sockets": [ { "name": "", @@ -134,6 +171,11 @@ "type": "number", "value": "0" } + ], + "keywords": [ + "comparison", + "not equal", + "不等於" ] }, { @@ -141,7 +183,7 @@ "id": "d753757b-a7d4-4d84-99f1-cb9b8c7e62da", "type": "boolean", "script": "({{1}} < {{2}})", - "help": "first operand is less than second operand", + "help": "第一個引數少於第二個引數", "sockets": [ { "name": "", @@ -153,6 +195,11 @@ "type": "number", "value": 0 } + ], + "keywords": [ + "comparison", + "less than", + "小於" ] }, { @@ -160,7 +207,7 @@ "id": "A6725EBC-C1A2-4BB4-8A34-396F2CC5D833", "type": "boolean", "script": "({{1}} <= {{2}})", - "help": "first operand is less than or equal to second operand", + "help": "第一個引數少於或等於第二個引數", "sockets": [ { "name": "", @@ -172,6 +219,11 @@ "type": "number", "value": "0" } + ], + "keywords": [ + "comparison", + "less than or equal to", + "小於等於" ] }, { @@ -179,7 +231,7 @@ "id": "5a1f5f68-d74b-4154-b376-6a0200f585ed", "type": "boolean", "script": "({{1}} > {{2}})", - "help": "first operand is greater than second operand", + "help": "第一個引數大於第二個引數", "sockets": [ { "name": "", @@ -191,6 +243,11 @@ "type": "number", "value": 0 } + ], + "keywords": [ + "comparison", + "greater than", + "大於" ] }, { @@ -198,7 +255,7 @@ "id": "75B859E7-9244-45DE-BA08-C3D09F67069F", "type": "boolean", "script": "({{1}} >= {{2}})", - "help": "first operand is greater than or equal to second operand", + "help": "第一個引數大於或等於第二個引數", "sockets": [ { "name": "", @@ -210,6 +267,11 @@ "type": "number", "value": "0" } + ], + "keywords": [ + "comparison", + "greater than or equal to", + "大於等於" ] }, { @@ -217,7 +279,7 @@ "id": "a2647515-2f14-4d0f-84b1-a6e288823630", "type": "number", "script": "({{1}} % {{2}})", - "help": "modulus of a number is the remainder after whole number division", + "help": "相除後的餘數", "sockets": [ { "name": "", @@ -229,6 +291,11 @@ "type": "number", "value": 0 } + ], + "keywords": [ + "modulus", + "modulo", + "餘數" ] }, { @@ -236,13 +303,17 @@ "id": "4f7803c0-24b1-4a0c-a461-d46acfe9ab25", "type": "number", "script": "Math.round({{1}})", - "help": "rounds to the nearest whole number", + "help": "將數字四捨五入至指定的位數", "sockets": [ { - "name": "round", + "name": "四捨五入", "type": "number", "value": 0 } + ], + "keywords": [ + "rounding", + "四捨五入" ] }, { @@ -250,13 +321,18 @@ "id": "c38383df-a765-422e-b215-7d1cfb7557a1", "type": "number", "script": "Math.abs({{1}})", - "help": "converts a negative number to positive, leaves positive alone", + "help": "數值的絕對值,即是不帶符號的值", "sockets": [ { - "name": "absolute value of", + "name": "", "type": "number", - "value": 10 + "value": 10, + "suffix": "的絕對值" } + ], + "keywords": [ + "absolute value", + "絕對值" ] }, { @@ -264,13 +340,18 @@ "id": "46bcac2d-eb76-417c-81af-cb894a54a86c", "type": "number", "script": "Math.floor({{1}})", - "help": "rounds down to nearest whole number", + "help": "將數字無條件捨位至趨近於零", "sockets": [ { "name": "floor of", "type": "number", "value": 10 } + ], + "keywords": [ + "floor", + "rounding", + "地板函數" ] }, { @@ -278,13 +359,17 @@ "id": "4945df27-f4f3-490b-94ae-67c7081f744b", "type": "number", "script": "Math.ceil({{1}})", - "help": "rounds up to nearest whole number", + "help": "將數值以背離於零的方式無條件進位", "sockets": [ { "name": "ceiling of", "type": "number", "value": 10 } + ], + "keywords": [ + "ceiling", + "rounding" ] }, { @@ -292,18 +377,25 @@ "id": "24A7ACF3-13A7-4150-8740-CB9F2B963789", "type": "number", "script": "gcd({{1}},{{2}})", - "help": "greatest common divisor - the largest number that is a factor of both arguments", + "help": "最大公因數,即是能夠整除兩個引數的最大整數", "sockets": [ { - "name": "gcd of", + "name": "", "type": "number", "value": "1" }, { - "name": "and", + "name": "和", "type": "number", "value": "2" + }, + { + "name": "的最大公因數" } + ], + "keywords": [ + "gcd", + "最大公因數" ] }, { @@ -311,18 +403,25 @@ "id": "E764FF62-BB0D-477E-85A2-8C0EA050904E", "type": "number", "script": "lcm({{1}},{{2}})", - "help": "least common multiple - the smallest number divisible by both arguments", + "help": "最小公倍數,即是做為兩個引數的倍數之最小正整數", "sockets": [ { - "name": "lcm of", + "name": "", "type": "number", "value": "1" }, { - "name": "and", + "name": "和", "type": "number", "value": "2" + }, + { + "name": "的最小公倍數" } + ], + "keywords": [ + "lcm", + "最小公倍數" ] }, { @@ -330,18 +429,25 @@ "id": "F3A723AF-B17C-4549-AC7F-2FFF451A2B1E", "type": "number", "script": "Math.max({{1}},{{2}})", - "help": "the larger of the two arguments", + "help": "兩個引數中的最大值", "sockets": [ { - "name": "maximum of", + "name": "", "type": "number", "value": "1" }, { - "name": "or", + "name": "和", "type": "number", "value": "2" + }, + { + "name": "中的最大值" } + ], + "keywords": [ + "maximum", + "最大值" ] }, { @@ -349,18 +455,25 @@ "id": "FEA46803-0FEF-418E-9B7B-C289BE50A060", "type": "number", "script": "Math.min({{1}},{{2}})", - "help": "the smaller of the two arguments", + "help": "兩個引數中的最小值", "sockets": [ { - "name": "minimum of", + "name": "", "type": "number", "value": "1" }, { - "name": "or", + "name": "和", "type": "number", "value": "2" + }, + { + "name": "中的最小值" } + ], + "keywords": [ + "minimum", + "最小值" ] }, { @@ -368,13 +481,17 @@ "id": "5178A7D0-9D89-49EC-AA53-D3FA9AEDA6A4", "type": "number", "script": "gamma({{1}}+1)", - "help": "the product of all numbers less than or equal to the input - technically, Γ(n+1)", + "help": "數字的階乘", "sockets": [ { - "name": "factorial of", + "name": "", "type": "number", - "value": "5" + "value": "5", + "suffix": "的階乘" } + ], + "keywords": [ + "factorial" ] }, { @@ -382,14 +499,20 @@ "id": "ce4bf2bc-a06a-47f4-ac05-df2213d087a5", "type": "number", "script": "Math.cos(deg2rad({{1}}))", - "help": "ratio of the length of the adjacent side to the length of the hypotenuse", + "help": "數值的餘弦值", "sockets": [ { - "name": "cosine of", + "name": "cos", "type": "number", "value": 10, - "suffix": "degrees" + "suffix": "度" } + ], + "keywords": [ + "trigonometric", + "cosine", + "三角", + "餘弦" ] }, { @@ -397,14 +520,20 @@ "id": "1a8f6a28-14e9-4400-8e80-31217309ebc9", "type": "number", "script": "Math.sin(deg2rad({{1}}))", - "help": "ratio of the length of the opposite side to the length of the hypotenuse", + "help": "數值的正弦值", "sockets": [ { - "name": "sine of", + "name": "sin", "type": "number", "value": 10, - "suffix": "degrees" + "suffix": "度" } + ], + "keywords": [ + "trigonometric", + "sine", + "三角", + "正弦" ] }, { @@ -412,14 +541,20 @@ "id": "fcecb61b-7fd9-4a92-b6cb-77d0a2fc8541", "type": "number", "script": "Math.tan(deg2rad({{1}}))", - "help": "ratio of the length of the opposite side to the length of the adjacent side", + "help": "數值的正切值", "sockets": [ { - "name": "tangent of", + "name": "tan", "type": "number", "value": 10, - "suffix": "degrees" + "suffix": "度" } + ], + "keywords": [ + "trigonometric", + "tangent", + "三角", + "正切" ] }, { @@ -427,13 +562,22 @@ "id": "9bf66bb0-c182-42e5-b3a7-cf10de26b08c", "type": "number", "script": "rad2deg(Math.acos({{1}}))", - "help": "inverse of cosine", + "help": "數值的反餘弦值", "sockets": [ { - "name": "arccosine degrees of", + "name": "arccos", "type": "number", - "value": "10" + "value": "10", + "suffix": "度" } + ], + "keywords": [ + "trigonometric", + "arccosine", + "cosine", + "三角", + "反餘弦", + "餘弦" ] }, { @@ -441,13 +585,21 @@ "id": "92f79a75-e3f4-4fc7-8f17-bf586aef180b", "type": "number", "script": "rad2deg(Math.asin({{1}}))", - "help": "inverse of sine", + "help": "數值的反正弦值", "sockets": [ { - "name": "arcsine degrees of", + "name": "arcsin", "type": "number", "value": "10" } + ], + "keywords": [ + "trigonometric", + "arcsine", + "sine", + "三角", + "反正弦", + "正弦" ] }, { @@ -455,13 +607,21 @@ "id": "1f5ee069-148e-4e4a-a514-5179af86be15", "type": "number", "script": "rad2deg(Math.atan({{1}}))", - "help": "inverse of tangent", + "help": "數值的反正切值", "sockets": [ { - "name": "arctangent degrees of", + "name": "arctan", "type": "number", "value": "10" } + ], + "keywords": [ + "trigonometric", + "arctangent", + "tangent", + "三角", + "反正切", + "正切" ] }, { @@ -469,16 +629,23 @@ "id": "52AA07F8-7C71-4BE1-902A-3F3AC88822B0", "type": "number", "script": "Math.cosh(deg2rad({{1}}))", - "help": "ratio of the length of the adjacent side to the length of the hypotenuse", + "help": "數值的雙曲餘弦值", "sockets": [ { - "name": "hyperbolic cosine of", + "name": "cosh", "type": "number", - "value": "10" - }, - { - "name": "degrees" + "value": "10", + "suffix": "度" } + ], + "keywords": [ + "trigonometric", + "hyperbolic", + "cosh", + "cosine", + "三角", + "雙曲餘弦", + "餘弦" ] }, { @@ -486,16 +653,23 @@ "id": "D5D68651-B6A1-44EE-8246-87060C62860F", "type": "number", "script": "Math.sinh(deg2rad({{1}}))", - "help": "ratio of the length of the opposite side to the length of the hypotenuse", + "help": "數值的雙曲正弦值", "sockets": [ { - "name": "hyperbolic sine of", + "name": "sinh", "type": "number", - "value": "10" - }, - { - "name": "degrees" + "value": "10", + "suffix": "度" } + ], + "keywords": [ + "trigonometric", + "hyperbolic", + "sinh", + "sine", + "三角", + "雙曲正弦", + "正弦" ] }, { @@ -503,16 +677,23 @@ "id": "72442F9D-0AA5-4A0E-A3E0-7D6E46A944CF", "type": "number", "script": "Math.tanh(deg2rad({{1}}))", - "help": "ratio of the length of the opposite side to the length of the adjacent side", + "help": "數值的雙曲正切值", "sockets": [ { - "name": "hyperbolic tangent of", + "name": "tanh", "type": "number", - "value": "10" - }, - { - "name": "degrees" + "value": "10", + "suffix": "度" } + ], + "keywords": [ + "trigonometric", + "hyperbolic", + "tanh", + "tangent", + "三角", + "雙曲正切", + "正切" ] }, { @@ -520,13 +701,24 @@ "id": "8BCC0FB3-878C-4BA8-A4A1-A73C6FE9F71B", "type": "number", "script": "rad2deg(Math.acosh({{1}}))", - "help": "inverse of hyperbolic cosine", + "help": "數值的反雙曲餘弦值", "sockets": [ { - "name": "hyperbolic arccosine degrees of", + "name": "arccos", "type": "number", "value": "10" } + ], + "keywords": [ + "trigonometric", + "hyperbolic", + "acosh", + "arccosine", + "cosine", + "三角", + "反雙曲餘弦", + "雙曲餘弦", + "餘弦" ] }, { @@ -534,13 +726,24 @@ "id": "03A6DA1C-F1AB-499C-A97E-0F59E0A6A371", "type": "number", "script": "rad2deg(Math.asinh({{1}}))", - "help": "inverse of hyperbolic sine", + "help": "數值的反雙曲正弦值", "sockets": [ { - "name": "hyperbolic arcsine degrees of", + "name": "arcsin", "type": "number", "value": "10" } + ], + "keywords": [ + "trigonometric", + "hyperbolic", + "asinh", + "arcsine", + "sine", + "三角", + "反雙曲正弦", + "雙曲正弦", + "正弦" ] }, { @@ -548,13 +751,24 @@ "id": "A114C2B7-3334-4DCB-9418-F1BB40F8604D", "type": "number", "script": "rad2deg(Math.atanh({{1}}))", - "help": "inverse of hyperbolic tangent", + "help": "數值的反雙曲正切值", "sockets": [ { - "name": "hyperbolic arctangent degrees of", + "name": "arctan", "type": "number", "value": "10" } + ], + "keywords": [ + "trigonometric", + "hyperbolic", + "atanh", + "arctangent", + "tangent", + "三角", + "反雙曲正切", + "雙曲正切", + "正切" ] }, { @@ -562,7 +776,7 @@ "id": "8a4a81d8-de25-46f0-b610-97d4f6fffbff", "type": "number", "script": "Math.pow({{1}}, {{2}})", - "help": "multiply a number by itself the given number of times", + "help": "數字的指定乘冪結果", "sockets": [ { "name": "", @@ -570,10 +784,18 @@ "value": 10 }, { - "name": "to the power of", + "name": "的", "type": "number", "value": 2 + }, + { + "name": "次方" } + ], + "keywords": [ + "power", + "exponent", + "乘冪" ] }, { @@ -581,13 +803,19 @@ "id": "668798a3-f15e-4839-b4b3-da5db380aa5a", "type": "number", "script": "Math.sqrt({{1}})", - "help": "the square root is the same as taking the power of 1/2", + "help": "正平方根", "sockets": [ { - "name": "square root of", + "name": "正平方根", "type": "number", "value": 10 } + ], + "keywords": [ + "exponent", + "square root", + "正平方根", + "平方根" ] }, { @@ -595,18 +823,26 @@ "id": "30513651-eab2-4f85-9ec5-725df5d62851", "type": "number", "script": "(Math.log({{2}})/Math.log({{1}}))", - "help": "logarithm", + "help": "指定底數之數字的對數", "sockets": [ { - "name": "log base", + "name": "以", "type": "number", "value": "10" }, { - "name": "of", + "name": "為底的", "type": "number", "value": "1" + }, + { + "name": "的對數" } + ], + "keywords": [ + "exponent", + "logarithm", + "對數" ] }, { @@ -614,11 +850,16 @@ "id": "93708036-080B-49FE-942E-E65CBC72BE44", "script": "Math.E", "type": "number", - "help": "base of natural logarithm", + "help": "自然對數的底數", "sockets": [ { "name": "e" } + ], + "keywords": [ + "exponent", + "logarithm", + "自然對數" ] }, { @@ -626,11 +867,17 @@ "id": "a34c51d9-bfa0-49ad-8e7d-b653611836d3", "script": "Math.PI", "type": "number", - "help": "pi is the ratio of a circle's circumference to its diameter", + "help": "圓周率是圓的周長與直徑的比值", "sockets": [ { - "name": "pi" + "name": "π" } + ], + "keywords": [ + "pi", + "circle", + "circumference", + "圓周率" ] }, { @@ -638,11 +885,17 @@ "id": "da2c8203-bf80-4617-a762-92dd4d7bfa27", "script": "(Math.PI * 2)", "type": "number", - "help": "tau is 2 times pi, a generally more useful number", + "help": "圓周率的雙倍", "sockets": [ { - "name": "tau" + "name": "τ" } + ], + "keywords": [ + "pi", + "circle", + "circumference", + "圓周率" ] }, { @@ -650,10 +903,10 @@ "id": "076E0F96-52EA-466E-84BC-FE41A2399510", "type": "number", "script": "({{1}} & {{2}})", - "help": "bitwise AND of the two operands - useful to select only specific bits", + "help": "兩個數字的位元AND", "sockets": [ { - "name": "bitwise", + "name": "位元", "type": "number", "value": "0" }, @@ -662,6 +915,11 @@ "type": "number", "value": "0" } + ], + "keywords": [ + "bitwise", + "and", + "位元" ] }, { @@ -669,10 +927,10 @@ "id": "74C039B2-988F-4571-8AEB-C79F772D8F2D", "type": "number", "script": "({{1}} | {{2}})", - "help": "bitwise OR of the two operands - useful to set specific bits", + "help": "兩個數字的位元OR", "sockets": [ { - "name": "bitwise", + "name": "位元", "type": "number", "value": "0" }, @@ -681,6 +939,11 @@ "type": "number", "value": "0" } + ], + "keywords": [ + "bitwise", + "or", + "位元" ] }, { @@ -688,10 +951,10 @@ "id": "DA40D6D3-0052-4187-92EB-2F4C0A64C39F", "type": "number", "script": "({{1}} ^ {{2}})", - "help": "bitwise XOR of the two operands - useful to toggle specific bits", + "help": "兩個數字的位元XOR", "sockets": [ { - "name": "bitwise", + "name": "位元", "type": "number", "value": "0" }, @@ -700,6 +963,11 @@ "type": "number", "value": "0" } + ], + "keywords": [ + "bitwise", + "xor", + "位元" ] }, { @@ -707,10 +975,10 @@ "id": "D58C0616-1CE4-4588-90C5-B57E1221E831", "type": "number", "script": "({{1}} &~ {{2}})", - "help": "bitwise NAND of the two operands - useful to unset specific bits", + "help": "兩個數字的位元NAND", "sockets": [ { - "name": "bitwise", + "name": "位元", "type": "number", "value": "0" }, @@ -719,6 +987,11 @@ "type": "number", "value": "0" } + ], + "keywords": [ + "bitwise", + "nand", + "位元" ] }, { @@ -726,21 +999,27 @@ "id": "43109945-DA0A-4B16-84A5-17727C0EF994", "type": "number", "script": "({{1}} << Math.floor({{2}}))", - "help": "left bit shift", + "help": "由指定位元數向左移動的數字", "sockets": [ { - "name": "bit shift", + "name": "將", "type": "number", "value": "0" }, { - "name": "left by", + "name": "向左移動", "type": "number", "value": "0" }, { - "name": "bits" + "name": "個位元" } + ], + "keywords": [ + "bitwise", + "shift", + "位元", + "移動" ] }, { @@ -748,21 +1027,27 @@ "id": "4EE8184B-52A8-40E8-ACC6-C7D21BA90742", "type": "number", "script": "({{1}} >> Math.floor({{2}}))", - "help": "right bit shift", + "help": "由指定位元數向右移動的數字", "sockets": [ { - "name": "bit shift", + "name": "將", "type": "number", "value": "0" }, { - "name": "right by", + "name": "向右移動", "type": "number", "value": "0" }, { - "name": "bits" + "name": "個位元" } + ], + "keywords": [ + "bitwise", + "shift", + "位元", + "移動" ] } ] From 5ba34dd0d8b46a9a724c76ff2f7785b79ee783df Mon Sep 17 00:00:00 2001 From: Wai Ho Leung Date: Thu, 3 Apr 2014 23:57:37 -0700 Subject: [PATCH 07/16] Added Chinese localization for point.json --- .../javascript/localizations/zh/point.json | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/languages/javascript/localizations/zh/point.json b/languages/javascript/localizations/zh/point.json index 4516d32a..21382e89 100644 --- a/languages/javascript/localizations/zh/point.json +++ b/languages/javascript/localizations/zh/point.json @@ -1,17 +1,17 @@ { "sectionkey": "points", - "name": "Points", - "help": "Point blocks represent and manipulate x,y coordinates.", + "name": "座標", + "help": "座標(x,y)是指平面上的點的位置。", "blocks": [ { "blocktype": "expression", "id": "71eb3271-6dc0-4a82-81cc-4c50d8acb9e7", "script": "{x: {{1}}, y: {{2}} }", "type": "point", - "help": "create a new point", + "help": "建立一個新座標", "sockets": [ { - "name": "point at x", + "name": "座標 x", "type": "number", "value": 0 }, @@ -27,11 +27,12 @@ "id": "efe5e679-8336-4e5a-ade0-4bd930826096", "type": "point", "script": "{x: {{1}}[0], y: {{1}}[1]}", - "help": "convert array to point", + "help": "將矩陣轉變成座標", "sockets": [ { - "name": "point from array", - "type": "array" + "name": "將矩陣", + "type": "array", + "suffix": "轉變成座標" } ] }, @@ -40,10 +41,10 @@ "id": "29803c49-5bd5-4473-bff7-b3cf66ab9711", "type": "point", "script": "{x: randint(0, global.stage_width), y: randint(0, global.stage_height)}", - "help": "returns a point at a random location on the stage", + "help": "傳回一個隨機座標", "sockets": [ { - "name": "random point" + "name": "隨機座標" } ] }, @@ -52,12 +53,12 @@ "id": "36f0eb56-9370-402d-83ef-99201a62c732", "script": "{{1}}.x", "type": "number", - "help": "get the x value of a point", + "help": "座標的X位置", "sockets": [ { - "name": "point", + "name": "座標", "type": "point", - "suffix": "x" + "suffix": "的X位置" } ] }, @@ -66,12 +67,12 @@ "id": "90b42cf3-185d-4556-b7e8-d9682c187425", "script": "{{1}}.y", "type": "number", - "help": "get the y value of a point", + "help": "座標的Y位置", "sockets": [ { - "name": "point", + "name": "座標", "type": "point", - "suffix": "y" + "suffix": "的Y位置" } ] }, @@ -80,12 +81,12 @@ "id": "743cba63-11d4-4a84-a3b6-a98480bdd731", "script": "[{{1}}.x, {{1}}.y]", "type": "array", - "help": "convert a point to an array", + "help": "將座標轉變成矩陣", "sockets": [ { - "name": "point", + "name": "將座標", "type": "point", - "suffix": "as array" + "suffix": "轉變成矩陣" } ] } From f8dd722c80ccb213f1a5a5a10efe2ac07ca1a4df Mon Sep 17 00:00:00 2001 From: Wai Ho Leung Date: Fri, 4 Apr 2014 00:16:33 -0700 Subject: [PATCH 08/16] Added Chinese (zh-tw) localization for sound.json --- .../javascript/localizations/zh/sound.json | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/languages/javascript/localizations/zh/sound.json b/languages/javascript/localizations/zh/sound.json index fffe9638..3875941c 100644 --- a/languages/javascript/localizations/zh/sound.json +++ b/languages/javascript/localizations/zh/sound.json @@ -1,7 +1,7 @@ { "sectionkey": "sound", - "name": "Sound", - "help": "Sound blocks can load and play sound files (wav, mp3, ogg) if those files are supported by your browser.", + "name": "聲音", + "help": "若瀏覽器支援,能夠播放 wav, mp3, ogg 聲音檔案。", "blocks": [ { "blocktype": "step", @@ -9,7 +9,7 @@ "script": "global.preloadAudio('##', {{1}});", "sockets": [ { - "name": "load audio## from url", + "name": "從網頁讀取聲音資料##", "type": "string" } ], @@ -18,14 +18,14 @@ "blocktype": "asset", "sockets": [ { - "name": "audio ##" + "name": "聲音 ##" } ], "script": "global.audio[\"##\"]", "type": "sound" } ], - "help": "Load a sound for playback" + "help": "讀取聲音資料" }, { "blocktype": "step", @@ -33,11 +33,11 @@ "script": "{{1}}.currentTime=0;{{1}}.play();", "sockets": [ { - "name": "play sound", + "name": "播放聲音", "type": "sound" } ], - "help": "play a sound" + "help": "播放聲音" }, { "blocktype": "step", @@ -45,7 +45,7 @@ "script": "{{1}}.pause();", "sockets": [ { - "name": "pause sound", + "name": "暫停聲音", "type": "sound" } ] @@ -56,11 +56,11 @@ "script": "{{1}}.loop={{2}};", "sockets": [ { - "name": "set sound", + "name": "將聲音", "type": "sound" }, { - "name": "looping to", + "name": "循環設置為", "type": "boolean" } From c92709c90eb51e741fa200f13a40e3c4852538f5 Mon Sep 17 00:00:00 2001 From: Wai Ho Leung Date: Mon, 28 Apr 2014 13:11:07 -0700 Subject: [PATCH 09/16] Added Chinese (zh-tw) localization for Date --- .../javascript/localizations/zh/date.json | 56 ++++++++++--------- languages/javascript/runtime.html | 2 + languages/processingjs/runtime.html | 1 + languages/scheme/runtime.html | 1 + 4 files changed, 35 insertions(+), 25 deletions(-) diff --git a/languages/javascript/localizations/zh/date.json b/languages/javascript/localizations/zh/date.json index ff50c3f7..041517eb 100644 --- a/languages/javascript/localizations/zh/date.json +++ b/languages/javascript/localizations/zh/date.json @@ -1,16 +1,16 @@ { "sectionkey": "date", - "name": "Date", - "help": "Date blocks are used to work with dates and times", + "name": "日時", + "help": "日時是用來操作日期和時間。", "blocks": [ { "blocktype": "step", "id": "31007d66-3b78-43d8-a295-89bc81cb62d9", "script": "local.date## = new Date();", - "help": "create a date block", + "help": "建立一個新的日期與時間", "sockets": [ { - "name": "date##" + "name": "日時##" } ], "locals": [ @@ -18,10 +18,10 @@ "blocktype": "expression", "type": "date", "script": "local.date##", - "help": "current location", + "help": "現在地區的日時", "sockets": [ { - "name": "date##" + "name": "日時##" } ] } @@ -32,12 +32,13 @@ "id": "795bacf1-3abd-4e04-b181-baab9bcf6721", "type": "number", "script": "{{1}}.getFullYear()", - "help": "get the year (four digits)", + "help": "傳回日期的年份 (四位數)", "sockets": [ { - "name": "get the year", + "name": "", "type": "date", - "block": "" + "block": "", + "suffix": "的年份" } ] }, @@ -46,12 +47,13 @@ "id": "1a14fa64-bf53-4584-95fe-9d6bf0cc823a", "type": "number", "script": "({{1}}.getMonth() + 1)", - "help": "get the month (from 1-12)", + "help": "傳回日時的月份 (1-12)", "sockets": [ { - "name": "get the month", + "name": "", "type": "date", - "block": "" + "block": "", + "suffix": "的月份" } ] }, @@ -60,12 +62,13 @@ "id": "c2aa55be-42a0-4831-b554-b35680f81dfd", "type": "number", "script": "{{1}}.getDate()", - "help": "get the day of the month (from 1-31)", + "help": "傳回日時的天數 (1-31)", "sockets": [ { - "name": "get the date", + "name": "", "type": "date", - "block": "" + "block": "", + "suffix": "的天數" } ] }, @@ -74,12 +77,13 @@ "id": "f5958007-0839-4491-a176-e2599169cb16", "type": "number", "script": "{{1}}.getHours()", - "help": "get the hour (from 0-23)", + "help": "傳回日時的小時 (0-23)", "sockets": [ { - "name": "get the hour", + "name": "", "type": "date", - "block": "" + "block": "", + "suffix": "的小時" } ] }, @@ -88,12 +92,13 @@ "id": "00128be4-a08d-44cc-99a1-47eaaff6ecf4", "type": "number", "script": "{{1}}.getMinutes()", - "help": "get the minutes (from 0-59)", + "help": "傳回日時的分鍾 (0-59)", "sockets": [ { - "name": "get the minutes", + "name": "", "type": "date", - "block": "" + "block": "", + "suffix": "的分鐘" } ] }, @@ -102,14 +107,15 @@ "id": "f26108f4-3427-4489-abd3-af9e26315f2f", "type": "number", "script": "{{1}}.getSeconds()", - "help": "get the seconds (from 0-59)", + "help": "傳回日時的秒鐘 (0-59)", "sockets": [ { - "name": "get the seconds", + "name": "", "type": "date", - "block": "" + "block": "", + "suffix": "的秒鐘" } ] } ] -} \ No newline at end of file +} diff --git a/languages/javascript/runtime.html b/languages/javascript/runtime.html index d4bb2be6..37628d79 100644 --- a/languages/javascript/runtime.html +++ b/languages/javascript/runtime.html @@ -6,6 +6,7 @@ + > @@ -38,6 +39,7 @@ +