From e437c64fc87382ee020614469578686ceabcb97e Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:40:44 -0400 Subject: [PATCH 01/31] Update hello-world.md --- docs/development/extensions/hello-world.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development/extensions/hello-world.md b/docs/development/extensions/hello-world.md index 3009beba..fb8d79c1 100644 --- a/docs/development/extensions/hello-world.md +++ b/docs/development/extensions/hello-world.md @@ -51,7 +51,7 @@ Make sure to always call register() exactly once. If you don't call it, your ext { opcode: 'hello', blockType: Scratch.BlockType.REPORTER, - text: 'Hello, world!' + text: Scratch.translate('Hello, world!') } ] }; From 05989b4813e1794c01a96fb4dd40bfb0485a4d92 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:49:45 -0400 Subject: [PATCH 02/31] Update hello-world.js --- static/example-extensions/hello-world.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/hello-world.js b/static/example-extensions/hello-world.js index 71778994..98853b08 100644 --- a/static/example-extensions/hello-world.js +++ b/static/example-extensions/hello-world.js @@ -2,12 +2,12 @@ class HelloWorld { getInfo() { return { id: 'helloworld', - name: 'It works!', + name: Scratch.translate('It works!'), blocks: [ { opcode: 'hello', blockType: Scratch.BlockType.REPORTER, - text: 'Hello!' + text: Scratch.translate('Hello!') } ] }; From 0a833c580f2b8657ff6aafae5264ffff48681b99 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:51:23 -0400 Subject: [PATCH 03/31] Update hello-world.md --- docs/development/extensions/hello-world.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development/extensions/hello-world.md b/docs/development/extensions/hello-world.md index fb8d79c1..85888b52 100644 --- a/docs/development/extensions/hello-world.md +++ b/docs/development/extensions/hello-world.md @@ -46,7 +46,7 @@ Make sure to always call register() exactly once. If you don't call it, your ext getInfo() { return { id: 'helloworld', - name: 'It works!', + name: Scratch.translate('It works!'), blocks: [ { opcode: 'hello', From 2e14020db7f873775b31cc5c4f841766729dd34b Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:54:58 -0400 Subject: [PATCH 04/31] Update async.js --- static/example-extensions/async.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/example-extensions/async.js b/static/example-extensions/async.js index 81261835..8b855aa7 100644 --- a/static/example-extensions/async.js +++ b/static/example-extensions/async.js @@ -2,11 +2,11 @@ class AsyncExtension { getInfo() { return { id: 'asyncexample', - name: 'Async Blocks', + name: Scratch.translate('Async Blocks'), blocks: [ { opcode: 'wait', - text: 'wait [TIME] seconds', + text: Scratch.translate('wait [TIME] seconds'), blockType: Scratch.BlockType.COMMAND, arguments: { TIME: { @@ -17,7 +17,7 @@ class AsyncExtension { }, { opcode: 'fetch', - text: 'fetch [URL]', + text: Scratch.translate('fetch [URL]'), blockType: Scratch.BlockType.REPORTER, arguments: { URL: { @@ -54,4 +54,4 @@ class AsyncExtension { } // highlight-end } -Scratch.extensions.register(new AsyncExtension()); \ No newline at end of file +Scratch.extensions.register(new AsyncExtension()); From a07036456b5249fcf0476d63ed52540a4605ddb4 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:56:02 -0400 Subject: [PATCH 05/31] Update strict-equality.js --- static/example-extensions/strict-equality.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/strict-equality.js b/static/example-extensions/strict-equality.js index ce9fe97e..d869f422 100644 --- a/static/example-extensions/strict-equality.js +++ b/static/example-extensions/strict-equality.js @@ -2,13 +2,13 @@ class StrictEqualityExtension { getInfo() { return { id: 'strictequalityexample', - name: 'Strict Equality', + name: Scratch.translate('Strict Equality'), blocks: [ // highlight-start { opcode: 'strictlyEquals', blockType: Scratch.BlockType.BOOLEAN, - text: '[ONE] strictly equals [TWO]', + text: Scratch.translate('[ONE] strictly equals [TWO]'), arguments: { ONE: { type: Scratch.ArgumentType.STRING From 4b7a75e244b85ba14bf8cf79e4f08fa4ef4d8384 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:50:57 -0400 Subject: [PATCH 06/31] Update when-space-key-pressed.js --- .../example-extensions/unsandboxed/when-space-key-pressed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/unsandboxed/when-space-key-pressed.js b/static/example-extensions/unsandboxed/when-space-key-pressed.js index da2d5f17..41ff3ccd 100644 --- a/static/example-extensions/unsandboxed/when-space-key-pressed.js +++ b/static/example-extensions/unsandboxed/when-space-key-pressed.js @@ -9,13 +9,13 @@ getInfo() { return { id: 'eventexampleunsandboxed', - name: 'Event Block Example', + name: Scratch.translate('Event Block Example'), blocks: [ // highlight-start { blockType: Scratch.BlockType.EVENT, opcode: 'whenSpacePressed', - text: 'when space key pressed', + text: Scratch.translate('when space key pressed'), isEdgeActivated: false // required boilerplate } // highlight-end From 7bc38a5cb61b340945a12b910e28beeefa9375d6 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:51:43 -0400 Subject: [PATCH 07/31] Update when-key-pressed.js --- static/example-extensions/unsandboxed/when-key-pressed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/unsandboxed/when-key-pressed.js b/static/example-extensions/unsandboxed/when-key-pressed.js index e91b5103..92034365 100644 --- a/static/example-extensions/unsandboxed/when-key-pressed.js +++ b/static/example-extensions/unsandboxed/when-key-pressed.js @@ -9,12 +9,12 @@ getInfo() { return { id: 'eventexample2unsandboxed', - name: 'Event Block Example 2', + name: Scratch.translate('Event Block Example 2'), blocks: [ { blockType: Scratch.BlockType.EVENT, opcode: 'whenPressed', - text: 'when [KEY] key pressed', + text: Scratch.translate('when [KEY] key pressed'), isEdgeActivated: false, // required boilerplate // highlight-start arguments: { From c58dba4bcf13af0e042d393396c39ea519673bf9 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:52:12 -0400 Subject: [PATCH 08/31] Update when-key-pressed-restart.js --- .../unsandboxed/when-key-pressed-restart.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/unsandboxed/when-key-pressed-restart.js b/static/example-extensions/unsandboxed/when-key-pressed-restart.js index 6f909400..0f087ceb 100644 --- a/static/example-extensions/unsandboxed/when-key-pressed-restart.js +++ b/static/example-extensions/unsandboxed/when-key-pressed-restart.js @@ -9,12 +9,12 @@ getInfo() { return { id: 'restartexampleunsandboxed', - name: 'Restart Threads Example', + name: Scratch.translate('Restart Threads Example'), blocks: [ { blockType: Scratch.BlockType.EVENT, opcode: 'whenPressed', - text: 'when [KEY] key pressed', + text: Scratch.translate('when [KEY] key pressed'), isEdgeActivated: false, // highlight-next-line shouldRestartExistingThreads: true, From d0b6a3f65ad5307cd462416a6016b54d51d499f0 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:52:47 -0400 Subject: [PATCH 09/31] Update broadcast-5.js --- static/example-extensions/unsandboxed/broadcast-5.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/example-extensions/unsandboxed/broadcast-5.js b/static/example-extensions/unsandboxed/broadcast-5.js index 0b9df60f..3314ac43 100644 --- a/static/example-extensions/unsandboxed/broadcast-5.js +++ b/static/example-extensions/unsandboxed/broadcast-5.js @@ -4,12 +4,12 @@ getInfo() { return { id: 'broadcast5example', - name: 'Broadcast Example 5', + name: Scratch.translate('Broadcast Example 5'), blocks: [ { opcode: 'whenReceived', blockType: Scratch.BlockType.HAT, - text: 'when I receive [EVENT_OPTION]', + text: Scratch.translate('when I receive [EVENT_OPTION]'), isEdgeActivated: false, arguments: { EVENT_OPTION: { @@ -21,7 +21,7 @@ { opcode: 'broadcast', blockType: Scratch.BlockType.REPORTER, - text: 'broadcast [EVENT]', + text: Scratch.translate('broadcast [EVENT]'), arguments: { EVENT: { type: Scratch.ArgumentType.STRING, From dcbdec5f9d3e2ef6d8e460ab03d1f9b566fc8587 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:53:17 -0400 Subject: [PATCH 10/31] Update when.js --- static/example-extensions/unsandboxed/when.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/unsandboxed/when.js b/static/example-extensions/unsandboxed/when.js index ea6fa2f2..266353fa 100644 --- a/static/example-extensions/unsandboxed/when.js +++ b/static/example-extensions/unsandboxed/when.js @@ -9,13 +9,13 @@ getInfo() { return { id: 'whenunsandboxed', - name: 'When', + name: Scratch.translate('When'), blocks: [ { // highlight-start blockType: Scratch.BlockType.HAT, opcode: 'when', - text: 'when [CONDITION]', + text: Scratch.translate('when [CONDITION]'), isEdgeActivated: false, // required boilerplate arguments: { CONDITION: { From 99837f5ead62dbb9e510f327cdde01ffc4661d3e Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:56:03 -0400 Subject: [PATCH 11/31] Update strings-1.js --- static/example-extensions/strings-1.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/strings-1.js b/static/example-extensions/strings-1.js index 18711f3d..54fc0ee1 100644 --- a/static/example-extensions/strings-1.js +++ b/static/example-extensions/strings-1.js @@ -2,12 +2,12 @@ class Strings1 { getInfo() { return { id: 'strings1example', - name: 'Encoding', + name: Scratch.translate('Encoding'), blocks: [ { opcode: 'convert', blockType: Scratch.BlockType.REPORTER, - text: 'convert [TEXT] to [FORMAT]', + text: Scratch.translate('convert [TEXT] to [FORMAT]'), arguments: { TEXT: { type: Scratch.ArgumentType.STRING, From aa56db1028b15e7f7d620f3ba2b8fe1ed06836e4 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:57:35 -0400 Subject: [PATCH 12/31] Update strings-2.js --- static/example-extensions/strings-2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/strings-2.js b/static/example-extensions/strings-2.js index 1ec5517b..f0c5bbe4 100644 --- a/static/example-extensions/strings-2.js +++ b/static/example-extensions/strings-2.js @@ -2,12 +2,12 @@ class Strings2 { getInfo() { return { id: 'strings2example', - name: 'Encoding', + name: Scratch.translate('Encoding'), blocks: [ { opcode: 'convert', blockType: Scratch.BlockType.REPORTER, - text: 'convert [TEXT] to [FORMAT]', + text: Scratch.translate('convert [TEXT] to [FORMAT]'), arguments: { TEXT: { type: Scratch.ArgumentType.STRING, From f6d7f6ed41a22d4e762e6e7214f40b483406ee7b Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:59:39 -0400 Subject: [PATCH 13/31] Update hello-world-unsandboxed.js --- .../example-extensions/unsandboxed/hello-world-unsandboxed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/unsandboxed/hello-world-unsandboxed.js b/static/example-extensions/unsandboxed/hello-world-unsandboxed.js index 3aa70a3f..9ea680ab 100644 --- a/static/example-extensions/unsandboxed/hello-world-unsandboxed.js +++ b/static/example-extensions/unsandboxed/hello-world-unsandboxed.js @@ -9,12 +9,12 @@ getInfo() { return { id: 'helloworldunsandboxed', - name: 'Unsandboxed Hello World', + name: Scratch.translate('Unsandboxed Hello World'), blocks: [ { opcode: 'hello', blockType: Scratch.BlockType.REPORTER, - text: 'Hello!' + text: Scratch.translate('Hello!') } ] }; From ec745b1ff5504fd00268bc9e7de81fb850f97fe7 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:00:42 -0400 Subject: [PATCH 14/31] Update turbo-mode.js --- static/example-extensions/unsandboxed/turbo-mode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/unsandboxed/turbo-mode.js b/static/example-extensions/unsandboxed/turbo-mode.js index b2383e70..7f920e7c 100644 --- a/static/example-extensions/unsandboxed/turbo-mode.js +++ b/static/example-extensions/unsandboxed/turbo-mode.js @@ -12,12 +12,12 @@ getInfo() { return { id: 'turbomodeunsandboxed', - name: 'Turbo Mode', + name: Scratch.translate('Turbo Mode'), blocks: [ { opcode: 'set', blockType: Scratch.BlockType.COMMAND, - text: 'set turbo mode to [ENABLED]', + text: Scratch.translate('set turbo mode to [ENABLED]'), arguments: { ENABLED: { type: Scratch.ArgumentType.STRING, From 58bb838a7e638a4830c62110779779cf73b02d80 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:05:59 -0400 Subject: [PATCH 15/31] Update block-utility-examples.js --- .../unsandboxed/block-utility-examples.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/example-extensions/unsandboxed/block-utility-examples.js b/static/example-extensions/unsandboxed/block-utility-examples.js index 6c14aceb..9c606bf3 100644 --- a/static/example-extensions/unsandboxed/block-utility-examples.js +++ b/static/example-extensions/unsandboxed/block-utility-examples.js @@ -9,16 +9,16 @@ getInfo() { return { id: 'blockutilityexamples', - name: 'BlockUtility Examples', + name: Scratch.translate('BlockUtility Examples'), blocks: [ { opcode: 'getSpriteName', - text: 'sprite name', + text: Scratch.translate('sprite name'), blockType: Scratch.BlockType.REPORTER, }, { opcode: 'doesVariableExist', - text: 'is there a [TYPE] named [NAME]?', + text: Scratch.translate('is there a [TYPE] named [NAME]?'), blockType: Scratch.BlockType.BOOLEAN, arguments: { NAME: { From d455ca764ad36b25be44d0a0d9207de55785123c Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:09:20 -0400 Subject: [PATCH 16/31] Update color.js --- static/example-extensions/color.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/example-extensions/color.js b/static/example-extensions/color.js index 34e976f8..6e6d8b61 100644 --- a/static/example-extensions/color.js +++ b/static/example-extensions/color.js @@ -13,7 +13,7 @@ class ColorExample { { opcode: 'reporter', blockType: Scratch.BlockType.REPORTER, - text: 'string [STRING] boolean [BOOLEAN] menu [MENU] field [FIELD]', + text: Scratch.translate('string [STRING] boolean [BOOLEAN] menu [MENU] field [FIELD]'), arguments: { STRING: { type: Scratch.ArgumentType.STRING, From 25da082f8999912968e871e19278f5937038207d Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:09:55 -0400 Subject: [PATCH 17/31] Update hello-docs.js --- static/example-extensions/hello-docs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/hello-docs.js b/static/example-extensions/hello-docs.js index 97e15449..a7cfb2d3 100644 --- a/static/example-extensions/hello-docs.js +++ b/static/example-extensions/hello-docs.js @@ -2,14 +2,14 @@ class HelloDocs { getInfo() { return { id: 'hellodocs', - name: 'Hello Docs!', + name: Scratch.translate('Hello Docs!'), // highlight-next-line docsURI: 'https://docs.turbowarp.org/development/extensions/docsURI-demo', blocks: [ { opcode: 'hello', blockType: Scratch.BlockType.REPORTER, - text: 'Hello!' + text: Scratch.translate('Hello!') } ] }; From feef5432c81d874d0f2e17bd97a46f63dd10cdcf Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:10:18 -0400 Subject: [PATCH 18/31] Update unmonitorable.js --- static/example-extensions/unmonitorable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/example-extensions/unmonitorable.js b/static/example-extensions/unmonitorable.js index 24df342a..53dec0c2 100644 --- a/static/example-extensions/unmonitorable.js +++ b/static/example-extensions/unmonitorable.js @@ -2,17 +2,17 @@ class DisableMonitorExample { getInfo() { return { id: 'disablemonitorexample', - name: 'disableMonitor Example', + name: Scratch.translate('disableMonitor Example'), blocks: [ { opcode: 'monitorable', blockType: Scratch.BlockType.REPORTER, - text: 'this block can be monitored' + text: Scratch.translate('this block can be monitored') }, { opcode: 'unmonitorable', blockType: Scratch.BlockType.REPORTER, - text: 'but this one can not', + text: Scratch.translate('but this one can not'), // highlight-next-line disableMonitor: true }, From 2de60801a59b7a7fa8dc831a13309f0d392b7b09 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:11:10 -0400 Subject: [PATCH 19/31] Update cast.js --- static/example-extensions/cast.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/example-extensions/cast.js b/static/example-extensions/cast.js index e161a8c6..7faace76 100644 --- a/static/example-extensions/cast.js +++ b/static/example-extensions/cast.js @@ -2,12 +2,12 @@ class CastingExample { getInfo() { return { id: 'castexample', - name: 'Casting Example', + name: Scratch.translate('Casting Example'), blocks: [ { opcode: 'toNumber', blockType: Scratch.BlockType.REPORTER, - text: 'convert [INPUT] to number', + text: Scratch.translate('convert [INPUT] to number'), arguments: { INPUT: { type: Scratch.ArgumentType.STRING, @@ -20,7 +20,7 @@ class CastingExample { // treatment in JS, it seems a bit dangerous to use opcode: 'castToString', blockType: Scratch.BlockType.REPORTER, - text: 'convert [INPUT] to string', + text: Scratch.translate('convert [INPUT] to string'), arguments: { INPUT: { type: Scratch.ArgumentType.STRING, @@ -31,7 +31,7 @@ class CastingExample { { opcode: 'toBoolean', blockType: Scratch.BlockType.BOOLEAN, - text: 'convert [INPUT] to boolean', + text: Scratch.translate('convert [INPUT] to boolean'), arguments: { INPUT: { type: Scratch.ArgumentType.STRING, @@ -42,7 +42,7 @@ class CastingExample { { opcode: 'compare', blockType: Scratch.BlockType.REPORTER, - text: 'compare [A] to [B]', + text: Scratch.translate('compare [A] to [B]'), arguments: { A: { type: Scratch.ArgumentType.STRING, From 09e36cbba5176d82b4a0bcdf0ba5b14d7ed312ad Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:11:50 -0400 Subject: [PATCH 20/31] Update hidden-1.js --- static/example-extensions/hidden-1.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/hidden-1.js b/static/example-extensions/hidden-1.js index c395f255..0fbc95a1 100644 --- a/static/example-extensions/hidden-1.js +++ b/static/example-extensions/hidden-1.js @@ -2,12 +2,12 @@ class HideFromPaletteExample { getInfo() { return { id: 'hidefrompaletteexample', - name: 'hideFromPalette Example', + name: Scratch.translate('hideFromPalette Example'), blocks: [ { opcode: 'hidden', blockType: Scratch.BlockType.REPORTER, - text: 'example block (visible)' + text: Scratch.translate('example block (visible)') }, ] }; From 6a2215ba060bde836042cf6092bc1c91c995c20a Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:12:10 -0400 Subject: [PATCH 21/31] Update hidden-2.js --- static/example-extensions/hidden-2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/hidden-2.js b/static/example-extensions/hidden-2.js index b0625d92..130d8e9c 100644 --- a/static/example-extensions/hidden-2.js +++ b/static/example-extensions/hidden-2.js @@ -2,12 +2,12 @@ class HideFromPaletteExample { getInfo() { return { id: 'hidefrompaletteexample', - name: 'hideFromPalette Example', + name: Scratch.translate('hideFromPalette Example'), blocks: [ { opcode: 'hidden', blockType: Scratch.BlockType.REPORTER, - text: 'example block (hidden)', + text: Scratch.translate('example block (hidden)'), hideFromPalette: true }, ] From 5773ca26ec1e3accb2250b9bd168af58da09c8af Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:13:04 -0400 Subject: [PATCH 22/31] Update filter.js --- static/example-extensions/filter.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/example-extensions/filter.js b/static/example-extensions/filter.js index 1ab40326..6b627685 100644 --- a/static/example-extensions/filter.js +++ b/static/example-extensions/filter.js @@ -2,31 +2,31 @@ class FilterExample { getInfo() { return { id: 'filterexample', - name: 'Filter Example', + name: Scratch.translate('Filter Example'), blocks: [ { opcode: 'all', blockType: Scratch.BlockType.COMMAND, - text: 'available in ALL targets', + text: Scratch.translate('available in ALL targets'), }, { opcode: 'sprites', blockType: Scratch.BlockType.COMMAND, - text: 'available in ONLY sprites', + text: Scratch.translate('available in ONLY sprites'), // highlight-next-line filter: [Scratch.TargetType.SPRITE] }, { opcode: 'stage', blockType: Scratch.BlockType.COMMAND, - text: 'available in ONLY the stage', + text: Scratch.translate('available in ONLY the stage'), // highlight-next-line filter: [Scratch.TargetType.STAGE] }, { opcode: 'none', blockType: Scratch.BlockType.COMMAND, - text: 'available in NEITHER sprites or the stage', + text: Scratch.translate('available in NEITHER sprites or the stage'), // highlight-start // NOTE: Use hideFromPalette instead of filter: [] filter: [] From 9f6bb365d4993491c4bf4708b64980150b62322b Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:13:53 -0400 Subject: [PATCH 23/31] Update icons.js --- static/example-extensions/icons.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/example-extensions/icons.js b/static/example-extensions/icons.js index 38798d75..b92a2db2 100644 --- a/static/example-extensions/icons.js +++ b/static/example-extensions/icons.js @@ -11,7 +11,7 @@ class IconsExample { getInfo() { return { id: 'iconsexample', - name: 'Icons Example', + name: Scratch.translate('Icons Example'), // highlight-start menuIconURI: blocksIcon, blockIconURI: dangoIcon, @@ -20,7 +20,7 @@ class IconsExample { { opcode: 'defaultIcon', blockType: Scratch.BlockType.REPORTER, - text: 'reporter with default icon [INPUT]', + text: Scratch.translate('reporter with default icon [INPUT]'), arguments: { INPUT: { type: Scratch.ArgumentType.STRING, @@ -31,7 +31,7 @@ class IconsExample { { opcode: 'overriddenIcon', blockType: Scratch.BlockType.COMMAND, - text: 'command with overridden icon [INPUT]', + text: Scratch.translate('command with overridden icon [INPUT]'), // highlight-next-line blockIconURI: colorIcon, arguments: { From b2fa57a5178ed43dadf26c632100893cec698351 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:14:25 -0400 Subject: [PATCH 24/31] Update inline-images.js --- static/example-extensions/inline-images.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/example-extensions/inline-images.js b/static/example-extensions/inline-images.js index bb10847f..c56818d6 100644 --- a/static/example-extensions/inline-images.js +++ b/static/example-extensions/inline-images.js @@ -8,13 +8,13 @@ class InlineImagesExample { getInfo() { return { id: 'inlineimagesexample', - name: 'Inline Images Example', + name: Scratch.translate('Inline Images Example'), blocks: [ { opcode: 'reporter', blockType: Scratch.BlockType.REPORTER, // highlight-start - text: 'some text [IMAGE] more text', + text: Scratch.translate('some text [IMAGE] more text'), arguments: { IMAGE: { type: Scratch.ArgumentType.IMAGE, @@ -28,7 +28,7 @@ class InlineImagesExample { blockType: Scratch.BlockType.COMMAND, blockIconURI: colorIcon, // highlight-start - text: 'some text [IMAGE] more text', + text: Scratch.translate('some text [IMAGE] more text'), arguments: { IMAGE: { type: Scratch.ArgumentType.IMAGE, From 77ef3a4b109d618c91350d8f568618065bdc38e4 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:15:00 -0400 Subject: [PATCH 25/31] Update separators.js --- static/example-extensions/separators.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/example-extensions/separators.js b/static/example-extensions/separators.js index 5142a38e..fb69dcfe 100644 --- a/static/example-extensions/separators.js +++ b/static/example-extensions/separators.js @@ -2,31 +2,31 @@ class SeparatorExample { getInfo() { return { id: 'separatorexample', - name: 'Separator Example', + name: Scratch.translate('Separator Example'), blocks: [ { opcode: 'block1', blockType: Scratch.BlockType.COMMAND, - text: 'group 1' + text: Scratch.translate('group 1') }, { opcode: 'block2', blockType: Scratch.BlockType.COMMAND, - text: 'also group 1', + text: Scratch.translate('also group 1'), }, // highlight-next-line '---', { opcode: 'block3', blockType: Scratch.BlockType.COMMAND, - text: 'group 2' + text: Scratch.translate('group 2') }, // highlight-next-line '---', { opcode: 'block4', blockType: Scratch.BlockType.COMMAND, - text: 'group 3', + text: Scratch.translate('group 3'), }, ] }; From 522b8f771bfff213f922e3a534bcf9ccc5cae2c6 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:15:32 -0400 Subject: [PATCH 26/31] Update terminal.js --- static/example-extensions/terminal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/example-extensions/terminal.js b/static/example-extensions/terminal.js index cdc995a6..40659b53 100644 --- a/static/example-extensions/terminal.js +++ b/static/example-extensions/terminal.js @@ -2,14 +2,14 @@ class TerminalExample { getInfo() { return { id: 'terminalexample', - name: 'Terminal Example', + name: Scratch.translate('Terminal Example'), blocks: [ { opcode: 'terminalBlock', blockType: Scratch.BlockType.COMMAND, // highlight-next-line isTerminal: true, - text: 'you can not connect another block under this one!' + text: Scratch.translate('you can not connect another block under this one!') } ] }; From 983a50105c8a0a1a620649ce9b18e74cb8298e42 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:16:45 -0400 Subject: [PATCH 27/31] Update compatibility.md --- docs/development/extensions/compatibility.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/development/extensions/compatibility.md b/docs/development/extensions/compatibility.md index 2bde2c90..061d764d 100644 --- a/docs/development/extensions/compatibility.md +++ b/docs/development/extensions/compatibility.md @@ -105,7 +105,7 @@ Instead, create a new block and mark the old one as `hideFromPalette: true`. The { blockType: Scratch.BlockType.REPORTER, id: "oldBlock", - text: "old [INPUT1]", + text: Scratch.translate("old [INPUT1]"), arguments: { INPUT1: { /* ... */ } }, @@ -114,7 +114,7 @@ Instead, create a new block and mark the old one as `hideFromPalette: true`. The { blockType: Scratch.BlockType.REPORTER, opcode: "newBlock", - text: "new [INPUT1] [INPUT2]", + text: Scratch.translate("new [INPUT1] [INPUT2]"), arguments: { INPUT1: { /* ... */ }, INPUT2: { /* ... */ } From b52449e1ad1234f613ea4edec1ff8c5d416c855a Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:17:44 -0400 Subject: [PATCH 28/31] Update timer-reimplementation.js --- static/example-extensions/timer-reimplementation.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/example-extensions/timer-reimplementation.js b/static/example-extensions/timer-reimplementation.js index 5756c203..7b9fe01b 100644 --- a/static/example-extensions/timer-reimplementation.js +++ b/static/example-extensions/timer-reimplementation.js @@ -4,13 +4,13 @@ class TimerReimplementationExample { getInfo() { return { id: 'timerreimplementationexample', - name: 'Timer Example', + name: Scratch.translate('Timer Example'), blocks: [ // highlight-start { opcode: 'whenTimerGreaterThan', blockType: Scratch.BlockType.HAT, - text: 'when timer > [TIME]', + text: Scratch.translate('when timer > [TIME]'), isEdgeActivated: true, arguments: { TIME: { @@ -23,12 +23,12 @@ class TimerReimplementationExample { { opcode: 'timer', blockType: Scratch.BlockType.REPORTER, - text: 'timer' + text: Scratch.translate('timer') }, { opcode: 'resetTimer', blockType: Scratch.BlockType.COMMAND, - text: 'reset timer' + text: Scratch.translate('reset timer') } ] }; From fddf95abae8d6864b97992038917ec2da1da3b35 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:20:32 -0400 Subject: [PATCH 29/31] Update wrapping-up.md --- docs/development/extensions/wrapping-up.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/development/extensions/wrapping-up.md b/docs/development/extensions/wrapping-up.md index 12ce550e..9208cc11 100644 --- a/docs/development/extensions/wrapping-up.md +++ b/docs/development/extensions/wrapping-up.md @@ -17,3 +17,4 @@ Thank you for reading this far. - Dynamic menus - Block utility stack frames, yield, yieldTick, etc. - C-shape blocks such as "if", "if else", "repeat" + - how to use `Scratch.translate()` and why you should From f42d82677f984e85bc6e95fcbd1bf1f70dac6f4f Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Fri, 17 Oct 2025 11:39:21 -0400 Subject: [PATCH 30/31] Update assorted-apis.md --- docs/development/extensions/assorted-apis.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/development/extensions/assorted-apis.md b/docs/development/extensions/assorted-apis.md index 3f84d8a6..807fe8d3 100644 --- a/docs/development/extensions/assorted-apis.md +++ b/docs/development/extensions/assorted-apis.md @@ -92,6 +92,13 @@ While the block's shape will look similar to "stop this script" and "stop all", {require("!raw-loader!@site/static/example-extensions/terminal.js")} +## Translations +Use the `Scratch.translate()` API to translate text for use in block text and extension names. This is NOT the same as the Translate extension from Scratch; `Scratch.translate()` does not use the Internet and exclusively uses man-made translations. + +`Scratch.translate()` is not intended for translating user input and will leave most user-generated text untranslated. + +If you want to help translate text from your extension, [click here](https://docs.turbowarp.org/translate). + ## Next steps Next, let's see [how to make blocks like "when I receive" or "when timer greater than".](./hats) From ff0030385d652da8dc0d33a928e6aeedd8bf7121 Mon Sep 17 00:00:00 2001 From: PPPDUD <107440101+PPPDUD@users.noreply.github.com> Date: Fri, 17 Oct 2025 11:39:41 -0400 Subject: [PATCH 31/31] Update wrapping-up.md --- docs/development/extensions/wrapping-up.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/development/extensions/wrapping-up.md b/docs/development/extensions/wrapping-up.md index 9208cc11..12ce550e 100644 --- a/docs/development/extensions/wrapping-up.md +++ b/docs/development/extensions/wrapping-up.md @@ -17,4 +17,3 @@ Thank you for reading this far. - Dynamic menus - Block utility stack frames, yield, yieldTick, etc. - C-shape blocks such as "if", "if else", "repeat" - - how to use `Scratch.translate()` and why you should