scratch-blocks 2.1.20 → 2.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -50,6 +50,8 @@ npm run test:lint # Check for lint and formatting issues (does not run other
50
50
  npm run test # Run unit and browser tests (but not lint)
51
51
  npm run test:unit # Run unit tests only
52
52
  npm run test:browser # Run browser tests only
53
+ npm run i18n:src # Validate msg/json/en.json, the English source strings
54
+ npm run i18n:push # Upload msg/json/en.json to Transifex (needs TX_TOKEN; normally run by CI)
53
55
  ```
54
56
 
55
57
  Run `npm run test:lint` first when iterating — it is fast. Run `npm run test` before declaring work done.
@@ -63,11 +65,29 @@ src/
63
65
  ├── fields/ Custom Blockly field subclasses
64
66
  ├── renderer/ Custom renderer (ScratchRenderer) + cat blocks variant
65
67
  └── index.ts Entry point; registers everything with Blockly
68
+ msg/json/en.json English source strings (the only file of strings to edit by hand)
66
69
  ```
67
70
 
68
71
  Key top-level files: `procedures.ts`, `variables.ts`, `data_category.ts`,
69
72
  `scratch_continuous_toolbox.ts`, `checkable_continuous_flyout.ts`, `scratch_comment_bubble.ts`.
70
73
 
74
+ ## Localized strings
75
+
76
+ - **English** lives in `msg/json/en.json`. Add or change English strings only there, and refer to them as
77
+ `Blockly.Msg.KEY`.
78
+ - **Other locales** come from the `scratch-l10n` devDependency, which pulls reviewed translations from the
79
+ `scratch-editor/blocks` resource on Transifex. Webpack bundles them into `dist/main.mjs` (see
80
+ `src/scratch_msgs.ts`). Never edit translations in this repository; fix them in Transifex.
81
+ - **How strings flow:**
82
+ - `npm run i18n:push` uploads `en.json` to Transifex.
83
+ - scratch-l10n pulls translations daily and publishes a release.
84
+ - Renovate bumps `scratch-l10n` here as a `fix(deps)` commit, which publishes a new scratch-blocks release.
85
+ - **Keep keys stable.** Renaming a key discards its translations. If Blockly core reads a different key for the same
86
+ text, add it to `BLOCKLY_ALIASES` in `src/scratch_msgs.ts` instead of renaming.
87
+ - **Blockly core strings.** scratch-blocks doesn't load `blockly/msg/*`. Any Blockly core message the Scratch UI can
88
+ reach must be in `en.json` or `BLOCKLY_ALIASES`. A missing one is `undefined`, which can stop Blockly from building
89
+ a context menu.
90
+
71
91
  ## Blockly is a read-only dependency
72
92
 
73
93
  The scratch-blocks codebase extends Blockly, but we do not control the Blockly source. Treat files under