Skip to content

Commit

Permalink
Add translations to TempVar, TempVar2, ClonesPlus (#1477)
Browse files Browse the repository at this point in the history
  • Loading branch information
qxsck authored May 19, 2024
1 parent a7999c2 commit 02e255b
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 53 deletions.
81 changes: 51 additions & 30 deletions extensions/Lily/ClonesPlus.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
getInfo() {
return {
id: "lmsclonesplus",
name: "Clones+",
name: Scratch.translate("Clones+"),
color1: "#FFAB19",
color2: "#EC9C13",
color3: "#CF8B17",
Expand All @@ -57,7 +57,9 @@
{
opcode: "whenCloneStartsWithVar",
blockType: Scratch.BlockType.HAT,
text: "when I start as a clone with [INPUTA] set to [INPUTB]",
text: Scratch.translate(
"when I start as a clone with [INPUTA] set to [INPUTB]"
),
filter: [Scratch.TargetType.SPRITE],
arguments: {
INPUTA: {
Expand All @@ -74,7 +76,9 @@
{
opcode: "createCloneWithVar",
blockType: Scratch.BlockType.COMMAND,
text: "create clone with [INPUTA] set to [INPUTB]",
text: Scratch.translate(
"create clone with [INPUTA] set to [INPUTB]"
),
filter: [Scratch.TargetType.SPRITE],
arguments: {
INPUTA: {
Expand All @@ -94,7 +98,9 @@
{
opcode: "touchingCloneWithVar",
blockType: Scratch.BlockType.BOOLEAN,
text: "touching clone with [INPUTA] set to [INPUTB]?",
text: Scratch.translate(
"touching clone with [INPUTA] set to [INPUTB]?"
),
filter: [Scratch.TargetType.SPRITE],
arguments: {
INPUTA: {
Expand All @@ -111,7 +117,7 @@
{
opcode: "touchingMainSprite",
blockType: Scratch.BlockType.BOOLEAN,
text: "touching main sprite?",
text: Scratch.translate("touching main sprite?"),
filter: [Scratch.TargetType.SPRITE],
disableMonitor: true,
extensions: ["colours_control"],
Expand All @@ -122,7 +128,9 @@
{
opcode: "setVariableOfClone",
blockType: Scratch.BlockType.COMMAND,
text: "set variable [INPUTA] to [INPUTB] for clones with [INPUTC] set to [INPUTD]",
text: Scratch.translate(
"set variable [INPUTA] to [INPUTB] for clones with [INPUTC] set to [INPUTD]"
),
filter: [Scratch.TargetType.SPRITE],
arguments: {
INPUTA: {
Expand All @@ -147,7 +155,9 @@
{
opcode: "getVariableOfClone",
blockType: Scratch.BlockType.REPORTER,
text: "variable [INPUTA] of clone with [INPUTB] set to [INPUTC]",
text: Scratch.translate(
"variable [INPUTA] of clone with [INPUTB] set to [INPUTC]"
),
filter: [Scratch.TargetType.SPRITE],
disableMonitor: true,
arguments: {
Expand All @@ -169,7 +179,9 @@
{
opcode: "setVariableOfMainSprite",
blockType: Scratch.BlockType.COMMAND,
text: "set variable [INPUTA] to [INPUTB] for main sprite",
text: Scratch.translate(
"set variable [INPUTA] to [INPUTB] for main sprite"
),
filter: [Scratch.TargetType.SPRITE],
arguments: {
INPUTA: {
Expand All @@ -186,7 +198,7 @@
{
opcode: "getVariableOfMainSprite",
blockType: Scratch.BlockType.REPORTER,
text: "variable [INPUT] of main sprite",
text: Scratch.translate("variable [INPUT] of main sprite"),
filter: [Scratch.TargetType.SPRITE],
disableMonitor: true,
arguments: {
Expand All @@ -203,7 +215,9 @@
{
opcode: "cloneExists",
blockType: Scratch.BlockType.BOOLEAN,
text: "clone with [INPUTA] set to [INPUTB] exists?",
text: Scratch.translate(
"clone with [INPUTA] set to [INPUTB] exists?"
),
filter: [Scratch.TargetType.SPRITE],
arguments: {
INPUTA: {
Expand All @@ -220,13 +234,14 @@
{
opcode: "getThingOfClone",
blockType: Scratch.BlockType.REPORTER,
text: "[INPUTA] of clone with [INPUTB] set to [INPUTC]",
text: Scratch.translate(
"[INPUTA] of clone with [INPUTB] set to [INPUTC]"
),
filter: [Scratch.TargetType.SPRITE],
disableMonitor: true,
arguments: {
INPUTA: {
type: Scratch.ArgumentType.STRING,
defaultValue: "x position",
menu: "thingOfMenu",
},
INPUTB: {
Expand All @@ -243,13 +258,12 @@
{
opcode: "getThingOfMainSprite",
blockType: Scratch.BlockType.REPORTER,
text: "[INPUT] of main sprite",
text: Scratch.translate("[INPUT] of main sprite"),
filter: [Scratch.TargetType.SPRITE],
disableMonitor: true,
arguments: {
INPUT: {
type: Scratch.ArgumentType.STRING,
defaultValue: "x position",
menu: "thingOfMenu",
},
},
Expand All @@ -261,7 +275,7 @@
{
opcode: "stopScriptsInSprite",
blockType: Scratch.BlockType.COMMAND,
text: "stop scripts in [INPUT]",
text: Scratch.translate("stop scripts in [INPUT]"),
arguments: {
INPUT: {
type: Scratch.ArgumentType.STRING,
Expand All @@ -273,7 +287,9 @@
{
opcode: "stopScriptsInClone",
blockType: Scratch.BlockType.COMMAND,
text: "stop scripts in clones with [INPUTA] set to [INPUTB]",
text: Scratch.translate(
"stop scripts in clones with [INPUTA] set to [INPUTB]"
),
filter: [Scratch.TargetType.SPRITE],
arguments: {
INPUTA: {
Expand All @@ -290,7 +306,7 @@
{
opcode: "stopScriptsInMainSprite",
blockType: Scratch.BlockType.COMMAND,
text: "stop scripts in main sprite",
text: Scratch.translate("stop scripts in main sprite"),
filter: [Scratch.TargetType.SPRITE],
extensions: ["colours_control"],
},
Expand All @@ -300,7 +316,7 @@
{
opcode: "deleteClonesInSprite",
blockType: Scratch.BlockType.COMMAND,
text: "delete clones in [INPUT]",
text: Scratch.translate("delete clones in [INPUT]"),
arguments: {
INPUT: {
type: Scratch.ArgumentType.STRING,
Expand All @@ -312,7 +328,9 @@
{
opcode: "deleteCloneWithVar",
blockType: Scratch.BlockType.COMMAND,
text: "delete clones with [INPUTA] set to [INPUTB]",
text: Scratch.translate(
"delete clones with [INPUTA] set to [INPUTB]"
),
filter: [Scratch.TargetType.SPRITE],
arguments: {
INPUTA: {
Expand All @@ -332,7 +350,7 @@
{
opcode: "isClone",
blockType: Scratch.BlockType.BOOLEAN,
text: "is clone?",
text: Scratch.translate("is clone?"),
filter: [Scratch.TargetType.SPRITE],
disableMonitor: true,
extensions: ["colours_control"],
Expand All @@ -343,13 +361,13 @@
{
opcode: "cloneCount",
blockType: Scratch.BlockType.REPORTER,
text: "clone count",
text: Scratch.translate("clone count"),
extensions: ["colours_control"],
},
{
opcode: "spriteCloneCount",
blockType: Scratch.BlockType.REPORTER,
text: "clone count of [INPUT]",
text: Scratch.translate("clone count of [INPUT]"),
disableMonitor: true,
arguments: {
INPUT: {
Expand All @@ -374,31 +392,31 @@
acceptReporters: false,
items: [
{
text: "x position",
text: Scratch.translate("x position"),
value: "x position",
},
{
text: "y position",
text: Scratch.translate("y position"),
value: "y position",
},
{
text: "direction",
text: Scratch.translate("direction"),
value: "direction",
},
{
text: "costume #",
text: Scratch.translate("costume #"),
value: "costume num",
},
{
text: "costume name",
text: Scratch.translate("costume name"),
value: "costume name",
},
{
text: "size",
text: Scratch.translate("size"),
value: "size",
},
{
text: "volume",
text: Scratch.translate("volume"),
value: "volume",
},
],
Expand Down Expand Up @@ -630,7 +648,10 @@
const curTarget = targets[index].sprite;
let display = curTarget.name;
if (myself === curTarget.name) {
display = "myself";
display = Scratch.translate({
default: "myself",
description: "Item in a dropdown that refers to the current sprite",
});
}
if (targets[index].isOriginal) {
const jsonOBJ = {
Expand Down
14 changes: 7 additions & 7 deletions extensions/Lily/TempVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
getInfo() {
return {
id: "lmstempvars",
name: "Temporary Variables",
name: Scratch.translate("Temporary Variables"),
color1: "#FF791A",
color2: "#E15D00",
menuIconURI: menuIconURI,
blocks: [
{
opcode: "setVariableTo",
blockType: Scratch.BlockType.COMMAND,
text: "set variable [INPUTA] to [INPUTB]",
text: Scratch.translate("set variable [INPUTA] to [INPUTB]"),
arguments: {
INPUTA: {
type: Scratch.ArgumentType.STRING,
Expand All @@ -33,7 +33,7 @@
{
opcode: "changeVariableBy",
blockType: Scratch.BlockType.COMMAND,
text: "change variable [INPUTA] by [INPUTB]",
text: Scratch.translate("change variable [INPUTA] by [INPUTB]"),
arguments: {
INPUTA: {
type: Scratch.ArgumentType.STRING,
Expand All @@ -48,7 +48,7 @@
{
opcode: "getVariable",
blockType: Scratch.BlockType.REPORTER,
text: "variable [INPUT]",
text: Scratch.translate("variable [INPUT]"),
disableMonitor: true,
arguments: {
INPUT: {
Expand All @@ -63,7 +63,7 @@
{
opcode: "deleteVariable",
blockType: Scratch.BlockType.COMMAND,
text: "delete variable [INPUT]",
text: Scratch.translate("delete variable [INPUT]"),
arguments: {
INPUT: {
type: Scratch.ArgumentType.STRING,
Expand All @@ -74,12 +74,12 @@
{
opcode: "deleteAllVariables",
blockType: Scratch.BlockType.COMMAND,
text: "delete all variables",
text: Scratch.translate("delete all variables"),
},
{
opcode: "listVariables",
blockType: Scratch.BlockType.REPORTER,
text: "list active variables",
text: Scratch.translate("list active variables"),
disableMonitor: true,
},
],
Expand Down
Loading

0 comments on commit 02e255b

Please sign in to comment.