diff --git a/extensions/JeremyGamer13/tween.js b/extensions/JeremyGamer13/tween.js index 224706d2c3..ea2ed20bec 100644 --- a/extensions/JeremyGamer13/tween.js +++ b/extensions/JeremyGamer13/tween.js @@ -256,11 +256,13 @@ getInfo() { return { id: "jeremygamerTweening", - name: "Tweening", + name: Scratch.translate("Tweening"), blocks: [ { opcode: "tweenValue", - text: "[MODE] ease [DIRECTION] [START] to [END] by [AMOUNT]%", + text: Scratch.translate( + "[MODE] ease [DIRECTION] [START] to [END] by [AMOUNT]%" + ), disableMonitor: true, blockType: BlockType.REPORTER, arguments: { @@ -288,7 +290,9 @@ }, { opcode: "tweenVariable", - text: "tween variable [VAR] to [VALUE] over [SEC] seconds using [MODE] ease [DIRECTION]", + text: Scratch.translate( + "tween variable [VAR] to [VALUE] over [SEC] seconds using [MODE] ease [DIRECTION]" + ), blockType: BlockType.COMMAND, arguments: { VAR: { @@ -315,7 +319,9 @@ }, { opcode: "tweenXY", - text: "tween to x: [X] y: [Y] over [SEC] seconds using [MODE] ease [DIRECTION]", + text: Scratch.translate( + "tween to x: [X] y: [Y] over [SEC] seconds using [MODE] ease [DIRECTION]" + ), blockType: BlockType.COMMAND, arguments: { PROPERTY: { @@ -346,7 +352,9 @@ }, { opcode: "tweenProperty", - text: "tween [PROPERTY] to [VALUE] over [SEC] seconds using [MODE] ease [DIRECTION]", + text: Scratch.translate( + "tween [PROPERTY] to [VALUE] over [SEC] seconds using [MODE] ease [DIRECTION]" + ), blockType: BlockType.COMMAND, arguments: { PROPERTY: { @@ -375,11 +383,69 @@ menus: { modes: { acceptReporters: true, - items: Object.keys(EasingMethods), + items: [ + { + text: Scratch.translate("linear"), + value: "linear", + }, + { + text: Scratch.translate("sine"), + value: "sine", + }, + { + text: Scratch.translate("quad"), + value: "quad", + }, + { + text: Scratch.translate("cubic"), + value: "cubic", + }, + { + text: Scratch.translate("quart"), + value: "quart", + }, + { + text: Scratch.translate("quint"), + value: "quint", + }, + { + text: Scratch.translate("expo"), + value: "expo", + }, + { + text: Scratch.translate("circ"), + value: "circ", + }, + { + text: Scratch.translate("back"), + value: "back", + }, + { + text: Scratch.translate("elastic"), + value: "elastic", + }, + { + text: Scratch.translate("bounce"), + value: "bounce", + }, + ], }, direction: { acceptReporters: true, - items: ["in", "out", "in out"], + items: [ + { + text: Scratch.translate("in"), + value: "in", + }, + { + text: Scratch.translate("out"), + value: "out", + }, + { + text: Scratch.translate("in out"), + value: "in out", + }, + ], }, vars: { acceptReporters: false, // for Scratch parity @@ -387,7 +453,24 @@ }, properties: { acceptReporters: true, - items: ["x position", "y position", "direction", "size"], + items: [ + { + text: Scratch.translate("x position"), + value: "x position", + }, + { + text: Scratch.translate("y position"), + value: "y position", + }, + { + text: Scratch.translate("direction"), + value: "direction", + }, + { + text: Scratch.translate("size"), + value: "size", + }, + ], }, }, }; diff --git a/extensions/Lily/ListTools.js b/extensions/Lily/ListTools.js index 4eb3e76b3f..d66836de5b 100644 --- a/extensions/Lily/ListTools.js +++ b/extensions/Lily/ListTools.js @@ -28,7 +28,7 @@ getInfo() { return { id: "lmsData", - name: "List Tools", + name: Scratch.translate("List Tools"), color1: "#ff661a", color2: "#f2590d", color3: "#e64d00", @@ -36,7 +36,7 @@ { opcode: "deleteItems", blockType: Scratch.BlockType.COMMAND, - text: "delete items [NUM1] to [NUM2] of [LIST]", + text: Scratch.translate("delete items [NUM1] to [NUM2] of [LIST]"), arguments: { NUM1: { type: Scratch.ArgumentType.NUMBER, @@ -55,7 +55,7 @@ { opcode: "deleteAllOfItem", blockType: Scratch.BlockType.COMMAND, - text: "delete all [ITEM] in [LIST]", + text: Scratch.translate("delete all [ITEM] in [LIST]"), arguments: { ITEM: { type: Scratch.ArgumentType.STRING, @@ -70,7 +70,9 @@ { opcode: "replaceAllOfItem", blockType: Scratch.BlockType.COMMAND, - text: "replace all [ITEM1] with [ITEM2] in [LIST]", + text: Scratch.translate( + "replace all [ITEM1] with [ITEM2] in [LIST]" + ), arguments: { ITEM1: { type: Scratch.ArgumentType.STRING, @@ -89,7 +91,7 @@ { opcode: "repeatList", blockType: Scratch.BlockType.COMMAND, - text: "repeat [LIST1] [NUM] times in [LIST2]", + text: Scratch.translate("repeat [LIST1] [NUM] times in [LIST2]"), arguments: { LIST1: { type: Scratch.ArgumentType.STRING, @@ -111,7 +113,7 @@ { opcode: "getListJoin", blockType: Scratch.BlockType.REPORTER, - text: "get list [LIST] joined by [STRING]", + text: Scratch.translate("get list [LIST] joined by [STRING]"), disableMonitor: true, arguments: { LIST: { @@ -127,7 +129,7 @@ { opcode: "timesItemAppears", blockType: Scratch.BlockType.REPORTER, - text: "# of times [ITEM] appears in [LIST]", + text: Scratch.translate("# of times [ITEM] appears in [LIST]"), disableMonitor: true, arguments: { ITEM: { @@ -143,7 +145,7 @@ { opcode: "itemIndex", blockType: Scratch.BlockType.REPORTER, - text: "index # [INDEX] of item [ITEM] in [LIST]", + text: Scratch.translate("index # [INDEX] of item [ITEM] in [LIST]"), disableMonitor: true, arguments: { INDEX: { @@ -166,7 +168,7 @@ { opcode: "listIsEmpty", blockType: Scratch.BlockType.BOOLEAN, - text: "[LIST] is empty?", + text: Scratch.translate("[LIST] is empty?"), disableMonitor: true, arguments: { LIST: { @@ -178,7 +180,7 @@ { opcode: "itemNumExists", blockType: Scratch.BlockType.BOOLEAN, - text: "item [NUM] exists in [LIST]?", + text: Scratch.translate("item [NUM] exists in [LIST]?"), disableMonitor: true, arguments: { NUM: { @@ -194,7 +196,7 @@ { opcode: "orderIs", blockType: Scratch.BlockType.BOOLEAN, - text: "order of [LIST] is [ORDER]?", + text: Scratch.translate("order of [LIST] is [ORDER]?"), disableMonitor: true, arguments: { LIST: { @@ -213,7 +215,7 @@ { opcode: "orderList", blockType: Scratch.BlockType.COMMAND, - text: "set order of [LIST] to [ORDER]", + text: Scratch.translate("set order of [LIST] to [ORDER]"), disableMonitor: true, arguments: { LIST: { @@ -230,7 +232,7 @@ { opcode: "setListToList", blockType: Scratch.BlockType.COMMAND, - text: "set items of [LIST1] to [LIST2]", + text: Scratch.translate("set items of [LIST1] to [LIST2]"), arguments: { LIST1: { type: Scratch.ArgumentType.STRING, @@ -245,7 +247,7 @@ { opcode: "joinLists", blockType: Scratch.BlockType.COMMAND, - text: "concatenate [LIST1] onto [LIST2]", + text: Scratch.translate("concatenate [LIST1] onto [LIST2]"), arguments: { LIST1: { type: Scratch.ArgumentType.STRING, @@ -263,7 +265,7 @@ { opcode: "forEachListItem", blockType: Scratch.BlockType.LOOP, - text: "for each item value [VAR] in [LIST]", + text: Scratch.translate("for each item value [VAR] in [LIST]"), hideFromPalette: !runtime.extensionManager.isExtensionLoaded("lmsTempVars2"), arguments: { @@ -280,7 +282,7 @@ { opcode: "forEachListItemNum", blockType: Scratch.BlockType.LOOP, - text: "for each item # [VAR] in [LIST]", + text: Scratch.translate("for each item # [VAR] in [LIST]"), hideFromPalette: !runtime.extensionManager.isExtensionLoaded("lmsTempVars2"), arguments: { @@ -300,7 +302,7 @@ { opcode: "setListArray", blockType: Scratch.BlockType.COMMAND, - text: "set [LIST] to array [ARRAY]", + text: Scratch.translate("set [LIST] to array [ARRAY]"), disableMonitor: true, arguments: { LIST: { @@ -316,7 +318,7 @@ { opcode: "getListArray", blockType: Scratch.BlockType.REPORTER, - text: "[LIST] as array", + text: Scratch.translate("[LIST] as array"), disableMonitor: true, arguments: { LIST: { @@ -348,19 +350,19 @@ acceptReporters: false, items: [ { - text: "reversed", + text: Scratch.translate("reversed"), value: "reversed", }, { - text: "ascending", + text: Scratch.translate("ascending"), value: "ascending", }, { - text: "descending", + text: Scratch.translate("descending"), value: "descending", }, { - text: "randomised", + text: Scratch.translate("randomized"), value: "randomised", }, ], @@ -369,11 +371,11 @@ acceptReporters: false, items: [ { - text: "ascending", + text: Scratch.translate("ascending"), value: "ascending", }, { - text: "descending", + text: Scratch.translate("descending"), value: "descending", }, ], @@ -382,15 +384,15 @@ acceptReporters: false, items: [ { - text: "first", + text: Scratch.translate("first"), value: "first", }, { - text: "last", + text: Scratch.translate("last"), value: "last", }, { - text: "random", + text: Scratch.translate("random"), value: "random", }, ], diff --git a/extensions/Lily/LooksPlus.js b/extensions/Lily/LooksPlus.js index 7061612c6b..291c008d8b 100644 --- a/extensions/Lily/LooksPlus.js +++ b/extensions/Lily/LooksPlus.js @@ -37,7 +37,7 @@ getInfo() { return { id: "lmsLooksPlus", - name: "Looks+", + name: Scratch.translate("Looks+"), color1: "#9966FF", color2: "#855CD6", color3: "#774DCB", @@ -46,7 +46,7 @@ { opcode: "showSprite", blockType: Scratch.BlockType.COMMAND, - text: "show [TARGET]", + text: Scratch.translate("show [TARGET]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -58,7 +58,7 @@ { opcode: "hideSprite", blockType: Scratch.BlockType.COMMAND, - text: "hide [TARGET]", + text: Scratch.translate("hide [TARGET]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -70,7 +70,7 @@ { opcode: "spriteVisible", blockType: Scratch.BlockType.BOOLEAN, - text: "[TARGET] visible?", + text: Scratch.translate("[TARGET] visible?"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -85,7 +85,7 @@ { opcode: "setLayerTo", blockType: Scratch.BlockType.COMMAND, - text: "set layer # of [TARGET] to [LAYER]", + text: Scratch.translate("set layer # of [TARGET] to [LAYER]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -101,7 +101,7 @@ { opcode: "spriteLayerNumber", blockType: Scratch.BlockType.REPORTER, - text: "layer # of [TARGET]", + text: Scratch.translate("layer # of [TARGET]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -113,7 +113,7 @@ { opcode: "effectValue", blockType: Scratch.BlockType.REPORTER, - text: "[EFFECT] effect of [TARGET]", + text: Scratch.translate("[EFFECT] effect of [TARGET]"), arguments: { EFFECT: { type: Scratch.ArgumentType.STRING, @@ -133,7 +133,7 @@ { opcode: "targetCostumeNumber", blockType: Scratch.BlockType.REPORTER, - text: "# of costumes in [TARGET]", + text: Scratch.translate("# of costumes in [TARGET]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -145,7 +145,7 @@ { opcode: "costumeAttribute", blockType: Scratch.BlockType.REPORTER, - text: "[ATTRIBUTE] of [COSTUME]", + text: Scratch.translate("[ATTRIBUTE] of [COSTUME]"), arguments: { ATTRIBUTE: { type: Scratch.ArgumentType.STRING, @@ -163,7 +163,7 @@ { opcode: "snapshotStage", blockType: Scratch.BlockType.REPORTER, - text: "snapshot stage", + text: Scratch.translate("snapshot stage"), disableMonitor: true, extensions: ["colours_looks"], }, @@ -173,7 +173,7 @@ { opcode: "replaceCostumeContent", blockType: Scratch.BlockType.COMMAND, - text: "set [TYPE] for [COSTUME] to [CONTENT]", + text: Scratch.translate("set [TYPE] for [COSTUME] to [CONTENT]"), arguments: { TYPE: { type: Scratch.ArgumentType.STRING, @@ -193,7 +193,7 @@ { opcode: "restoreCostumeContent", blockType: Scratch.BlockType.COMMAND, - text: "restore content for [COSTUME]", + text: Scratch.translate("restore content for [COSTUME]"), arguments: { COSTUME: { type: Scratch.ArgumentType.COSTUME, @@ -204,7 +204,9 @@ { opcode: "costumeContent", blockType: Scratch.BlockType.REPORTER, - text: "[CONTENT] of costume # [COSTUME] of [TARGET]", + text: Scratch.translate( + "[CONTENT] of costume # [COSTUME] of [TARGET]" + ), arguments: { CONTENT: { type: Scratch.ArgumentType.STRING, @@ -228,7 +230,7 @@ { opcode: "replaceColors", blockType: Scratch.BlockType.REPORTER, - text: "replace [COLOR1] with [COLOR2] in [SVG]", + text: Scratch.translate("replace [COLOR1] with [COLOR2] in [SVG]"), arguments: { COLOR1: { type: Scratch.ArgumentType.COLOR, @@ -248,7 +250,7 @@ { opcode: "colorHex", blockType: Scratch.BlockType.REPORTER, - text: "hex of [COLOR]", + text: Scratch.translate("hex of [COLOR]"), arguments: { COLOR: { type: Scratch.ArgumentType.COLOR, @@ -264,31 +266,31 @@ acceptReporters: false, items: [ { - text: "color", + text: Scratch.translate("color"), value: "color", }, { - text: "fisheye", + text: Scratch.translate("fisheye"), value: "fisheye", }, { - text: "whirl", + text: Scratch.translate("whirl"), value: "whirl", }, { - text: "pixelate", + text: Scratch.translate("pixelate"), value: "pixelate", }, { - text: "mosaic", + text: Scratch.translate("mosaic"), value: "mosaic", }, { - text: "brightness", + text: Scratch.translate("brightness"), value: "brightness", }, { - text: "ghost", + text: Scratch.translate("ghost"), value: "ghost", }, ], @@ -297,23 +299,23 @@ acceptReporters: false, items: [ { - text: "width", + text: Scratch.translate("width"), value: "width", }, { - text: "height", + text: Scratch.translate("height"), value: "height", }, { - text: "format", + text: Scratch.translate("format"), value: "format", }, { - text: "rotation center x", + text: Scratch.translate("rotation center x"), value: "rotationCenterX", }, { - text: "rotation center y", + text: Scratch.translate("rotation center y"), value: "rotationCenterY", }, ], @@ -322,11 +324,11 @@ acceptReporters: false, items: [ { - text: "content", + text: Scratch.translate("content"), value: "content", }, { - text: "dataURI", + text: Scratch.translate("dataURI"), value: "dataURI", }, ], diff --git a/extensions/Lily/MoreEvents.js b/extensions/Lily/MoreEvents.js index 8c768fd78c..ff531c1655 100644 --- a/extensions/Lily/MoreEvents.js +++ b/extensions/Lily/MoreEvents.js @@ -210,7 +210,7 @@ getInfo() { return { id: "lmsMoreEvents", - name: "More Events", + name: Scratch.translate("More Events"), color1: "#FFBF00", color2: "#E6AC00", color3: "#CC9900", @@ -218,7 +218,7 @@ { opcode: "whenStopClicked", blockType: Scratch.BlockType.EVENT, - text: "when [STOP] clicked", + text: Scratch.translate("when [STOP] clicked"), isEdgeActivated: false, arguments: { STOP: { @@ -231,7 +231,7 @@ { opcode: "forever", blockType: Scratch.BlockType.EVENT, - text: "forever", + text: Scratch.translate("forever"), isEdgeActivated: false, extensions: ["colours_event"], }, @@ -241,7 +241,7 @@ { opcode: "whenTrueFalse", blockType: Scratch.BlockType.HAT, - text: "when [CONDITION] becomes [STATE]", + text: Scratch.translate("when [CONDITION] becomes [STATE]"), isEdgeActivated: true, arguments: { CONDITION: { @@ -257,7 +257,7 @@ { opcode: "whileTrueFalse", blockType: Scratch.BlockType.HAT, - text: "while [CONDITION] is [STATE]", + text: Scratch.translate("while [CONDITION] is [STATE]"), isEdgeActivated: false, arguments: { CONDITION: { @@ -276,7 +276,7 @@ { opcode: "whenValueChanged", blockType: Scratch.BlockType.HAT, - text: "when [INPUT] is changed", + text: Scratch.translate("when [INPUT] is changed"), isEdgeActivated: false, arguments: { INPUT: { @@ -291,7 +291,7 @@ { opcode: "everyDuration", blockType: Scratch.BlockType.HAT, - text: "every [DURATION] frames", + text: Scratch.translate("every [DURATION] frames"), isEdgeActivated: false, arguments: { DURATION: { @@ -307,7 +307,7 @@ { opcode: "whenKeyAction", blockType: Scratch.BlockType.HAT, - text: "when [KEY_OPTION] key [ACTION]", + text: Scratch.translate("when [KEY_OPTION] key [ACTION]"), isEdgeActivated: true, arguments: { KEY_OPTION: { @@ -325,7 +325,7 @@ { opcode: "whileKeyPressed", blockType: Scratch.BlockType.HAT, - text: "while [KEY_OPTION] key pressed", + text: Scratch.translate("while [KEY_OPTION] key pressed"), isEdgeActivated: false, arguments: { KEY_OPTION: { @@ -342,7 +342,7 @@ { opcode: "broadcastToTarget", blockType: Scratch.BlockType.COMMAND, - text: "broadcast [BROADCAST_OPTION] to [TARGET]", + text: Scratch.translate("broadcast [BROADCAST_OPTION] to [TARGET]"), arguments: { BROADCAST_OPTION: { type: null, @@ -358,7 +358,9 @@ { opcode: "broadcastToTargetAndWait", blockType: Scratch.BlockType.COMMAND, - text: "broadcast [BROADCAST_OPTION] to [TARGET] and wait", + text: Scratch.translate( + "broadcast [BROADCAST_OPTION] to [TARGET] and wait" + ), arguments: { BROADCAST_OPTION: { type: null, @@ -377,7 +379,9 @@ { opcode: "broadcastData", blockType: Scratch.BlockType.COMMAND, - text: "broadcast [BROADCAST_OPTION] with data [DATA]", + text: Scratch.translate( + "broadcast [BROADCAST_OPTION] with data [DATA]" + ), arguments: { BROADCAST_OPTION: { type: null, @@ -392,7 +396,9 @@ { opcode: "broadcastDataAndWait", blockType: Scratch.BlockType.COMMAND, - text: "broadcast [BROADCAST_OPTION] with data [DATA] and wait", + text: Scratch.translate( + "broadcast [BROADCAST_OPTION] with data [DATA] and wait" + ), arguments: { BROADCAST_OPTION: { type: null, @@ -411,7 +417,7 @@ { opcode: "receivedData", blockType: Scratch.BlockType.REPORTER, - text: "received data", + text: Scratch.translate("received data"), disableMonitor: true, allowDropAnywhere: true, extensions: ["colours_event"], @@ -422,7 +428,9 @@ { opcode: "broadcastDataToTarget", blockType: Scratch.BlockType.COMMAND, - text: "broadcast [BROADCAST_OPTION] to [TARGET] with data [DATA]", + text: Scratch.translate( + "broadcast [BROADCAST_OPTION] to [TARGET] with data [DATA]" + ), func: "broadcastToTarget", arguments: { BROADCAST_OPTION: { @@ -442,7 +450,9 @@ { opcode: "broadcastDataToTargetAndWait", blockType: Scratch.BlockType.COMMAND, - text: "broadcast [BROADCAST_OPTION] to [TARGET] with data [DATA] and wait", + text: Scratch.translate( + "broadcast [BROADCAST_OPTION] to [TARGET] with data [DATA] and wait" + ), func: "broadcastToTargetAndWait", arguments: { BROADCAST_OPTION: { @@ -467,7 +477,7 @@ { blockType: Scratch.BlockType.EVENT, opcode: "beforeSave", - text: "before project saves", + text: Scratch.translate("before project saves"), shouldRestartExistingThreads: true, isEdgeActivated: false, extensions: ["colours_event"], @@ -475,7 +485,7 @@ { blockType: Scratch.BlockType.EVENT, opcode: "afterSave", - text: "after project saves", + text: Scratch.translate("after project saves"), shouldRestartExistingThreads: true, isEdgeActivated: false, extensions: ["colours_event"], @@ -494,15 +504,42 @@ // Attributes have acceptReporters: false action: { acceptReporters: false, - items: ["hit", "released"], + items: [ + { + text: Scratch.translate("hit"), + value: "hit", + }, + { + text: Scratch.translate("released"), + value: "released", + }, + ], }, boolean: { acceptReporters: false, - items: ["true", "false"], + items: [ + { + text: Scratch.translate("true"), + value: "true", + }, + { + text: Scratch.translate("false"), + value: "false", + }, + ], }, state: { acceptReporters: false, - items: ["enabled", "disabled"], + items: [ + { + text: Scratch.translate("enabled"), + value: "enabled", + }, + { + text: Scratch.translate("disabled"), + value: "disabled", + }, + ], }, }, }; diff --git a/extensions/Lily/MoreTimers.js b/extensions/Lily/MoreTimers.js index e57e819fe4..cb0d071737 100644 --- a/extensions/Lily/MoreTimers.js +++ b/extensions/Lily/MoreTimers.js @@ -40,7 +40,7 @@ getInfo() { return { id: "lmsTimers", - name: "More Timers", + name: Scratch.translate("More Timers"), color1: "#5cb1d6", color2: "#428faf", color3: "#3281a3", @@ -49,7 +49,7 @@ opcode: "whenTimerOp", blockType: Scratch.BlockType.HAT, extensions: ["colours_sensing"], - text: "when timer [TIMER] [OP] [NUM]", + text: Scratch.translate("when timer [TIMER] [OP] [NUM]"), arguments: { TIMER: { type: Scratch.ArgumentType.STRING, @@ -72,7 +72,7 @@ opcode: "startResetTimer", blockType: Scratch.BlockType.COMMAND, extensions: ["colours_sensing"], - text: "start/reset timer [TIMER]", + text: Scratch.translate("start/reset timer [TIMER]"), arguments: { TIMER: { type: Scratch.ArgumentType.STRING, @@ -84,7 +84,7 @@ opcode: "valueOfTimer", blockType: Scratch.BlockType.REPORTER, extensions: ["colours_sensing"], - text: "timer [TIMER]", + text: Scratch.translate("timer [TIMER]"), arguments: { TIMER: { type: Scratch.ArgumentType.STRING, @@ -99,7 +99,7 @@ opcode: "pauseTimer", blockType: Scratch.BlockType.COMMAND, extensions: ["colours_sensing"], - text: "pause timer [TIMER]", + text: Scratch.translate("pause timer [TIMER]"), arguments: { TIMER: { type: Scratch.ArgumentType.STRING, @@ -111,7 +111,7 @@ opcode: "resumeTimer", blockType: Scratch.BlockType.COMMAND, extensions: ["colours_sensing"], - text: "resume timer [TIMER]", + text: Scratch.translate("resume timer [TIMER]"), arguments: { TIMER: { type: Scratch.ArgumentType.STRING, @@ -126,7 +126,7 @@ opcode: "setTimer", blockType: Scratch.BlockType.COMMAND, extensions: ["colours_sensing"], - text: "set timer [TIMER] to [NUM]", + text: Scratch.translate("set timer [TIMER] to [NUM]"), arguments: { TIMER: { type: Scratch.ArgumentType.STRING, @@ -142,7 +142,7 @@ opcode: "changeTimer", blockType: Scratch.BlockType.COMMAND, extensions: ["colours_sensing"], - text: "change timer [TIMER] by [NUM]", + text: Scratch.translate("change timer [TIMER] by [NUM]"), arguments: { TIMER: { type: Scratch.ArgumentType.STRING, @@ -161,7 +161,7 @@ opcode: "removeTimer", blockType: Scratch.BlockType.COMMAND, extensions: ["colours_sensing"], - text: "remove timer [TIMER]", + text: Scratch.translate("remove timer [TIMER]"), arguments: { TIMER: { type: Scratch.ArgumentType.STRING, @@ -173,13 +173,13 @@ opcode: "removeTimers", blockType: Scratch.BlockType.COMMAND, extensions: ["colours_sensing"], - text: "remove all timers", + text: Scratch.translate("remove all timers"), }, { opcode: "timerExists", blockType: Scratch.BlockType.BOOLEAN, extensions: ["colours_sensing"], - text: "timer [TIMER] exists?", + text: Scratch.translate("timer [TIMER] exists?"), arguments: { TIMER: { type: Scratch.ArgumentType.STRING, @@ -191,7 +191,7 @@ opcode: "listExistingTimers", blockType: Scratch.BlockType.REPORTER, extensions: ["colours_sensing"], - text: "list existing timers", + text: Scratch.translate("list existing timers"), disableMonitor: false, }, ], diff --git a/extensions/Lily/Skins.js b/extensions/Lily/Skins.js index 9eba2017e1..d1b6431241 100644 --- a/extensions/Lily/Skins.js +++ b/extensions/Lily/Skins.js @@ -56,7 +56,7 @@ getInfo() { return { id: "lmsSkins", - name: "Skins", + name: Scratch.translate("Skins"), color1: "#6b56ff", color2: "#604de6", color3: "#5645cc", @@ -65,7 +65,7 @@ { opcode: "registerSVGSkin", blockType: Scratch.BlockType.COMMAND, - text: "create SVG skin [SVG] as [NAME]", + text: Scratch.translate("create SVG skin [SVG] as [NAME]"), arguments: { SVG: { type: Scratch.ArgumentType.STRING, @@ -83,7 +83,7 @@ { opcode: "registerCostumeSkin", blockType: Scratch.BlockType.COMMAND, - text: "load skin from [COSTUME] as [NAME]", + text: Scratch.translate("load skin from [COSTUME] as [NAME]"), arguments: { COSTUME: { type: Scratch.ArgumentType.COSTUME, @@ -97,7 +97,7 @@ { opcode: "registerURLSkin", blockType: Scratch.BlockType.COMMAND, - text: "load skin from URL [URL] as [NAME]", + text: Scratch.translate("load skin from URL [URL] as [NAME]"), arguments: { URL: { type: Scratch.ArgumentType.STRING, @@ -112,7 +112,7 @@ { opcode: "getSkinLoaded", blockType: Scratch.BlockType.BOOLEAN, - text: "skin [NAME] is loaded?", + text: Scratch.translate("skin [NAME] is loaded?"), arguments: { NAME: { type: Scratch.ArgumentType.STRING, @@ -126,7 +126,7 @@ { opcode: "setSkin", blockType: Scratch.BlockType.COMMAND, - text: "set skin of [TARGET] to [NAME]", + text: Scratch.translate("set skin of [TARGET] to [NAME]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -141,7 +141,7 @@ { opcode: "restoreSkin", blockType: Scratch.BlockType.COMMAND, - text: "restore skin of [TARGET]", + text: Scratch.translate("restore skin of [TARGET]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -152,7 +152,7 @@ { opcode: "restoreTargets", blockType: Scratch.BlockType.COMMAND, - text: "restore targets with skin [NAME]", + text: Scratch.translate("restore targets with skin [NAME]"), arguments: { NAME: { type: Scratch.ArgumentType.STRING, @@ -166,7 +166,7 @@ { opcode: "getCurrentSkin", blockType: Scratch.BlockType.REPORTER, - text: "current skin of [TARGET]", + text: Scratch.translate("current skin of [TARGET]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -177,7 +177,7 @@ { opcode: "getSkinAttribute", blockType: Scratch.BlockType.REPORTER, - text: "[ATTRIBUTE] of skin [NAME]", + text: Scratch.translate("[ATTRIBUTE] of skin [NAME]"), arguments: { ATTRIBUTE: { type: Scratch.ArgumentType.STRING, @@ -195,7 +195,7 @@ { opcode: "deleteSkin", blockType: Scratch.BlockType.COMMAND, - text: "delete skin [NAME]", + text: Scratch.translate("delete skin [NAME]"), arguments: { NAME: { type: Scratch.ArgumentType.STRING, @@ -206,7 +206,7 @@ { opcode: "deleteAllSkins", blockType: Scratch.BlockType.COMMAND, - text: "delete all skins", + text: Scratch.translate("delete all skins"), }, ], menus: { @@ -216,7 +216,16 @@ }, skinAttributes: { acceptReporters: true, - items: ["width", "height"], + items: [ + { + text: Scratch.translate("width"), + value: "width", + }, + { + text: Scratch.translate("height"), + value: "height", + }, + ], }, }, }; diff --git a/extensions/Lily/SoundExpanded.js b/extensions/Lily/SoundExpanded.js index 821dffc40b..b6164d9e03 100644 --- a/extensions/Lily/SoundExpanded.js +++ b/extensions/Lily/SoundExpanded.js @@ -18,12 +18,12 @@ color1: "#CF63CF", color2: "#C94FC9", color3: "#BD42BD", - name: "Sound Expanded", + name: Scratch.translate("Sound Expanded"), blocks: [ { opcode: "startLooping", blockType: Scratch.BlockType.COMMAND, - text: "start looping [SOUND]", + text: Scratch.translate("start looping [SOUND]"), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -34,7 +34,9 @@ { opcode: "startLoopingBegin", blockType: Scratch.BlockType.COMMAND, - text: "start looping [SOUND] loop start [START] seconds", + text: Scratch.translate( + "start looping [SOUND] loop start [START] seconds" + ), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -49,7 +51,9 @@ { opcode: "startLoopingBeginEnd", blockType: Scratch.BlockType.COMMAND, - text: "start looping [SOUND] loop region [START] to [END] seconds", + text: Scratch.translate( + "start looping [SOUND] loop region [START] to [END] seconds" + ), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -68,7 +72,7 @@ { opcode: "stopLooping", blockType: Scratch.BlockType.COMMAND, - text: "end looping [SOUND]", + text: Scratch.translate("end looping [SOUND]"), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -79,7 +83,7 @@ { opcode: "isLooping", blockType: Scratch.BlockType.BOOLEAN, - text: "[SOUND] is looping?", + text: Scratch.translate("[SOUND] is looping?"), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -93,7 +97,9 @@ { opcode: "playSoundAtAndWait", blockType: Scratch.BlockType.COMMAND, - text: "play sound [SOUND] from [START] seconds until done", + text: Scratch.translate( + "play sound [SOUND] from [START] seconds until done" + ), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -108,7 +114,7 @@ { opcode: "playSoundAt", blockType: Scratch.BlockType.COMMAND, - text: "start sound [SOUND] from [START] seconds", + text: Scratch.translate("start sound [SOUND] from [START] seconds"), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -123,7 +129,9 @@ { opcode: "playSoundToAndWait", blockType: Scratch.BlockType.COMMAND, - text: "play sound [SOUND] from [START] to [END] seconds until done", + text: Scratch.translate( + "play sound [SOUND] from [START] to [END] seconds until done" + ), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -142,7 +150,9 @@ { opcode: "playSoundTo", blockType: Scratch.BlockType.COMMAND, - text: "start sound [SOUND] from [START] to [END] seconds", + text: Scratch.translate( + "start sound [SOUND] from [START] to [END] seconds" + ), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -161,7 +171,7 @@ { opcode: "stopSound", blockType: Scratch.BlockType.COMMAND, - text: "stop sound [SOUND]", + text: Scratch.translate("stop sound [SOUND]"), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -172,7 +182,7 @@ { opcode: "pauseSounds", blockType: Scratch.BlockType.COMMAND, - text: "pause all sounds", + text: Scratch.translate("pause all sounds"), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -183,7 +193,7 @@ { opcode: "resumeSounds", blockType: Scratch.BlockType.COMMAND, - text: "resume all sounds", + text: Scratch.translate("resume all sounds"), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -197,7 +207,7 @@ { opcode: "isSoundPlaying", blockType: Scratch.BlockType.BOOLEAN, - text: "sound [SOUND] is playing?", + text: Scratch.translate("sound [SOUND] is playing?"), arguments: { SOUND: { type: Scratch.ArgumentType.SOUND, @@ -208,7 +218,7 @@ { opcode: "attributeOfSound", blockType: Scratch.BlockType.REPORTER, - text: "[ATTRIBUTE] of [SOUND]", + text: Scratch.translate("[ATTRIBUTE] of [SOUND]"), arguments: { ATTRIBUTE: { type: Scratch.ArgumentType.STRING, @@ -223,7 +233,7 @@ { opcode: "getSoundEffect", blockType: Scratch.BlockType.REPORTER, - text: "[EFFECT] of [TARGET]", + text: Scratch.translate("effect [EFFECT] of [TARGET]"), arguments: { EFFECT: { type: Scratch.ArgumentType.STRING, @@ -240,7 +250,7 @@ { opcode: "setProjectVolume", blockType: Scratch.BlockType.COMMAND, - text: "set project volume to [VALUE]%", + text: Scratch.translate("set project volume to [VALUE]%"), arguments: { VALUE: { type: Scratch.ArgumentType.NUMBER, @@ -252,7 +262,7 @@ { opcode: "changeProjectVolume", blockType: Scratch.BlockType.COMMAND, - text: "change project volume by [VALUE]", + text: Scratch.translate("change project volume by [VALUE]"), arguments: { VALUE: { type: Scratch.ArgumentType.NUMBER, @@ -264,18 +274,44 @@ { opcode: "getProjectVolume", blockType: Scratch.BlockType.REPORTER, - text: "project volume", + text: Scratch.translate("project volume"), extensions: ["colours_sounds"], }, ], menus: { attribute: { acceptReporters: false, - items: ["length", "channels", "sample rate", "dataURI"], + items: [ + { + text: Scratch.translate("length"), + value: "length", + }, + { + text: Scratch.translate("channels"), + value: "channels", + }, + { + text: Scratch.translate("sample rate"), + value: "sample rate", + }, + { + text: Scratch.translate("dataURI"), + value: "dataURI", + }, + ], }, effect: { acceptReporters: false, - items: ["pitch", "pan"], + items: [ + { + text: Scratch.translate("pitch"), + value: "pitch", + }, + { + text: Scratch.translate("pan"), + value: "pan", + }, + ], }, targets: { acceptReporters: true, diff --git a/extensions/Lily/Video.js b/extensions/Lily/Video.js index e6855aad4d..6bf719ff3d 100644 --- a/extensions/Lily/Video.js +++ b/extensions/Lily/Video.js @@ -129,7 +129,7 @@ return { id: "lmsVideo", color1: "#557882", - name: "Video", + name: Scratch.translate("Video"), blocks: [ { blockType: Scratch.BlockType.XML, @@ -138,7 +138,7 @@ { opcode: "loadVideoURL", blockType: Scratch.BlockType.COMMAND, - text: "load video from URL [URL] as [NAME]", + text: Scratch.translate("load video from URL [URL] as [NAME]"), arguments: { URL: { type: Scratch.ArgumentType.STRING, @@ -153,7 +153,7 @@ { opcode: "deleteVideoURL", blockType: Scratch.BlockType.COMMAND, - text: "delete video [NAME]", + text: Scratch.translate("delete video [NAME]"), arguments: { NAME: { type: Scratch.ArgumentType.STRING, @@ -164,13 +164,13 @@ { opcode: "getLoadedVideos", blockType: Scratch.BlockType.REPORTER, - text: "loaded videos", + text: Scratch.translate("loaded videos"), }, "---", { opcode: "showVideo", blockType: Scratch.BlockType.COMMAND, - text: "show video [NAME] on [TARGET]", + text: Scratch.translate("show video [NAME] on [TARGET]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -185,7 +185,7 @@ { opcode: "stopShowingVideo", blockType: Scratch.BlockType.COMMAND, - text: "stop showing video on [TARGET]", + text: Scratch.translate("stop showing video on [TARGET]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -200,7 +200,7 @@ { opcode: "getCurrentVideo", blockType: Scratch.BlockType.REPORTER, - text: "current video on [TARGET]", + text: Scratch.translate("current video on [TARGET]"), arguments: { TARGET: { type: Scratch.ArgumentType.STRING, @@ -212,7 +212,7 @@ { opcode: "startVideo", blockType: Scratch.BlockType.COMMAND, - text: "start video [NAME] at [DURATION] seconds", + text: Scratch.translate("start video [NAME] at [DURATION] seconds"), arguments: { NAME: { type: Scratch.ArgumentType.STRING, @@ -227,7 +227,7 @@ { opcode: "getAttribute", blockType: Scratch.BlockType.REPORTER, - text: "[ATTRIBUTE] of video [NAME]", + text: Scratch.translate("[ATTRIBUTE] of video [NAME]"), arguments: { ATTRIBUTE: { type: Scratch.ArgumentType.STRING, @@ -243,7 +243,7 @@ { opcode: "pause", blockType: Scratch.BlockType.COMMAND, - text: "pause video [NAME]", + text: Scratch.translate("pause video [NAME]"), arguments: { NAME: { type: Scratch.ArgumentType.STRING, @@ -254,7 +254,7 @@ { opcode: "resume", blockType: Scratch.BlockType.COMMAND, - text: "resume video [NAME]", + text: Scratch.translate("resume video [NAME]"), arguments: { NAME: { type: Scratch.ArgumentType.STRING, @@ -265,7 +265,7 @@ { opcode: "getState", blockType: Scratch.BlockType.BOOLEAN, - text: "video [NAME] is [STATE]?", + text: Scratch.translate("video [NAME] is [STATE]?"), arguments: { NAME: { type: Scratch.ArgumentType.STRING, @@ -281,7 +281,7 @@ { opcode: "setVolume", blockType: Scratch.BlockType.COMMAND, - text: "set volume of video [NAME] to [VALUE]", + text: Scratch.translate("set volume of video [NAME] to [VALUE]"), arguments: { NAME: { type: Scratch.ArgumentType.STRING, @@ -301,11 +301,41 @@ }, state: { acceptReporters: true, - items: ["playing", "paused"], + items: [ + { + text: Scratch.translate("playing"), + value: "playing", + }, + { + text: Scratch.translate("paused"), + value: "paused", + }, + ], }, attribute: { acceptReporters: false, - items: ["current time", "duration", "volume", "width", "height"], + items: [ + { + text: Scratch.translate("current time"), + value: "current time", + }, + { + text: Scratch.translate("duration"), + value: "duration", + }, + { + text: Scratch.translate("volume"), + value: "volume", + }, + { + text: Scratch.translate("width"), + value: "width", + }, + { + text: Scratch.translate("height"), + value: "height", + }, + ], }, }, }; diff --git a/extensions/Lily/lmsutils.js b/extensions/Lily/lmsutils.js index f21b347605..c92adbf925 100644 --- a/extensions/Lily/lmsutils.js +++ b/extensions/Lily/lmsutils.js @@ -25,7 +25,7 @@ getInfo() { return { id: "lmsutilsblocks", - name: "Lily's Toolbox", + name: Scratch.translate("Lily's Toolbox"), color1: "#3bb2ed", color2: "#37a1de", color3: "#3693d9", @@ -34,7 +34,7 @@ { opcode: "whenBooleanHat", blockType: Scratch.BlockType.HAT, - text: "when [INPUT] is true", + text: Scratch.translate("when [INPUT] is true"), isEdgeActivated: true, arguments: { INPUT: { @@ -46,7 +46,7 @@ { opcode: "whenKeyString", blockType: Scratch.BlockType.HAT, - text: "when key [KEY_OPTION] pressed", + text: Scratch.translate("when key [KEY_OPTION] pressed"), isEdgeActivated: true, arguments: { KEY_OPTION: { @@ -61,7 +61,7 @@ { opcode: "keyStringPressed", blockType: Scratch.BlockType.BOOLEAN, - text: "key [KEY_OPTION] pressed?", + text: Scratch.translate("key [KEY_OPTION] pressed?"), arguments: { KEY_OPTION: { type: Scratch.ArgumentType.STRING, @@ -84,7 +84,7 @@ { opcode: "stringIf", blockType: Scratch.BlockType.REPORTER, - text: "if [BOOLEAN] then [INPUTA]", + text: Scratch.translate("if [BOOLEAN] then [INPUTA]"), disableMonitor: true, arguments: { BOOLEAN: { @@ -100,7 +100,7 @@ { opcode: "stringIfElse", blockType: Scratch.BlockType.REPORTER, - text: "if [BOOLEAN] then [INPUTA] else [INPUTB]", + text: Scratch.translate("if [BOOLEAN] then [INPUTA] else [INPUTB]"), disableMonitor: true, arguments: { BOOLEAN: { @@ -123,7 +123,7 @@ { opcode: "getEffectValue", blockType: Scratch.BlockType.REPORTER, - text: "effect [INPUT]", + text: Scratch.translate("effect [INPUT]"), arguments: { INPUT: { type: Scratch.ArgumentType.STRING, @@ -135,19 +135,20 @@ { opcode: "clonesBeingUsed", blockType: Scratch.BlockType.REPORTER, - text: "clone count", + text: Scratch.translate("clone count"), + disableMonitor: true, }, { opcode: "isClone", blockType: Scratch.BlockType.BOOLEAN, - text: "is clone?", + text: Scratch.translate("is clone?"), filter: [Scratch.TargetType.SPRITE], disableMonitor: true, }, { opcode: "spriteClicked", blockType: Scratch.BlockType.BOOLEAN, - text: "sprite clicked?", + text: Scratch.translate("sprite clicked?"), filter: [Scratch.TargetType.SPRITE], disableMonitor: true, }, @@ -157,7 +158,7 @@ { opcode: "lettersToOf", blockType: Scratch.BlockType.REPORTER, - text: "letters [INPUTA] to [INPUTB] of [STRING]", + text: Scratch.translate("letters [INPUTA] to [INPUTB] of [STRING]"), disableMonitor: true, arguments: { INPUTA: { @@ -177,7 +178,9 @@ { opcode: "replaceWords", blockType: Scratch.BlockType.REPORTER, - text: "replace first [INPUTA] with [INPUTB] in [STRING]", + text: Scratch.translate( + "replace first [INPUTA] with [INPUTB] in [STRING]" + ), disableMonitor: true, arguments: { INPUTA: { @@ -197,7 +200,7 @@ { opcode: "findIndexOfString", blockType: Scratch.BlockType.REPORTER, - text: "index of [INPUTA] in [INPUTB]", + text: Scratch.translate("index of [INPUTA] in [INPUTB]"), arguments: { INPUTA: { type: Scratch.ArgumentType.STRING, @@ -212,7 +215,9 @@ { opcode: "itemOfFromString", blockType: Scratch.BlockType.REPORTER, - text: "item [INPUTA] of [INPUTB] split by [INPUTC]", + text: Scratch.translate( + "item [INPUTA] of [INPUTB] split by [INPUTC]" + ), arguments: { INPUTA: { type: Scratch.ArgumentType.NUMBER, @@ -231,7 +236,7 @@ { opcode: "stringToUpperCase", blockType: Scratch.BlockType.REPORTER, - text: "[STRING] to uppercase", + text: Scratch.translate("[STRING] to uppercase"), disableMonitor: true, arguments: { STRING: { @@ -243,7 +248,7 @@ { opcode: "stringToLowerCase", blockType: Scratch.BlockType.REPORTER, - text: "[STRING] to lowercase", + text: Scratch.translate("[STRING] to lowercase"), disableMonitor: true, arguments: { STRING: { @@ -255,7 +260,7 @@ { opcode: "reverseString", blockType: Scratch.BlockType.REPORTER, - text: "reverse [STRING]", + text: Scratch.translate("reverse [STRING]"), disableMonitor: true, arguments: { STRING: { @@ -270,7 +275,7 @@ { opcode: "norBoolean", blockType: Scratch.BlockType.BOOLEAN, - text: "[INPUTA] nor [INPUTB]", + text: Scratch.translate("[INPUTA] nor [INPUTB]"), arguments: { INPUTA: { type: Scratch.ArgumentType.BOOLEAN, @@ -285,7 +290,7 @@ { opcode: "xorBoolean", blockType: Scratch.BlockType.BOOLEAN, - text: "[INPUTA] xor [INPUTB]", + text: Scratch.translate("[INPUTA] xor [INPUTB]"), arguments: { INPUTA: { type: Scratch.ArgumentType.BOOLEAN, @@ -300,7 +305,7 @@ { opcode: "xnorBoolean", blockType: Scratch.BlockType.BOOLEAN, - text: "[INPUTA] xnor [INPUTB]", + text: Scratch.translate("[INPUTA] xnor [INPUTB]"), arguments: { INPUTA: { type: Scratch.ArgumentType.BOOLEAN, @@ -315,7 +320,7 @@ { opcode: "nandBoolean", blockType: Scratch.BlockType.BOOLEAN, - text: "[INPUTA] nand [INPUTB]", + text: Scratch.translate("[INPUTA] nand [INPUTB]"), arguments: { INPUTA: { type: Scratch.ArgumentType.BOOLEAN, @@ -346,7 +351,7 @@ { opcode: "colourHex", blockType: Scratch.BlockType.REPORTER, - text: "color [COLOUR]", + text: Scratch.translate("color [COLOUR]"), hideFromPalette: hideLegacyBlocks, arguments: { COLOUR: { @@ -358,7 +363,7 @@ { opcode: "angleReporter", blockType: Scratch.BlockType.REPORTER, - text: "angle [ANGLE]", + text: Scratch.translate("angle [ANGLE]"), hideFromPalette: hideLegacyBlocks, arguments: { ANGLE: { @@ -370,7 +375,7 @@ { opcode: "matrixReporter", blockType: Scratch.BlockType.REPORTER, - text: "matrix [MATRIX]", + text: Scratch.translate("matrix [MATRIX]"), hideFromPalette: hideLegacyBlocks, arguments: { MATRIX: { @@ -382,7 +387,7 @@ { opcode: "noteReporter", blockType: Scratch.BlockType.REPORTER, - text: "note [NOTE]", + text: Scratch.translate("note [NOTE]"), hideFromPalette: hideLegacyBlocks, arguments: { NOTE: { @@ -394,7 +399,7 @@ { opcode: "newlineCharacter", blockType: Scratch.BlockType.REPORTER, - text: "newline character", + text: Scratch.translate("newline character"), hideFromPalette: hideLegacyBlocks, disableMonitor: true, }, @@ -464,7 +469,7 @@ { opcode: "stringCheckBoolean", blockType: Scratch.BlockType.BOOLEAN, - text: "[INPUT] is [DROPDOWN]", + text: Scratch.translate("[INPUT] is [DROPDOWN]"), arguments: { INPUT: { type: Scratch.ArgumentType.STRING, @@ -472,7 +477,6 @@ }, DROPDOWN: { type: Scratch.ArgumentType.STRING, - defaultValue: "text", menu: "stringCheckMenu", }, }, @@ -483,7 +487,7 @@ { opcode: "encodeToBlock", blockType: Scratch.BlockType.REPORTER, - text: "encode [STRING] to [DROPDOWN]", + text: Scratch.translate("encode [STRING] to [DROPDOWN]"), disableMonitor: true, hideFromPalette: hideLegacyBlocks, arguments: { @@ -493,7 +497,6 @@ }, DROPDOWN: { type: Scratch.ArgumentType.STRING, - defaultValue: "base64", menu: "conversionMenu", }, }, @@ -501,7 +504,7 @@ { opcode: "decodeFromBlock", blockType: Scratch.BlockType.REPORTER, - text: "decode [STRING] from [DROPDOWN]", + text: Scratch.translate("decode [STRING] from [DROPDOWN]"), disableMonitor: true, hideFromPalette: hideLegacyBlocks, arguments: { @@ -511,7 +514,6 @@ }, DROPDOWN: { type: Scratch.ArgumentType.STRING, - defaultValue: "base64", menu: "conversionMenu", }, }, @@ -565,7 +567,7 @@ { opcode: "normaliseValue", blockType: Scratch.BlockType.REPORTER, - text: "normalise [INPUT]", + text: Scratch.translate("normalise [INPUT]"), disableMonitor: true, arguments: { INPUT: { @@ -577,7 +579,9 @@ { opcode: "clampNumber", blockType: Scratch.BlockType.REPORTER, - text: "clamp [INPUTA] between [INPUTB] and [INPUTC]", + text: Scratch.translate( + "clamp [INPUTA] between [INPUTB] and [INPUTC]" + ), arguments: { INPUTA: { type: Scratch.ArgumentType.NUMBER, @@ -599,7 +603,7 @@ { opcode: "setVariableTo", blockType: Scratch.BlockType.COMMAND, - text: "set variable [INPUTA] to [INPUTB]", + text: Scratch.translate("set variable [INPUTA] to [INPUTB]"), hideFromPalette: hideLegacyBlocks, arguments: { INPUTA: { @@ -615,7 +619,7 @@ { opcode: "changeVariableBy", blockType: Scratch.BlockType.COMMAND, - text: "change variable [INPUTA] by [INPUTB]", + text: Scratch.translate("change variable [INPUTA] by [INPUTB]"), hideFromPalette: hideLegacyBlocks, arguments: { INPUTA: { @@ -631,7 +635,7 @@ { opcode: "getVariable", blockType: Scratch.BlockType.REPORTER, - text: "variable [INPUT]", + text: Scratch.translate("variable [INPUT]"), disableMonitor: true, hideFromPalette: hideLegacyBlocks, arguments: { @@ -644,7 +648,7 @@ { opcode: "deleteVariable", blockType: Scratch.BlockType.COMMAND, - text: "delete variable [INPUT]", + text: Scratch.translate("delete variable [INPUT]"), hideFromPalette: hideLegacyBlocks, arguments: { INPUT: { @@ -656,13 +660,13 @@ { opcode: "deleteAllVariables", blockType: Scratch.BlockType.COMMAND, - text: "delete all variables", + text: Scratch.translate("delete all variables"), hideFromPalette: hideLegacyBlocks, }, { opcode: "listVariables", blockType: Scratch.BlockType.REPORTER, - text: "list active variables", + text: Scratch.translate("list active variables"), disableMonitor: true, hideFromPalette: hideLegacyBlocks, }, @@ -672,13 +676,13 @@ { opcode: "greenFlag", blockType: Scratch.BlockType.COMMAND, - text: "green flag", + text: Scratch.translate("green flag"), hideFromPalette: hideLegacyBlocks, }, { opcode: "setUsername", blockType: Scratch.BlockType.COMMAND, - text: "set username to [INPUT]", + text: Scratch.translate("set username to [INPUT]"), hideFromPalette: hideLegacyBlocks, arguments: { INPUT: { @@ -693,7 +697,9 @@ { opcode: "setSpriteSVG", blockType: Scratch.BlockType.COMMAND, - text: "replace SVG data for costume [INPUTA] with [INPUTB]", + text: Scratch.translate( + "replace SVG data for costume [INPUTA] with [INPUTB]" + ), hideFromPalette: hideLegacyBlocks, arguments: { INPUTA: { @@ -712,7 +718,7 @@ { opcode: "alertBlock", blockType: Scratch.BlockType.COMMAND, - text: "alert [STRING]", + text: Scratch.translate("alert [STRING]"), hideFromPalette: hideLegacyBlocks, arguments: { STRING: { @@ -724,7 +730,7 @@ { opcode: "inputPromptBlock", blockType: Scratch.BlockType.REPORTER, - text: "prompt [STRING]", + text: Scratch.translate("prompt [STRING]"), hideFromPalette: hideLegacyBlocks, disableMonitor: true, arguments: { @@ -737,7 +743,7 @@ { opcode: "confirmationBlock", blockType: Scratch.BlockType.BOOLEAN, - text: "confirm [STRING]", + text: Scratch.translate("confirm [STRING]"), hideFromPalette: hideLegacyBlocks, arguments: { STRING: { @@ -752,7 +758,7 @@ { opcode: "goToLink", blockType: Scratch.BlockType.COMMAND, - text: "open link [INPUT] in new tab", + text: Scratch.translate("open link [INPUT] in new tab"), hideFromPalette: hideLegacyBlocks, arguments: { INPUT: { @@ -764,7 +770,7 @@ { opcode: "redirectToLink", blockType: Scratch.BlockType.COMMAND, - text: "redirect to link [INPUT]", + text: Scratch.translate("redirect to link [INPUT]"), hideFromPalette: hideLegacyBlocks, arguments: { INPUT: { @@ -779,7 +785,7 @@ { opcode: "setClipboard", blockType: Scratch.BlockType.COMMAND, - text: "set [STRING] to clipboard", + text: Scratch.translate("set [STRING] to clipboard"), hideFromPalette: hideLegacyBlocks, arguments: { STRING: { @@ -791,7 +797,7 @@ { opcode: "readClipboard", blockType: Scratch.BlockType.REPORTER, - text: "clipboard", + text: Scratch.translate("clipboard"), hideFromPalette: hideLegacyBlocks, }, @@ -800,12 +806,12 @@ { opcode: "isUserMobile", blockType: Scratch.BlockType.BOOLEAN, - text: "is mobile?", + text: Scratch.translate("is mobile?"), }, { opcode: "screenReporter", blockType: Scratch.BlockType.REPORTER, - text: "screen [DROPDOWN]", + text: Scratch.translate("screen [DROPDOWN]"), disableMonitor: true, arguments: { DROPDOWN: { @@ -818,7 +824,7 @@ { opcode: "windowReporter", blockType: Scratch.BlockType.REPORTER, - text: "window [DROPDOWN]", + text: Scratch.translate("window [DROPDOWN]"), disableMonitor: true, arguments: { DROPDOWN: { @@ -831,7 +837,7 @@ { opcode: "osBrowserDetails", blockType: Scratch.BlockType.REPORTER, - text: "get [DROPDOWN] of user", + text: Scratch.translate("get [DROPDOWN] of user"), disableMonitor: true, arguments: { DROPDOWN: { @@ -844,7 +850,7 @@ { opcode: "projectURL", blockType: Scratch.BlockType.REPORTER, - text: "project URL", + text: Scratch.translate("project URL"), disableMonitor: true, }, @@ -853,7 +859,7 @@ { opcode: "consoleLog", blockType: Scratch.BlockType.COMMAND, - text: "console [DROPDOWN] [INPUT]", + text: Scratch.translate("console [DROPDOWN] [INPUT]"), disableMonitor: true, hideFromPalette: hideLegacyBlocks, arguments: { @@ -871,7 +877,7 @@ { opcode: "clearConsole", blockType: Scratch.BlockType.COMMAND, - text: "clear console", + text: Scratch.translate("clear console"), hideFromPalette: hideLegacyBlocks, }, @@ -939,40 +945,106 @@ { func: "showLegacyBlocks", blockType: Scratch.BlockType.BUTTON, - text: "Show Legacy Blocks", + text: Scratch.translate("Show Legacy Blocks"), hideFromPalette: !hideLegacyBlocks, }, { func: "hideLegacyBlocks", blockType: Scratch.BlockType.BUTTON, - text: "Hide Legacy Blocks", + text: Scratch.translate("Hide Legacy Blocks"), hideFromPalette: hideLegacyBlocks, }, ], menus: { conversionMenu: { acceptReporters: true, - items: ["base64", "binary"], + items: [ + { + text: Scratch.translate("base64"), + value: "base64", + }, + { + text: Scratch.translate("binary"), + value: "binary", + }, + ], }, trueFalseMenu: { acceptReporters: true, - items: ["true", "false", "random"], + items: [ + { + text: Scratch.translate("true"), + value: "true", + }, + { + text: Scratch.translate("false"), + value: "false", + }, + { + text: Scratch.translate("random"), + value: "random", + }, + ], }, screenReporterMenu: { acceptReporters: true, - items: ["width", "height"], + items: [ + { + text: Scratch.translate("width"), + value: "width", + }, + { + text: Scratch.translate("height"), + value: "height", + }, + ], }, windowReporterMenu: { acceptReporters: true, - items: ["width", "height"], + items: [ + { + text: Scratch.translate("width"), + value: "width", + }, + { + text: Scratch.translate("height"), + value: "height", + }, + ], }, stringCheckMenu: { acceptReporters: true, - items: ["text", "number", "uppercase", "lowercase"], + items: [ + { + text: Scratch.translate("text"), + value: "text", + }, + { + text: Scratch.translate("number"), + value: "number", + }, + { + text: Scratch.translate("uppercase"), + value: "uppercase", + }, + { + text: Scratch.translate("lowercase"), + value: "lowercase", + }, + ], }, osBrowserMenu: { acceptReporters: true, - items: ["operating system", "browser"], + items: [ + { + text: Scratch.translate("operating system"), + value: "operating system", + }, + { + text: Scratch.translate("browser"), + value: "browser", + }, + ], }, consoleLogMenu: { acceptReporters: false, @@ -981,13 +1053,34 @@ colorMenu: { acceptReporters: true, items: [ - "color", - "fisheye", - "whirl", - "pixelate", - "mosaic", - "brightness", - "ghost", + { + text: Scratch.translate("color"), + value: "color", + }, + { + text: Scratch.translate("fisheye"), + value: "fisheye", + }, + { + text: Scratch.translate("whirl"), + value: "whirl", + }, + { + text: Scratch.translate("pixelate"), + value: "pixelate", + }, + { + text: Scratch.translate("mosaic"), + value: "mosaic", + }, + { + text: Scratch.translate("brightness"), + value: "brightness", + }, + { + text: Scratch.translate("ghost"), + value: "ghost", + }, ], }, }, @@ -997,7 +1090,9 @@ showLegacyBlocks() { if ( confirm( - "Are you sure you want to show legacy blocks? \n \n These blocks were removed because they were buggy or implemented better in other extensions." + Scratch.translate( + "Are you sure you want to show legacy blocks? \n \n These blocks were removed because they were buggy or implemented better in other extensions." + ) ) ) { hideLegacyBlocks = false; diff --git a/extensions/Longboost/color_channels.js b/extensions/Longboost/color_channels.js index d4b378e29d..e0302090e1 100644 --- a/extensions/Longboost/color_channels.js +++ b/extensions/Longboost/color_channels.js @@ -17,7 +17,7 @@ getInfo() { return { id: "lbdrawtest", - name: "RGB Channels", + name: Scratch.translate("RGB Channels"), menuIconURI: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIzMyIgaGVpZ2h0PSIzMyIgdmlld0JveD0iMCwwLDMzLDMzIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjIzLjUsLTE2My41KSI+PGcgZGF0YS1wYXBlci1kYXRhPSJ7JnF1b3Q7aXNQYWludGluZ0xheWVyJnF1b3Q7OnRydWV9IiBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZS1saW5lY2FwPSJidXR0IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1kYXNoYXJyYXk9IiIgc3Ryb2tlLWRhc2hvZmZzZXQ9IjAiIHN0eWxlPSJtaXgtYmxlbmQtbW9kZTogbm9ybWFsIj48cGF0aCBkPSJNMjI0LDE4MGMwLC04LjgzNjU2IDcuMTYzNDQsLTE2IDE2LC0xNmM4LjgzNjU2LDAgMTYsNy4xNjM0NCAxNiwxNmMwLDguODM2NTYgLTcuMTYzNDQsMTYgLTE2LDE2Yy04LjgzNjU2LDAgLTE2LC03LjE2MzQ0IC0xNiwtMTZ6IiBmaWxsPSIjYWFhYWFhIiBzdHJva2U9IiM4ODg4ODgiIHN0cm9rZS13aWR0aD0iMSIvPjxwYXRoIGQ9Ik0yMzMuOTAyMDQsMTgxLjQ4NjkyYzAsLTQuNDE4MjggMy41ODE3MiwtOCA4LC04YzQuNDE4MjgsMCA4LDMuNTgxNzIgOCw4YzAsNC40MTgyOCAtMy41ODE3Miw4IC04LDhjLTQuNDE4MjgsMCAtOCwtMy41ODE3MiAtOCwtOHoiIGZpbGw9IiMwMDAwZmYiIHN0cm9rZT0iIzNjMDBmZiIgc3Ryb2tlLXdpZHRoPSIwLjUiLz48cGF0aCBkPSJNMjMxLjk2MjQ1LDE3OS40NDEzNWMwLC00LjQxODI4IDMuNTgxNzIsLTggOCwtOGM0LjQxODI4LDAgOCwzLjU4MTcyIDgsOGMwLDQuNDE4MjggLTMuNTgxNzIsOCAtOCw4Yy00LjQxODI4LDAgLTgsLTMuNTgxNzIgLTgsLTh6IiBmaWxsPSIjMDBmZjAwIiBzdHJva2U9IiMwMGZmM2QiIHN0cm9rZS13aWR0aD0iMSIvPjxwYXRoIGQ9Ik0yMzAuMjI1OSwxNzcuNjIwOThjMCwtNC40MTgyOCAzLjU4MTcyLC04IDgsLThjNC40MTgyOCwwIDgsMy41ODE3MiA4LDhjMCw0LjQxODI4IC0zLjU4MTcyLDggLTgsOGMtNC40MTgyOCwwIC04LC0zLjU4MTcyIC04LC04eiIgZmlsbD0iI2ZmMDAwMCIgc3Ryb2tlPSIjZmYzZDAwIiBzdHJva2Utd2lkdGg9IjEiLz48L2c+PC9nPjwvc3ZnPgo=", blockIconURI: @@ -29,21 +29,21 @@ { opcode: "true", blockType: Scratch.BlockType.BOOLEAN, - text: "true", + text: Scratch.translate("true"), hideFromPalette: true, disableMonitor: true, }, { opcode: "false", blockType: Scratch.BlockType.BOOLEAN, - text: "false", + text: Scratch.translate("false"), hideFromPalette: true, disableMonitor: true, }, { opcode: "enabledCheck", blockType: Scratch.BlockType.BOOLEAN, - text: "[COLOR] channel enabled?", + text: Scratch.translate("[COLOR] channel enabled?"), arguments: { COLOR: { type: Scratch.ArgumentType.STRING, @@ -54,7 +54,7 @@ { opcode: "drawSelected", blockType: Scratch.BlockType.COMMAND, - text: "set colors red:[R]green:[G]blue:[B]", + text: Scratch.translate("set colors red:[R]green:[G]blue:[B]"), arguments: { R: { type: Scratch.ArgumentType.MENU, @@ -73,7 +73,7 @@ { opcode: "draw", blockType: Scratch.BlockType.COMMAND, - text: "only draw colors:[R]green:[G]blue:[B]", + text: Scratch.translate("only draw colors:[R]green:[G]blue:[B]"), hideFromPalette: true, arguments: { R: { @@ -90,7 +90,7 @@ { opcode: "drawOneColor", blockType: Scratch.BlockType.COMMAND, - text: "only draw [COLOR]", + text: Scratch.translate("only draw [COLOR]"), arguments: { COLOR: { type: Scratch.ArgumentType.STRING, @@ -101,7 +101,7 @@ { opcode: "drawDepth", blockType: Scratch.BlockType.COMMAND, - text: "enable depth mask?[DRAW]", + text: Scratch.translate("enable depth mask?[DRAW]"), hideFromPalette: true, arguments: { DRAW: { @@ -112,23 +112,36 @@ { opcode: "clearEffects", blockType: Scratch.BlockType.COMMAND, - text: "clear color draw effects", + text: Scratch.translate("clear color draw effects"), }, ], menus: { COLOR_MENU: { acceptReporters: true, - items: ["red", "green", "blue"], + items: [ + { + text: Scratch.translate("red"), + value: "red", + }, + { + text: Scratch.translate("green"), + value: "green", + }, + { + text: Scratch.translate("blue"), + value: "blue", + }, + ], }, ENABLED_MENU: { acceptReporters: true, items: [ { - text: "off", + text: Scratch.translate("off"), value: "false", }, { - text: "on", + text: Scratch.translate("on"), value: "true", }, ], diff --git a/extensions/NOname-awa/more-comparisons.js b/extensions/NOname-awa/more-comparisons.js index 137fe36215..b9fae939d5 100644 --- a/extensions/NOname-awa/more-comparisons.js +++ b/extensions/NOname-awa/more-comparisons.js @@ -12,7 +12,7 @@ getInfo() { return { id: "nonameawacomparisons", - name: "More Comparisons", + name: Scratch.translate("More Comparisons"), color1: "#00a889", color2: "#1e8c76", color3: "#1e8c76", @@ -20,14 +20,14 @@ { opcode: "true", blockType: Scratch.BlockType.BOOLEAN, - text: "true", + text: Scratch.translate("true"), arguments: {}, disableMonitor: true, }, { opcode: "false", blockType: Scratch.BlockType.BOOLEAN, - text: "false", + text: Scratch.translate("false"), arguments: {}, disableMonitor: true, }, diff --git a/extensions/NexusKitten/moremotion.js b/extensions/NexusKitten/moremotion.js index 53a824f221..fe8637c021 100644 --- a/extensions/NexusKitten/moremotion.js +++ b/extensions/NexusKitten/moremotion.js @@ -29,7 +29,8 @@ text: typeof ScratchBlocks !== "undefined" ? ScratchBlocks.Msg["MOTION_STAGE_SELECTED"] - : "Stage selected: no motion blocks", + : // This is just fallback for non-editor environments, don't need to translate + "Stage selected: no motion blocks", }, { filter: [Scratch.TargetType.SPRITE], diff --git a/extensions/TheShovel/CanvasEffects.js b/extensions/TheShovel/CanvasEffects.js index 138090659f..efbcd81ff4 100644 --- a/extensions/TheShovel/CanvasEffects.js +++ b/extensions/TheShovel/CanvasEffects.js @@ -110,12 +110,12 @@ getInfo() { return { id: "theshovelcanvaseffects", - name: "Canvas Effects", + name: Scratch.translate("Canvas Effects"), blocks: [ { opcode: "seteffect", blockType: Scratch.BlockType.COMMAND, - text: "set canvas [EFFECT] to [NUMBER]", + text: Scratch.translate("set canvas [EFFECT] to [NUMBER]"), arguments: { EFFECT: { type: Scratch.ArgumentType.STRING, @@ -129,7 +129,7 @@ { opcode: "changeEffect", blockType: Scratch.BlockType.COMMAND, - text: "change canvas [EFFECT] by [NUMBER]", + text: Scratch.translate("change canvas [EFFECT] by [NUMBER]"), arguments: { EFFECT: { type: Scratch.ArgumentType.STRING, @@ -144,7 +144,7 @@ { opcode: "geteffect", blockType: Scratch.BlockType.REPORTER, - text: "get canvas [EFFECT]", + text: Scratch.translate("get canvas [EFFECT]"), arguments: { EFFECT: { type: Scratch.ArgumentType.STRING, @@ -161,7 +161,9 @@ { opcode: "setBorder", blockType: Scratch.BlockType.COMMAND, - text: "set canvas border to [WIDTH] pixels [STYLE] with color [COLOR1] and background [COLOR2]", + text: Scratch.translate( + "set canvas border to [WIDTH] pixels [STYLE] with color [COLOR1] and background [COLOR2]" + ), arguments: { STYLE: { type: Scratch.ArgumentType.STRING, @@ -184,7 +186,9 @@ { opcode: "renderscale", blockType: Scratch.BlockType.COMMAND, - text: "set canvas render size to width: [X] height: [Y]", + text: Scratch.translate( + "set canvas render size to width: [X] height: [Y]" + ), arguments: { X: { type: Scratch.ArgumentType.NUMBER, @@ -199,7 +203,9 @@ { opcode: "setrendermode", blockType: Scratch.BlockType.COMMAND, - text: "set canvas resize rendering mode [EFFECT]", + text: Scratch.translate( + "set canvas resize rendering mode [EFFECT]" + ), arguments: { EFFECT: { type: Scratch.ArgumentType.STRING, @@ -215,7 +221,16 @@ }, RENDERMODE: { acceptReporters: true, - items: ["pixelated", "default"], + items: [ + { + text: Scratch.translate("pixelated"), + value: "pixelated", + }, + { + text: Scratch.translate("default"), + value: "default", + }, + ], }, EFFECTGETMENU: { acceptReporters: true, @@ -224,15 +239,42 @@ borderTypes: { acceptReporters: true, items: [ - "dotted", - "dashed", - "solid", - "double", - "groove", - "ridge", - "inset", - "outset", - "none", + { + text: Scratch.translate("dotted"), + value: "dotted", + }, + { + text: Scratch.translate("dashed"), + value: "dashed", + }, + { + text: Scratch.translate("solid"), + value: "solid", + }, + { + text: Scratch.translate("double"), + value: "double", + }, + { + text: Scratch.translate("groove"), + value: "groove", + }, + { + text: Scratch.translate("ridge"), + value: "ridge", + }, + { + text: Scratch.translate("inset"), + value: "inset", + }, + { + text: Scratch.translate("outset"), + value: "outset", + }, + { + text: Scratch.translate("none"), + value: "none", + }, ], }, }, @@ -241,26 +283,108 @@ _getMenuItems(isGetter) { return [ - "blur", - "contrast", - "saturation", - "color shift", - "brightness", - "invert", - ...(isGetter ? ["resize rendering mode"] : []), - "sepia", - "transparency", - ...(isGetter ? [] : ["scale"]), - "scale X", - "scale Y", - "skew X", - "skew Y", - "offset X", - "offset Y", - "rotation", - "border radius", + { + text: Scratch.translate("blur"), + value: "blur", + }, + { + text: Scratch.translate("contrast"), + value: "contrast", + }, + { + text: Scratch.translate("saturation"), + value: "saturation", + }, + { + text: Scratch.translate("color shift"), + value: "color shift", + }, + { + text: Scratch.translate("brightness"), + value: "brightness", + }, + { + text: Scratch.translate("invert"), + value: "invert", + }, ...(isGetter - ? ["border width", "border style", "border color", "background"] + ? [ + { + text: Scratch.translate("resize rendering mode"), + value: "resize rendering mode", + }, + ] + : []), + { + text: Scratch.translate("sepia"), + value: "sepia", + }, + { + text: Scratch.translate("transparency"), + value: "transparency", + }, + ...(isGetter + ? [] + : [ + { + text: Scratch.translate({ + default: "scale", + description: "Scale as in upscale/downscale", + }), + value: "scale", + }, + ]), + { + text: Scratch.translate("scale X"), + value: "scale X", + }, + { + text: Scratch.translate("scale Y"), + value: "scale Y", + }, + { + text: Scratch.translate("skew X"), + value: "skew X", + }, + { + text: Scratch.translate("skew Y"), + value: "skew Y", + }, + { + text: Scratch.translate("offset X"), + value: "offset X", + }, + { + text: Scratch.translate("offset Y"), + value: "offset Y", + }, + { + text: Scratch.translate("rotation"), + value: "rotation", + }, + { + text: Scratch.translate("border radius"), + value: "border radius", + }, + ...(isGetter + ? [ + { + text: Scratch.translate("border width"), + value: "border width", + }, + { + text: Scratch.translate("border style"), + value: "border style", + }, + { + text: Scratch.translate("border color"), + value: "border color", + }, + { + text: Scratch.translate("background"), + value: "background", + }, + ] : []), ]; } diff --git a/extensions/mdwalters/notifications.js b/extensions/mdwalters/notifications.js index c3d24b6baa..df55962b10 100644 --- a/extensions/mdwalters/notifications.js +++ b/extensions/mdwalters/notifications.js @@ -49,34 +49,37 @@ getInfo() { return { id: "mdwaltersnotifications", - name: "Notifications", + name: Scratch.translate("Notifications"), blocks: [ { opcode: "requestPermission", blockType: Scratch.BlockType.COMMAND, - text: "request notification permission", + text: Scratch.translate("request notification permission"), }, { opcode: "hasPermission", blockType: Scratch.BlockType.BOOLEAN, - text: "has notification permission", + text: Scratch.translate("has notification permission"), disableMonitor: true, }, { opcode: "showNotification", blockType: Scratch.BlockType.COMMAND, - text: "create notification with text [text]", + text: Scratch.translate("create notification with text [text]"), arguments: { text: { type: Scratch.ArgumentType.STRING, - defaultValue: "Hello, world!", + defaultValue: Scratch.translate({ + default: "Hello, world!", + description: "Default text in the create notification block", + }), }, }, }, { opcode: "closeNotification", blockType: Scratch.BlockType.COMMAND, - text: "close notification", + text: Scratch.translate("close notification"), }, ], }; @@ -95,7 +98,10 @@ async _showNotification(text) { if (await this.hasPermission()) { - const title = "Notification from project"; + const title = Scratch.translate({ + default: "Notification from project", + description: "Title of notifications created by the project", + }); const options = { body: text, }; diff --git a/extensions/obviousAlexC/penPlus.js b/extensions/obviousAlexC/penPlus.js index 4af6d53682..d28c27b593 100644 --- a/extensions/obviousAlexC/penPlus.js +++ b/extensions/obviousAlexC/penPlus.js @@ -162,7 +162,7 @@ invec4.zw ); } - + void main() { v_color = a_color; @@ -171,7 +171,7 @@ `, frag: ` varying highp vec4 v_color; - + void main() { gl_FragColor = v_color; @@ -190,7 +190,7 @@ attribute highp vec4 a_position; attribute highp vec4 a_color; attribute highp vec2 a_texCoord; - + varying highp vec4 v_color; varying highp vec2 v_texCoord; @@ -213,10 +213,10 @@ `, frag: ` uniform sampler2D u_texture; - + varying highp vec2 v_texCoord; varying highp vec4 v_color; - + void main() { gl_FragColor = texture2D(u_texture, mod(v_texCoord,1.0)) * v_color; @@ -233,10 +233,10 @@ Shaders: { vert: ` attribute highp vec4 a_position; - + varying highp vec2 v_texCoord; attribute highp vec2 a_texCoord; - + void main() { gl_Position = a_position * vec4(a_position.w,a_position.w,0,1); @@ -245,9 +245,9 @@ `, frag: ` varying highp vec2 v_texCoord; - + uniform sampler2D u_drawTex; - + void main() { gl_FragColor = texture2D(u_drawTex, v_texCoord); @@ -357,22 +357,26 @@ //Just for our eyes sakes // prettier-ignore let reRenderInfo = twgl.createBufferInfoFromArrays(gl, { - a_position: { numComponents: 4, data: [ - -1, -1, 0, 1, - 1, -1, 0, 1, - 1, 1, 0, 1, - -1, -1, 0, 1, - 1, 1, 0, 1, - -1, 1, 0, 1 - ]}, - a_texCoord: { numComponents: 2, data: [ - 0,1, - 0,0, - 1,0, - 0,1, - 0,0, - 1,0 - ]} + a_position: { + numComponents: 4, data: [ + -1, -1, 0, 1, + 1, -1, 0, 1, + 1, 1, 0, 1, + -1, -1, 0, 1, + 1, 1, 0, 1, + -1, 1, 0, 1 + ] + }, + a_texCoord: { + numComponents: 2, data: [ + 0, 1, + 0, 0, + 1, 0, + 0, 1, + 0, 0, + 1, 0 + ] + } }); twgl.setBuffersAndAttributes( @@ -544,14 +548,14 @@ // prettier-ignore inputInfo = { a_position: new Float32Array([ - x1,y1,triAttribs[5],triAttribs[6], - x2,y2,triAttribs[13],triAttribs[14], - x3,y3,triAttribs[21],triAttribs[22] + x1, y1, triAttribs[5], triAttribs[6], + x2, y2, triAttribs[13], triAttribs[14], + x3, y3, triAttribs[21], triAttribs[22] ]), a_color: new Float32Array([ - penColor[0] * triAttribs[2],penColor[1] * triAttribs[3],penColor[2] * triAttribs[4],penColor[3] * triAttribs[7], - penColor[0] * triAttribs[10],penColor[1] * triAttribs[11],penColor[2] * triAttribs[12],penColor[3] * triAttribs[15], - penColor[0] * triAttribs[18],penColor[1] * triAttribs[19],penColor[2] * triAttribs[20],penColor[3] * triAttribs[23] + penColor[0] * triAttribs[2], penColor[1] * triAttribs[3], penColor[2] * triAttribs[4], penColor[3] * triAttribs[7], + penColor[0] * triAttribs[10], penColor[1] * triAttribs[11], penColor[2] * triAttribs[12], penColor[3] * triAttribs[15], + penColor[0] * triAttribs[18], penColor[1] * triAttribs[19], penColor[2] * triAttribs[20], penColor[3] * triAttribs[23] ]) }; } else { @@ -559,14 +563,14 @@ // prettier-ignore inputInfo = { a_position: new Float32Array([ - x1,y1,1,1, - x2,y2,1,1, - x3,y3,1,1 + x1, y1, 1, 1, + x2, y2, 1, 1, + x3, y3, 1, 1 ]), a_color: new Float32Array([ - penColor[0],penColor[1],penColor[2],penColor[3], - penColor[0],penColor[1],penColor[2],penColor[3], - penColor[0],penColor[1],penColor[2],penColor[3] + penColor[0], penColor[1], penColor[2], penColor[3], + penColor[0], penColor[1], penColor[2], penColor[3], + penColor[0], penColor[1], penColor[2], penColor[3] ]) }; } @@ -611,19 +615,19 @@ // prettier-ignore inputInfo = { a_position: new Float32Array([ - x1,y1,triAttribs[5],triAttribs[6], - x2,y2,triAttribs[13],triAttribs[14], - x3,y3,triAttribs[21],triAttribs[22] + x1, y1, triAttribs[5], triAttribs[6], + x2, y2, triAttribs[13], triAttribs[14], + x3, y3, triAttribs[21], triAttribs[22] ]), a_color: new Float32Array([ - triAttribs[2],triAttribs[3],triAttribs[4],triAttribs[7], - triAttribs[10],triAttribs[11],triAttribs[12],triAttribs[15], - triAttribs[18],triAttribs[19],triAttribs[20],triAttribs[23] + triAttribs[2], triAttribs[3], triAttribs[4], triAttribs[7], + triAttribs[10], triAttribs[11], triAttribs[12], triAttribs[15], + triAttribs[18], triAttribs[19], triAttribs[20], triAttribs[23] ]), a_texCoord: new Float32Array([ - triAttribs[0],triAttribs[1], - triAttribs[8],triAttribs[9], - triAttribs[16],triAttribs[17] + triAttribs[0], triAttribs[1], + triAttribs[8], triAttribs[9], + triAttribs[16], triAttribs[17] ]) }; } else { @@ -631,19 +635,19 @@ // prettier-ignore inputInfo = { a_position: new Float32Array([ - x1,y1,1,1, - x2,y2,1,1, - x3,y3,1,1 + x1, y1, 1, 1, + x2, y2, 1, 1, + x3, y3, 1, 1 ]), a_color: new Float32Array([ - 1,1,1,1, - 1,1,1,1, - 1,1,1,1 + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1 ]), a_texCoord: new Float32Array([ - 0,0, - 0,1, - 1,1 + 0, 0, + 0, 1, + 1, 1 ]) }; } @@ -1422,13 +1426,13 @@ blocks: [ { blockType: Scratch.BlockType.LABEL, - text: "Pen Properties", + text: Scratch.translate("Pen Properties"), }, { disableMonitor: true, opcode: "isPenDown", blockType: Scratch.BlockType.BOOLEAN, - text: "pen is down?", + text: Scratch.translate("pen is down?"), arguments: {}, filter: "sprite", }, @@ -1436,7 +1440,7 @@ disableMonitor: true, opcode: "getPenHSV", blockType: Scratch.BlockType.REPORTER, - text: "pen [HSV]", + text: Scratch.translate("pen [HSV]"), arguments: { HSV: { type: Scratch.ArgumentType.STRING, @@ -1450,7 +1454,7 @@ disableMonitor: true, opcode: "drawDot", blockType: Scratch.BlockType.COMMAND, - text: "draw dot at [x] [y]", + text: Scratch.translate("draw dot at [x] [y]"), arguments: { x: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, y: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, @@ -1461,7 +1465,7 @@ disableMonitor: true, opcode: "drawLine", blockType: Scratch.BlockType.COMMAND, - text: "draw line from [x1] [y1] to [x2] [y2]", + text: Scratch.translate("draw line from [x1] [y1] to [x2] [y2]"), arguments: { x1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, y1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, @@ -1474,7 +1478,7 @@ disableMonitor: true, opcode: "stampSprite", blockType: Scratch.BlockType.COMMAND, - text: "stamp [sprite]", + text: Scratch.translate("stamp [sprite]"), arguments: { sprite: { type: Scratch.ArgumentType.STRING, @@ -1485,13 +1489,13 @@ { blockType: Scratch.BlockType.LABEL, - text: "Square Pen Blocks", + text: Scratch.translate("Square Pen Blocks"), }, { disableMonitor: true, opcode: "squareDown", blockType: Scratch.BlockType.COMMAND, - text: "stamp pen square", + text: Scratch.translate("stamp pen square"), arguments: {}, filter: "sprite", }, @@ -1499,7 +1503,9 @@ disableMonitor: true, opcode: "squareTexDown", blockType: Scratch.BlockType.COMMAND, - text: "stamp pen square with the texture of [tex]", + text: Scratch.translate( + "stamp pen square with the texture of [tex]" + ), arguments: { tex: { type: Scratch.ArgumentType.STRING, menu: "costumeMenu" }, }, @@ -1509,7 +1515,7 @@ disableMonitor: true, opcode: "setStampAttribute", blockType: Scratch.BlockType.COMMAND, - text: "set pen square's [target] to [number]", + text: Scratch.translate("set pen square's [target] to [number]"), arguments: { target: { type: Scratch.ArgumentType.NUMBER, @@ -1524,7 +1530,7 @@ disableMonitor: true, opcode: "getStampAttribute", blockType: Scratch.BlockType.REPORTER, - text: "get pen square's [target]", + text: Scratch.translate("get pen square's [target]"), arguments: { target: { type: Scratch.ArgumentType.NUMBER, @@ -1538,7 +1544,7 @@ disableMonitor: true, opcode: "tintSquare", blockType: Scratch.BlockType.COMMAND, - text: "tint pen square to [color]", + text: Scratch.translate("tint pen square to [color]"), arguments: { color: { type: Scratch.ArgumentType.COLOR, @@ -1551,20 +1557,22 @@ disableMonitor: true, opcode: "resetSquareAttributes", blockType: Scratch.BlockType.COMMAND, - text: "reset square Attributes", + text: Scratch.translate("reset square Attributes"), arguments: {}, filter: "sprite", }, { blockType: Scratch.BlockType.LABEL, - text: "Triangle Blocks", + text: Scratch.translate("Triangle Blocks"), }, { disableMonitor: true, opcode: "setTrianglePointAttribute", blockType: Scratch.BlockType.COMMAND, - text: "set triangle point [point]'s [attribute] to [value]", + text: Scratch.translate( + "set triangle point [point]'s [attribute] to [value]" + ), arguments: { point: { type: Scratch.ArgumentType.STRING, @@ -1584,7 +1592,9 @@ disableMonitor: true, opcode: "setWholeTrianglePointAttribute", blockType: Scratch.BlockType.COMMAND, - text: "set triangle's [wholeAttribute] to [value]", + text: Scratch.translate( + "set triangle's [wholeAttribute] to [value]" + ), arguments: { wholeAttribute: { type: Scratch.ArgumentType.NUMBER, @@ -1599,7 +1609,7 @@ disableMonitor: true, opcode: "tintTriPoint", blockType: Scratch.BlockType.COMMAND, - text: "tint triangle point [point] to [color]", + text: Scratch.translate("tint triangle point [point] to [color]"), arguments: { point: { type: Scratch.ArgumentType.STRING, @@ -1617,7 +1627,7 @@ disableMonitor: true, opcode: "tintTri", blockType: Scratch.BlockType.COMMAND, - text: "tint triangle to [color]", + text: Scratch.translate("tint triangle to [color]"), arguments: { point: { type: Scratch.ArgumentType.STRING, @@ -1635,7 +1645,7 @@ disableMonitor: true, opcode: "getTrianglePointAttribute", blockType: Scratch.BlockType.REPORTER, - text: "get triangle point [point]'s [attribute]", + text: Scratch.translate("get triangle point [point]'s [attribute]"), arguments: { point: { type: Scratch.ArgumentType.STRING, @@ -1654,7 +1664,7 @@ disableMonitor: true, opcode: "resetWholeTriangleAttributes", blockType: Scratch.BlockType.COMMAND, - text: "reset triangle attributes", + text: Scratch.translate("reset triangle attributes"), arguments: {}, filter: "sprite", }, @@ -1662,7 +1672,9 @@ disableMonitor: true, opcode: "drawSolidTri", blockType: Scratch.BlockType.COMMAND, - text: "draw triangle between [x1] [y1], [x2] [y2] and [x3] [y3]", + text: Scratch.translate( + "draw triangle between [x1] [y1], [x2] [y2] and [x3] [y3]" + ), arguments: { x1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, y1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, @@ -1677,7 +1689,9 @@ disableMonitor: true, opcode: "drawTexTri", blockType: Scratch.BlockType.COMMAND, - text: "draw textured triangle between [x1] [y1], [x2] [y2] and [x3] [y3] with the texture [tex]", + text: Scratch.translate( + "draw textured triangle between [x1] [y1], [x2] [y2] and [x3] [y3] with the texture [tex]" + ), arguments: { x1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, y1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, @@ -1692,13 +1706,13 @@ { blockType: Scratch.BlockType.LABEL, - text: "Color", + text: Scratch.translate("Color"), }, { disableMonitor: true, opcode: "RGB2HEX", blockType: Scratch.BlockType.REPORTER, - text: "red [R] green [G] blue [B]", + text: Scratch.translate("red [R] green [G] blue [B]"), arguments: { R: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, G: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, @@ -1709,7 +1723,7 @@ disableMonitor: true, opcode: "HSV2RGB", blockType: Scratch.BlockType.REPORTER, - text: "hue [H] saturation [S] value [V]", + text: Scratch.translate("hue [H] saturation [S] value [V]"), arguments: { H: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, S: { type: Scratch.ArgumentType.NUMBER, defaultValue: 100 }, @@ -1718,14 +1732,16 @@ }, { blockType: Scratch.BlockType.LABEL, - text: "Images", + text: Scratch.translate("Images"), }, //Useless block keep for compat { disableMonitor: true, opcode: "setDURIclampmode", blockType: Scratch.BlockType.COMMAND, - text: "set imported image wrap mode to [clampMode]", + text: Scratch.translate( + "set imported image wrap mode to [clampMode]" + ), hideFromPalette: true, arguments: { clampMode: { @@ -1739,7 +1755,9 @@ disableMonitor: true, opcode: "addBlankIMG", blockType: Scratch.BlockType.COMMAND, - text: "add blank image that is [color] and the size of [width], [height] named [name] to Pen+ Library", + text: Scratch.translate( + "add blank image that is [color] and the size of [width], [height] named [name] to Pen+ Library" + ), arguments: { color: { type: Scratch.ArgumentType.COLOR, @@ -1757,7 +1775,9 @@ disableMonitor: true, opcode: "addIMGfromDURI", blockType: Scratch.BlockType.COMMAND, - text: "add image named [name] from [dataURI] to Pen+ Library", + text: Scratch.translate( + "add image named [name] from [dataURI] to Pen+ Library" + ), arguments: { dataURI: { type: Scratch.ArgumentType.STRING, @@ -1774,7 +1794,9 @@ disableMonitor: true, opcode: "removeIMGfromDURI", blockType: Scratch.BlockType.COMMAND, - text: "remove image named [name] from Pen+ Library", + text: Scratch.translate( + "remove image named [name] from Pen+ Library" + ), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -1787,7 +1809,7 @@ disableMonitor: true, opcode: "doesIMGexist", blockType: Scratch.BlockType.BOOLEAN, - text: "does [name] exist in Pen+ Library", + text: Scratch.translate("does [name] exist in Pen+ Library"), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -1801,7 +1823,7 @@ disableMonitor: true, opcode: "getCostumeDataURI", blockType: Scratch.BlockType.REPORTER, - text: "get data uri for costume [costume]", + text: Scratch.translate("get data uri for costume [costume]"), arguments: { costume: { type: Scratch.ArgumentType.STRING, @@ -1814,7 +1836,9 @@ disableMonitor: true, opcode: "getDimensionOf", blockType: Scratch.BlockType.REPORTER, - text: "get the [dimension] of [costume] in pen+ costume library", + text: Scratch.translate( + "get the [dimension] of [costume] in pen+ costume library" + ), arguments: { dimension: { type: Scratch.ArgumentType.STRING, @@ -1832,7 +1856,9 @@ disableMonitor: true, opcode: "setpixelcolor", blockType: Scratch.BlockType.COMMAND, - text: "set pixel [x] [y]'s color to [color] in [costume]", + text: Scratch.translate( + "set pixel [x] [y]'s color to [color] in [costume]" + ), arguments: { x: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, y: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, @@ -1850,7 +1876,7 @@ disableMonitor: true, opcode: "getpixelcolor", blockType: Scratch.BlockType.REPORTER, - text: "get pixel [x] [y]'s color in [costume]", + text: Scratch.translate("get pixel [x] [y]'s color in [costume]"), arguments: { x: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, y: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, @@ -1864,7 +1890,9 @@ disableMonitor: true, opcode: "getPenPlusCostumeURI", blockType: Scratch.BlockType.REPORTER, - text: "get data uri of [costume] in the pen+ costume library", + text: Scratch.translate( + "get data uri of [costume] in the pen+ costume library" + ), arguments: { costume: { type: Scratch.ArgumentType.STRING, @@ -1875,34 +1903,36 @@ { blockType: Scratch.BlockType.LABEL, - text: "Advanced", + text: Scratch.translate("Advanced"), }, //Custom Shader Blocks { blockType: Scratch.BlockType.LABEL, - text: "Custom Shaders", + text: Scratch.translate("Custom Shaders"), }, { blockType: Scratch.BlockType.BUTTON, func: "openShaderEditor", - text: "Shader Editor", + text: Scratch.translate("Shader Editor"), }, { blockType: Scratch.BlockType.BUTTON, func: "openShaderManager", - text: "Shader Manager", + text: Scratch.translate("Shader Manager"), }, { blockType: Scratch.BlockType.REPORTER, opcode: "getAllShaders", - text: "shaders in project", + text: Scratch.translate("shaders in project"), }, { disableMonitor: true, opcode: "drawShaderTri", blockType: Scratch.BlockType.COMMAND, - text: "draw triangle using [shader] between [x1] [y1], [x2] [y2] and [x3] [y3]", + text: Scratch.translate( + "draw triangle using [shader] between [x1] [y1], [x2] [y2] and [x3] [y3]" + ), arguments: { shader: { type: Scratch.ArgumentType.STRING, @@ -1921,7 +1951,7 @@ disableMonitor: true, opcode: "drawShaderSquare", blockType: Scratch.BlockType.COMMAND, - text: "draw square using [shader]", + text: Scratch.translate("draw square using [shader]"), arguments: { shader: { type: Scratch.ArgumentType.STRING, @@ -1940,7 +1970,9 @@ { opcode: "setTextureInShader", blockType: Scratch.BlockType.COMMAND, - text: "set texture [uniformName] in [shader] to [texture]", + text: Scratch.translate( + "set texture [uniformName] in [shader] to [texture]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -1959,7 +1991,9 @@ { opcode: "setNumberInShader", blockType: Scratch.BlockType.COMMAND, - text: "set number [uniformName] in [shader] to [number]", + text: Scratch.translate( + "set number [uniformName] in [shader] to [number]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -1975,7 +2009,9 @@ { opcode: "setVec2InShader", blockType: Scratch.BlockType.COMMAND, - text: "set vector 2 [uniformName] in [shader] to [numberX] [numberY]", + text: Scratch.translate( + "set vector 2 [uniformName] in [shader] to [numberX] [numberY]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -1992,7 +2028,9 @@ { opcode: "setVec3InShader", blockType: Scratch.BlockType.COMMAND, - text: "set vector 3 [uniformName] in [shader] to [numberX] [numberY] [numberZ]", + text: Scratch.translate( + "set vector 3 [uniformName] in [shader] to [numberX] [numberY] [numberZ]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -2010,7 +2048,9 @@ { opcode: "setVec4InShader", blockType: Scratch.BlockType.COMMAND, - text: "set vector 4 [uniformName] in [shader] to [numberX] [numberY] [numberZ] [numberW]", + text: Scratch.translate( + "set vector 4 [uniformName] in [shader] to [numberX] [numberY] [numberZ] [numberW]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -2029,7 +2069,9 @@ { opcode: "setMatrixInShader", blockType: Scratch.BlockType.COMMAND, - text: "set matrix [uniformName] in [shader] to [list]", + text: Scratch.translate( + "set matrix [uniformName] in [shader] to [list]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -2045,7 +2087,9 @@ { opcode: "setMatrixInShaderArray", blockType: Scratch.BlockType.COMMAND, - text: "set matrix [uniformName] in [shader] to [array]", + text: Scratch.translate( + "set matrix [uniformName] in [shader] to [array]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -2064,7 +2108,9 @@ { opcode: "setCubeInShader", blockType: Scratch.BlockType.COMMAND, - text: "set cubemap [uniformName] in [shader] to [cubemap]", + text: Scratch.translate( + "set cubemap [uniformName] in [shader] to [cubemap]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -2083,7 +2129,9 @@ { opcode: "getNumberInShader", blockType: Scratch.BlockType.REPORTER, - text: "get value of number [uniformName] in [shader]", + text: Scratch.translate( + "get value of number [uniformName] in [shader]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -2098,7 +2146,9 @@ { opcode: "getVec2InShader", blockType: Scratch.BlockType.REPORTER, - text: "get value of [component] in vector 2 [uniformName] in [shader]", + text: Scratch.translate( + "get value of [component] in vector 2 [uniformName] in [shader]" + ), arguments: { component: { type: Scratch.ArgumentType.STRING, @@ -2117,7 +2167,9 @@ { opcode: "getVec3InShader", blockType: Scratch.BlockType.REPORTER, - text: "get value of [component] in vector 3 [uniformName] in [shader]", + text: Scratch.translate( + "get value of [component] in vector 3 [uniformName] in [shader]" + ), arguments: { component: { type: Scratch.ArgumentType.STRING, @@ -2136,7 +2188,9 @@ { opcode: "getVec4InShader", blockType: Scratch.BlockType.REPORTER, - text: "get value of [component] in vector 4 [uniformName] in [shader]", + text: Scratch.translate( + "get value of [component] in vector 4 [uniformName] in [shader]" + ), arguments: { component: { type: Scratch.ArgumentType.STRING, @@ -2155,7 +2209,9 @@ { opcode: "getMatrixInShader", blockType: Scratch.BlockType.REPORTER, - text: "get value of matrix [uniformName] in [shader] as an array", + text: Scratch.translate( + "get value of matrix [uniformName] in [shader] as an array" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -2170,7 +2226,9 @@ { opcode: "getTextureInShader", blockType: Scratch.BlockType.REPORTER, - text: "get the texture of [uniformName] in [shader]", + text: Scratch.translate( + "get the texture of [uniformName] in [shader]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -2185,7 +2243,9 @@ { opcode: "getCubemapInShader", blockType: Scratch.BlockType.REPORTER, - text: "get the cubemap of [uniformName] in [shader]", + text: Scratch.translate( + "get the cubemap of [uniformName] in [shader]" + ), arguments: { uniformName: { type: Scratch.ArgumentType.STRING, @@ -2201,7 +2261,9 @@ { opcode: "setArrayNumberInShader", blockType: Scratch.BlockType.COMMAND, - text: "set item [item] in number array [uniformName] in [shader] to [number]", + text: Scratch.translate( + "set item [item] in number array [uniformName] in [shader] to [number]" + ), arguments: { item: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, uniformName: { @@ -2218,7 +2280,9 @@ { opcode: "setArrayVec2InShader", blockType: Scratch.BlockType.COMMAND, - text: "set item [item] in vector 2 array [uniformName] in [shader] to [numberX] [numberY]", + text: Scratch.translate( + "set item [item] in vector 2 array [uniformName] in [shader] to [numberX] [numberY]" + ), arguments: { item: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, uniformName: { @@ -2236,7 +2300,9 @@ { opcode: "setArrayVec3InShader", blockType: Scratch.BlockType.COMMAND, - text: "set item [item] in vector 3 array [uniformName] in [shader] to [numberX] [numberY] [numberZ]", + text: Scratch.translate( + "set item [item] in vector 3 array [uniformName] in [shader] to [numberX] [numberY] [numberZ]" + ), arguments: { item: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, uniformName: { @@ -2255,7 +2321,9 @@ { opcode: "setArrayVec4InShader", blockType: Scratch.BlockType.COMMAND, - text: "set item [item] in vector 4 array [uniformName] in [shader] to [numberX] [numberY] [numberZ] [numberW]", + text: Scratch.translate( + "set item [item] in vector 4 array [uniformName] in [shader] to [numberX] [numberY] [numberZ] [numberW]" + ), arguments: { item: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, uniformName: { @@ -2275,7 +2343,9 @@ { opcode: "getArrayNumberInShader", blockType: Scratch.BlockType.REPORTER, - text: "get item [item]'s value in number array [uniformName] in [shader]", + text: Scratch.translate( + "get item [item]'s value in number array [uniformName] in [shader]" + ), arguments: { item: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, uniformName: { @@ -2291,7 +2361,9 @@ { opcode: "getArrayVec2InShader", blockType: Scratch.BlockType.REPORTER, - text: "get item [item]'s [component] value in vector 2 array [uniformName] in [shader]", + text: Scratch.translate( + "get item [item]'s [component] value in vector 2 array [uniformName] in [shader]" + ), arguments: { item: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, component: { @@ -2311,7 +2383,9 @@ { opcode: "getArrayVec3InShader", blockType: Scratch.BlockType.REPORTER, - text: "get item [item]'s [component] value in vector 3 array [uniformName] in [shader]", + text: Scratch.translate( + "get item [item]'s [component] value in vector 3 array [uniformName] in [shader]" + ), arguments: { item: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, component: { @@ -2331,7 +2405,9 @@ { opcode: "getArrayVec4InShader", blockType: Scratch.BlockType.REPORTER, - text: "get item [item]'s [component] value in vector 4 array [uniformName] in [shader]", + text: Scratch.translate( + "get item [item]'s [component] value in vector 4 array [uniformName] in [shader]" + ), arguments: { item: { type: Scratch.ArgumentType.NUMBER, defaultValue: 1 }, component: { @@ -2352,7 +2428,9 @@ { opcode: "setNumberAttributeInShader", blockType: Scratch.BlockType.COMMAND, - text: "set number attribute [attributeName] of point [pointID] in [shader] to [number]", + text: Scratch.translate( + "set number attribute [attributeName] of point [pointID] in [shader] to [number]" + ), arguments: { attributeName: { type: Scratch.ArgumentType.STRING, @@ -2373,7 +2451,9 @@ { opcode: "setVec2AttributeInShader", blockType: Scratch.BlockType.COMMAND, - text: "set vector 2 attribute [attributeName] of point [pointID] in [shader] to [numberX] [numberY]", + text: Scratch.translate( + "set vector 2 attribute [attributeName] of point [pointID] in [shader] to [numberX] [numberY]" + ), arguments: { attributeName: { type: Scratch.ArgumentType.STRING, @@ -2395,7 +2475,9 @@ { opcode: "setVec3AttributeInShader", blockType: Scratch.BlockType.COMMAND, - text: "set vector 3 attribute [attributeName] of point [pointID] in [shader] to [numberX] [numberY] [numberZ]", + text: Scratch.translate( + "set vector 3 attribute [attributeName] of point [pointID] in [shader] to [numberX] [numberY] [numberZ]" + ), arguments: { attributeName: { type: Scratch.ArgumentType.STRING, @@ -2418,7 +2500,9 @@ { opcode: "setVec4AttributeInShader", blockType: Scratch.BlockType.COMMAND, - text: "set vector 4 attribute [attributeName] of point [pointID] in [shader] to [numberX] [numberY] [numberZ] [numberW]", + text: Scratch.translate( + "set vector 4 attribute [attributeName] of point [pointID] in [shader] to [numberX] [numberY] [numberZ] [numberW]" + ), arguments: { attributeName: { type: Scratch.ArgumentType.STRING, @@ -2441,12 +2525,14 @@ }, { blockType: Scratch.BlockType.LABEL, - text: "Cubemaps", + text: Scratch.translate("Cubemaps"), }, { opcode: "createCubemap", blockType: Scratch.BlockType.COMMAND, - text: "create cubemap named [name] from left [left] right [right] back [back] front [front] bottom [bottom] top [top]", + text: Scratch.translate( + "create cubemap named [name] from left [left] right [right] back [back] front [front] bottom [bottom] top [top]" + ), arguments: { name: { type: Scratch.ArgumentType.STRING, defaultValue: "Name" }, left: { type: Scratch.ArgumentType.STRING, menu: "costumeMenu" }, @@ -2465,7 +2551,7 @@ disableMonitor: true, opcode: "doesCubemapexist", blockType: Scratch.BlockType.BOOLEAN, - text: "does [name] exist as a cubemap", + text: Scratch.translate("does [name] exist as a cubemap"), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -2478,7 +2564,7 @@ disableMonitor: true, opcode: "removeCubemapfromDURI", blockType: Scratch.BlockType.COMMAND, - text: "remove cubemap named [name]", + text: Scratch.translate("remove cubemap named [name]"), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -2490,12 +2576,12 @@ { blockType: Scratch.BlockType.LABEL, - text: "List Based Rendering", + text: Scratch.translate("List Based Rendering"), }, { opcode: "renderSolidTrisFromList", blockType: Scratch.BlockType.COMMAND, - text: "draw solid triangles from list [list]", + text: Scratch.translate("draw solid triangles from list [list]"), arguments: { list: { type: Scratch.ArgumentType.STRING, menu: "listMenu" }, }, @@ -2504,7 +2590,9 @@ { opcode: "renderTexturedTrisFromList", blockType: Scratch.BlockType.COMMAND, - text: "draw textured triangles from list [list] using [tex]", + text: Scratch.translate( + "draw textured triangles from list [list] using [tex]" + ), arguments: { list: { type: Scratch.ArgumentType.STRING, menu: "listMenu" }, tex: { type: Scratch.ArgumentType.STRING, menu: "costumeMenu" }, @@ -2514,7 +2602,9 @@ { opcode: "renderShaderTrisFromList", blockType: Scratch.BlockType.COMMAND, - text: "draw shader triangles from list [list] using [shader]", + text: Scratch.translate( + "draw shader triangles from list [list] using [shader]" + ), arguments: { list: { type: Scratch.ArgumentType.STRING, menu: "listMenu" }, shader: { @@ -2528,7 +2618,9 @@ { opcode: "solidTriDef", blockType: Scratch.BlockType.REPORTER, - text: "define solid tri [x1] [y1] [c1], [x2] [y2] [c2] and [x3] [y3] [c3]", + text: Scratch.translate( + "define solid tri [x1] [y1] [c1], [x2] [y2] [c2] and [x3] [y3] [c3]" + ), arguments: { x1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, y1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, @@ -2545,7 +2637,9 @@ { opcode: "texTriDef", blockType: Scratch.BlockType.REPORTER, - text: "define textured tri [x1] [y1] [c1], [x2] [y2] [c2] and [x3] [y3] [c3] with the uv's [u1] [v1], [u2] [v2] and [u3] [v3]", + text: Scratch.translate( + "define textured tri [x1] [y1] [c1], [x2] [y2] [c2] and [x3] [y3] [c3] with the uv's [u1] [v1], [u2] [v2] and [u3] [v3]" + ), arguments: { x1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, y1: { type: Scratch.ArgumentType.NUMBER, defaultValue: 0 }, @@ -2571,7 +2665,9 @@ { opcode: "editTriDef", blockType: Scratch.BlockType.REPORTER, - text: "set the [attribute] of point [id] to [value] in [def]", + text: Scratch.translate( + "set the [attribute] of point [id] to [value] in [def]" + ), arguments: { attribute: { type: Scratch.ArgumentType.STRING, @@ -2594,12 +2690,12 @@ { blockType: Scratch.BlockType.LABEL, - text: "Render Textures", + text: Scratch.translate("Render Textures"), }, { opcode: "createRenderTexture", blockType: Scratch.BlockType.COMMAND, - text: "create render texture named [name]", + text: Scratch.translate("create render texture named [name]"), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -2610,7 +2706,9 @@ { opcode: "createRenderTextureOfSize", blockType: Scratch.BlockType.COMMAND, - text: "create render texture named [name] of size [width] [height]", + text: Scratch.translate( + "create render texture named [name] of size [width] [height]" + ), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -2623,7 +2721,7 @@ { opcode: "removeRenderTexture", blockType: Scratch.BlockType.COMMAND, - text: "remove render texture named [name]", + text: Scratch.translate("remove render texture named [name]"), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -2634,7 +2732,7 @@ { opcode: "doesRenderTextureExist", blockType: Scratch.BlockType.BOOLEAN, - text: "does render texture named [name] exist?", + text: Scratch.translate("does render texture named [name] exist?"), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -2645,13 +2743,13 @@ { opcode: "getRenderTextures", blockType: Scratch.BlockType.REPORTER, - text: "render textures", + text: Scratch.translate("render textures"), }, "---", { opcode: "targetRenderTexture", blockType: Scratch.BlockType.COMMAND, - text: "render tris and squares to [name]", + text: Scratch.translate("render tris and squares to [name]"), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -2662,7 +2760,7 @@ { opcode: "clearRenderTexture", blockType: Scratch.BlockType.COMMAND, - text: "clear pen from [name]", + text: Scratch.translate("clear pen from [name]"), arguments: { name: { type: Scratch.ArgumentType.STRING, @@ -2673,29 +2771,31 @@ { blockType: Scratch.BlockType.LABEL, - text: "Extras", + text: Scratch.translate("Extras"), }, { opcode: "getPenPVersion", blockType: Scratch.BlockType.REPORTER, - text: "Pen+ version", + text: Scratch.translate("Pen+ version"), + disableMonitor: true, }, { opcode: "getTrianglesDrawn", blockType: Scratch.BlockType.REPORTER, - text: "triangles drawn", + text: Scratch.translate("triangles drawn"), + disableMonitor: true, }, { opcode: "getPenRenderLayer", blockType: Scratch.BlockType.REPORTER, - text: "data uri of pen layer", + text: Scratch.translate("data uri of pen layer"), disableMonitor: true, }, "---", { opcode: "setCullMode", blockType: Scratch.BlockType.COMMAND, - text: "hide triangles that turn [direction]", + text: Scratch.translate("hide triangles that turn [direction]"), arguments: { direction: { type: Scratch.ArgumentType.STRING, @@ -2707,7 +2807,7 @@ disableMonitor: true, opcode: "setTriangleFilterMode", blockType: Scratch.BlockType.COMMAND, - text: "set texture filter mode to [filter]", + text: Scratch.translate("set texture filter mode to [filter]"), arguments: { filter: { type: Scratch.ArgumentType.NUMBER, @@ -2721,7 +2821,9 @@ { opcode: "turnAdvancedSettingOff", blockType: Scratch.BlockType.COMMAND, - text: "turn advanced setting [Setting] [onOrOff]", + text: Scratch.translate( + "turn advanced setting [Setting] [onOrOff]" + ), arguments: { Setting: { type: Scratch.ArgumentType.STRING, @@ -2733,13 +2835,13 @@ { opcode: "clearDepth", blockType: Scratch.BlockType.COMMAND, - text: "Erase Depth", + text: Scratch.translate("Erase Depth"), }, { hideFromPalette: true, opcode: "setAdvancedOptionValueTo", blockType: Scratch.BlockType.COMMAND, - text: "set [setting] to [value]", + text: Scratch.translate("set [setting] to [value]"), arguments: { setting: { type: Scratch.ArgumentType.STRING, @@ -2754,7 +2856,7 @@ { opcode: "setPrefix", blockType: Scratch.BlockType.COMMAND, - text: "set the prefix for [prefix] to [value]", + text: Scratch.translate("set the prefix for [prefix] to [value]"), arguments: { prefix: { type: Scratch.ArgumentType.STRING, @@ -2770,72 +2872,102 @@ menus: { hsvMenu: { items: [ - "color", - "saturation", - "brightness", - "transparency", - "hex code", - "size", + { + text: Scratch.translate("color"), + value: "color", + }, + { + text: Scratch.translate("saturation"), + value: "saturation", + }, + { + text: Scratch.translate("brightness"), + value: "brightness", + }, + { + text: Scratch.translate("transparency"), + value: "transparency", + }, + { + text: Scratch.translate("hex code"), + value: "hex code", + }, + { + text: Scratch.translate("size"), + value: "size", + }, ], acceptReporters: true, }, stampSquare: { items: [ - { text: "Width", value: "0" }, - { text: "Height", value: "1" }, - { text: "Rotation", value: "2" }, - { text: "U-Multiplier", value: "3" }, - { text: "U-Offset", value: "4" }, - { text: "V-Multiplier", value: "5" }, - { text: "V-Offset", value: "6" }, - { text: "Red Tint", value: "7" }, - { text: "Green Tint", value: "8" }, - { text: "Blue Tint", value: "9" }, - { text: "Transparency", value: "10" }, - { text: "depth value", value: "11" }, + { text: Scratch.translate("Width"), value: "0" }, + { text: Scratch.translate("Height"), value: "1" }, + { text: Scratch.translate("Rotation"), value: "2" }, + { text: Scratch.translate("U-Multiplier"), value: "3" }, + { text: Scratch.translate("U-Offset"), value: "4" }, + { text: Scratch.translate("V-Multiplier"), value: "5" }, + { text: Scratch.translate("V-Offset"), value: "6" }, + { text: Scratch.translate("Red Tint"), value: "7" }, + { text: Scratch.translate("Green Tint"), value: "8" }, + { text: Scratch.translate("Blue Tint"), value: "9" }, + { text: Scratch.translate("Transparency"), value: "10" }, + { text: Scratch.translate("depth value"), value: "11" }, ], acceptReporters: true, }, triAttribute: { items: [ - { text: "U value", value: "0" }, - { text: "V value", value: "1" }, - { text: "red tint", value: "2" }, - { text: "green tint", value: "3" }, - { text: "blue tint", value: "4" }, - { text: "transparency", value: "7" }, - { text: "corner pinch", value: "6" }, - { text: "depth value", value: "5" }, + { text: Scratch.translate("U value"), value: "0" }, + { text: Scratch.translate("V value"), value: "1" }, + { text: Scratch.translate("red tint"), value: "2" }, + { text: Scratch.translate("green tint"), value: "3" }, + { text: Scratch.translate("blue tint"), value: "4" }, + { text: Scratch.translate("transparency"), value: "7" }, + { text: Scratch.translate("corner pinch"), value: "6" }, + { text: Scratch.translate("depth value"), value: "5" }, ], acceptReporters: true, }, wholeTriAttribute: { items: [ - { text: "red tint", value: "2" }, - { text: "green tint", value: "3" }, - { text: "blue tint", value: "4" }, - { text: "transparency", value: "7" }, - { text: "depth value", value: "5" }, + { text: Scratch.translate("red tint"), value: "2" }, + { text: Scratch.translate("green tint"), value: "3" }, + { text: Scratch.translate("blue tint"), value: "4" }, + { text: Scratch.translate("transparency"), value: "7" }, + { text: Scratch.translate("depth value"), value: "5" }, ], acceptReporters: true, }, filterType: { items: [ - { text: "Closest", value: "9728" }, - { text: "Linear", value: "9729" }, + { text: Scratch.translate("Closest"), value: "9728" }, + { text: Scratch.translate("Linear"), value: "9729" }, ], acceptReporters: true, }, wrapType: { items: [ - { text: "Clamp", value: "33071" }, - { text: "Repeat", value: "10497" }, - { text: "Mirrored", value: "33648" }, + { text: Scratch.translate("Clamp"), value: "33071" }, + { text: Scratch.translate("Repeat"), value: "10497" }, + { text: Scratch.translate("Mirrored"), value: "33648" }, ], acceptReporters: true, }, pointMenu: { items: ["1", "2", "3"], acceptReporters: true }, - onOffMenu: { items: ["on", "off"], acceptReporters: true }, + onOffMenu: { + items: [ + { + text: Scratch.translate("on"), + value: "on", + }, + { + text: Scratch.translate("off"), + value: "off", + }, + ], + acceptReporters: true, + }, costumeMenu: { items: "costumeMenuFunction", acceptReporters: true }, penPlusCostumes: { items: "penPlusCostumesFunction", @@ -2855,13 +2987,24 @@ }, advancedSettingsMenu: { items: [ - { text: "allow 'Corner Pinch < 1'", value: "wValueUnderFlow" }, - { text: "clamp depth value", value: "_ClampZ" }, + { + text: Scratch.translate("allow 'Corner Pinch < 1'"), + value: "wValueUnderFlow", + }, + { + text: Scratch.translate("clamp depth value"), + value: "_ClampZ", + }, ], acceptReporters: true, }, advancedSettingValuesMenu: { - items: [{ text: "maximum depth value", value: "depthMax" }], + items: [ + { + text: Scratch.translate("maximum depth value"), + value: "depthMax", + }, + ], acceptReporters: false, }, getCostumeDataURI_costume_Menu: { @@ -2869,7 +3012,16 @@ acceptReporters: true, }, getDimensionOf_dimension_Menu: { - items: ["width", "height"], + items: [ + { + text: Scratch.translate("width"), + value: "width", + }, + { + text: Scratch.translate("height"), + value: "height", + }, + ], acceptReporters: true, }, listMenu: { @@ -2906,9 +3058,9 @@ }, cullMode: { items: [ - { text: "neither way", value: "0" }, - { text: "clock-wise", value: "1028" }, - { text: "counter clock-wise", value: "1029" }, + { text: Scratch.translate("neither way"), value: "0" }, + { text: Scratch.translate("clock-wise"), value: "1028" }, + { text: Scratch.translate("counter clock-wise"), value: "1029" }, ], acceptReporters: true, }, @@ -2919,11 +3071,11 @@ prefixTypes: { items: [ { - text: "Pen+ Costumes", + text: Scratch.translate("Pen+ Costumes"), value: "penPlusTextures", }, { - text: "Render Textures", + text: Scratch.translate("Render Textures"), value: "renderTextures", }, ], @@ -2931,21 +3083,51 @@ }, defAttribMenu: { items: [ - "x", - "y", - "depth value", - "corner pinch", - "U value", - "V value", - "red tint", - "green tint", - "blue tint", - "transparency", + { + text: Scratch.translate("x"), + value: "x", + }, + { + text: Scratch.translate("y"), + value: "y", + }, + { + text: Scratch.translate("depth value"), + value: "depth value", + }, + { + text: Scratch.translate("corner pinch"), + value: "corner pinch", + }, + { + text: Scratch.translate("U value"), + value: "U value", + }, + { + text: Scratch.translate("V value"), + value: "V value", + }, + { + text: Scratch.translate("red tint"), + value: "red tint", + }, + { + text: Scratch.translate("green tint"), + value: "green tint", + }, + { + text: Scratch.translate("blue tint"), + value: "blue tint", + }, + { + text: Scratch.translate("transparency"), + value: "transparency", + }, ], acceptReporters: true, }, }, - name: "Pen+ V7", + name: Scratch.translate("Pen+ V7"), id: "penP", docsURI: "https://pen-group.github.io/docs/?page=extensions%2FpenPlus%2Fmain", @@ -4182,43 +4364,55 @@ if (triAttribs) { //Just for our eyes sakes // prettier-ignore - inputInfo.a_position = {data: [ - x1,-y1,triAttribs[5],triAttribs[6], - x2,-y2,triAttribs[13],triAttribs[14], - x3,-y3,triAttribs[21],triAttribs[22] - ]} + inputInfo.a_position = { + data: [ + x1, -y1, triAttribs[5], triAttribs[6], + x2, -y2, triAttribs[13], triAttribs[14], + x3, -y3, triAttribs[21], triAttribs[22] + ] + } // prettier-ignore - inputInfo.a_color = {data: [ - triAttribs[2],triAttribs[3],triAttribs[4],triAttribs[7], - triAttribs[10],triAttribs[11],triAttribs[12],triAttribs[15], - triAttribs[18],triAttribs[19],triAttribs[20],triAttribs[23] - ]} + inputInfo.a_color = { + data: [ + triAttribs[2], triAttribs[3], triAttribs[4], triAttribs[7], + triAttribs[10], triAttribs[11], triAttribs[12], triAttribs[15], + triAttribs[18], triAttribs[19], triAttribs[20], triAttribs[23] + ] + } // prettier-ignore - inputInfo.a_texCoord = {data:[ - triAttribs[0],triAttribs[1], - triAttribs[8],triAttribs[9], - triAttribs[16],triAttribs[17] - ]} + inputInfo.a_texCoord = { + data: [ + triAttribs[0], triAttribs[1], + triAttribs[8], triAttribs[9], + triAttribs[16], triAttribs[17] + ] + } } else { //Just for our eyes sakes // prettier-ignore - inputInfo.a_position = {data: [ - x1,y1,1,1, - x2,y2,1,1, - x3,y3,1,1 - ]} + inputInfo.a_position = { + data: [ + x1, y1, 1, 1, + x2, y2, 1, 1, + x3, y3, 1, 1 + ] + } // prettier-ignore - inputInfo.a_color = {data: [ - 1,1,1,1, - 1,1,1,1, - 1,1,1,1 - ]} + inputInfo.a_color = { + data: [ + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1 + ] + } // prettier-ignore - inputInfo.a_texCoord = {data: [ - 0,0, - 0,1, - 1,1 - ]} + inputInfo.a_texCoord = { + data: [ + 0, 0, + 0, 1, + 1, 1 + ] + } } const keys = Object.keys(inputInfo); diff --git a/extensions/shreder95ua/resolution.js b/extensions/shreder95ua/resolution.js index 26867327a5..541132e0d5 100644 --- a/extensions/shreder95ua/resolution.js +++ b/extensions/shreder95ua/resolution.js @@ -11,19 +11,19 @@ getInfo() { return { id: "shreder95resolution", - name: "Screen resolution", + name: Scratch.translate("Screen resolution"), color1: "#FFAB19", color2: "#EC9C13", color3: "#CF8B17", blocks: [ { opcode: "getWidth", - text: "primary screen width", + text: Scratch.translate("primary screen width"), blockType: Scratch.BlockType.REPORTER, }, { opcode: "getHeight", - text: "primary screen height", + text: Scratch.translate("primary screen height"), blockType: Scratch.BlockType.REPORTER, }, ],