Skip to content

Commit

Permalink
Add translations to more extensions (#1526)
Browse files Browse the repository at this point in the history
  • Loading branch information
qxsck authored Jun 10, 2024
1 parent 823b884 commit b4721f4
Show file tree
Hide file tree
Showing 16 changed files with 1,154 additions and 522 deletions.
99 changes: 91 additions & 8 deletions extensions/JeremyGamer13/tween.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand All @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -375,19 +383,94 @@
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
items: "getVariables",
},
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",
},
],
},
},
};
Expand Down
56 changes: 29 additions & 27 deletions extensions/Lily/ListTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
getInfo() {
return {
id: "lmsData",
name: "List Tools",
name: Scratch.translate("List Tools"),
color1: "#ff661a",
color2: "#f2590d",
color3: "#e64d00",
blocks: [
{
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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -166,7 +168,7 @@
{
opcode: "listIsEmpty",
blockType: Scratch.BlockType.BOOLEAN,
text: "[LIST] is empty?",
text: Scratch.translate("[LIST] is empty?"),
disableMonitor: true,
arguments: {
LIST: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -316,7 +318,7 @@
{
opcode: "getListArray",
blockType: Scratch.BlockType.REPORTER,
text: "[LIST] as array",
text: Scratch.translate("[LIST] as array"),
disableMonitor: true,
arguments: {
LIST: {
Expand Down Expand Up @@ -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",
},
],
Expand All @@ -369,11 +371,11 @@
acceptReporters: false,
items: [
{
text: "ascending",
text: Scratch.translate("ascending"),
value: "ascending",
},
{
text: "descending",
text: Scratch.translate("descending"),
value: "descending",
},
],
Expand All @@ -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",
},
],
Expand Down
Loading

0 comments on commit b4721f4

Please sign in to comment.