scratch-blocks 2.1.20 → 2.1.22
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 +20 -0
- package/dist/main.mjs +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/scratch_msgs.d.ts +32 -0
- package/dist/types/src/scratch_msgs.d.ts.map +1 -0
- package/eslint.config.mjs +0 -1
- package/msg/json/en.json +6 -0
- package/package.json +5 -2
- package/scripts/validate-en-json.mjs +27 -0
- package/src/fields/scratch_field_variable.ts +1 -1
- package/src/index.ts +1 -1
- package/src/scratch_msgs.ts +70 -0
- package/tsconfig.json +1 -0
- package/types/scratch-l10n.d.ts +15 -0
- package/dist/types/msg/scratch_msgs.d.ts +0 -9
- package/dist/types/msg/scratch_msgs.d.ts.map +0 -1
- package/i18n/common.py +0 -234
- package/i18n/create_messages.py +0 -162
- package/i18n/create_scratch_msgs.js +0 -68
- package/i18n/dedup_json.py +0 -73
- package/i18n/js_to_json.js +0 -54
- package/i18n/js_to_json.py +0 -136
- package/i18n/json_to_js.js +0 -52
- package/i18n/json_to_js.py +0 -185
- package/i18n/sync_tx_translations.js +0 -110
- package/i18n/test_scratch_msgs.js +0 -90
- package/i18n/tests.py +0 -47
- package/i18n/xliff_to_json.py +0 -232
- package/msg/js/en.js +0 -293
- package/msg/messages.js +0 -356
- package/msg/scratch_msgs.js +0 -23058
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
|