scratch-l10n 5.0.230 → 5.0.232
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/.editorconfig +9 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +53 -46
- package/.github/workflows/ci-cd.yml +5 -5
- package/.github/workflows/commitlint.yml +1 -1
- package/.github/workflows/daily-help-update.yml +4 -4
- package/.github/workflows/daily-tx-pull.yml +4 -4
- package/.github/workflows/signature-assistant.yml +3 -3
- package/.prettierignore +11 -0
- package/CHANGELOG.md +14 -0
- package/README.md +12 -12
- package/commitlint.config.js +3 -3
- package/dist/l10n.js +224 -232
- package/dist/l10n.js.map +1 -1
- package/dist/localeData.js +223 -232
- package/dist/localeData.js.map +1 -1
- package/dist/supportedLocales.js +123 -130
- package/dist/supportedLocales.js.map +1 -1
- package/eslint.config.mjs +13 -0
- package/lib/batch.js +10 -12
- package/lib/progress-logger.mjs +33 -33
- package/lib/transifex.js +145 -144
- package/lib/validate.mjs +32 -31
- package/package.json +7 -8
- package/prettier.config.mjs +3 -0
- package/release.config.js +13 -13
- package/renovate.json5 +3 -5
- package/scripts/build-data.mjs +33 -49
- package/scripts/build-i18n-src.js +29 -28
- package/scripts/freshdesk-api.js +129 -144
- package/scripts/help-utils.js +129 -139
- package/scripts/tx-pull-editor.mjs +54 -51
- package/scripts/tx-pull-help-articles.js +14 -14
- package/scripts/tx-pull-help-names.js +14 -14
- package/scripts/tx-pull-locale-articles.js +19 -19
- package/scripts/tx-pull-www.mjs +79 -76
- package/scripts/tx-push-help.mjs +87 -96
- package/scripts/tx-push-src.js +65 -65
- package/scripts/validate-extension-inputs.mjs +65 -68
- package/scripts/validate-translations.mjs +33 -29
- package/scripts/validate-www.mjs +45 -43
- package/src/index.mjs +4 -3
- package/src/locale-data.mjs +148 -150
- package/src/supported-locales.mjs +124 -131
- package/www/scratch-website.annual-report-2020-l10njson/hi.json +7 -7
package/.editorconfig
ADDED
@@ -15,54 +15,61 @@ There are two situations in which we create manual PRs to update translations:
|
|
15
15
|
|
16
16
|
### 1. Updating translations manually
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
- [ ] Pull editor translations from Transifex with `> npm run pull:editor`
|
19
|
+
- [ ] Pull www translations from Transifex with `> npm run pull:www`
|
20
|
+
- [ ] Test the result with `> npm run test`
|
21
|
+
- [ ] Confirm that you see changes to files like `editor/<resource>/<lang code>.json`
|
22
22
|
|
23
23
|
### Adding a language
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
25
|
+
- [ ] Edit `src/supported-locales.mjs`:
|
26
|
+
|
27
|
+
- [ ] Add entry for the language in the `locales` const
|
28
|
+
- [ ] Check if language is right-to-left. If so:
|
29
|
+
- Add entry in `rtlLocales`
|
30
|
+
|
31
|
+
- [ ] Check if the new language uses a country code
|
32
|
+
|
33
|
+
- Check [https://www.transifex.com/explore/languages](https://www.transifex.com/explore/languages). If the language has a country code:
|
34
|
+
- [ ] Edit `src/supported-locales.mjs`:
|
35
|
+
- Add new entry to `localeMap`. Format is `'<W3C HTML browser locale string>': '<Transifex ICU locale string>'`
|
36
|
+
- [ ] Edit `.tx/config`:
|
37
|
+
- Add to the `lang_map` list. Format is `<Transifex ICU locale string>:<W3C HTML browser locale string>`
|
38
|
+
- NOTE: we are moving away from using the `tx` cli; `.tx/config` will eventually be deprecated
|
39
|
+
|
40
|
+
- [ ] Edit `src/index.js`:
|
41
|
+
|
42
|
+
- [ ] Add 'import' line
|
43
|
+
- [ ] Add entry in `localeData` array
|
44
|
+
|
45
|
+
- [ ] Check if locale is in `react-intl`
|
46
|
+
|
47
|
+
- Look in [https://unpkg.com/react-intl/locale-data/](https://unpkg.com/react-intl/locale-data/)
|
48
|
+
- If not in `react-intl`:
|
49
|
+
- [ ] Edit `src/supported-locales.mjs`:
|
50
|
+
- In `customLocales`, add entry with parent set to a `react-intl` locale
|
51
|
+
- [ ] Edit `src/index.js`:
|
52
|
+
- In `localeData`, add entry for parent locale
|
53
|
+
|
54
|
+
- [ ] Update translations per the "Updating translations" section above
|
55
|
+
- [ ] Confirm that we see changes to:
|
56
|
+
|
57
|
+
- [ ] `src/supported-locales.mjs`
|
58
|
+
- [ ] `src/index.js`
|
59
|
+
- [ ] `.tx/config` (if language needed a new locale)
|
60
|
+
- [ ] Multiple files like `editor/<resource>/<lang code>.json`
|
61
|
+
|
62
|
+
- [ ] Bump minor version number in `package.json`
|
63
|
+
|
64
|
+
- [ ] **Add language po files to scratchr2_translations**
|
65
|
+
|
66
|
+
- manually update `scratchr2_translations/legacy` with `tx pull -l <locale>` and check in changes
|
67
|
+
|
68
|
+
- [ ] **Add language to scratchr2 settings**
|
69
|
+
- manually update `settings/base.py` with the new language
|
64
70
|
|
65
71
|
#### After scratch-l10n update is published:
|
66
|
-
|
67
|
-
|
68
|
-
|
72
|
+
|
73
|
+
- [ ] **Update scratch-blocks dependency**
|
74
|
+
- [ ] in `package.json`, update the version of the scratch-l10n dependency to the version number you used above
|
75
|
+
- [ ] pull translations so that a new `Blockly.ScratchMsgs.locales["<LOCALE CODE>"]` is added to `msg/scratch_msgs.js`
|
@@ -7,11 +7,11 @@ on:
|
|
7
7
|
workflow_run: # Allows you to run this workflow when another workflow is run
|
8
8
|
types: [completed]
|
9
9
|
workflows:
|
10
|
-
-
|
11
|
-
-
|
10
|
+
- 'Daily TX Pull'
|
11
|
+
- 'Daily Help Update'
|
12
12
|
|
13
13
|
concurrency:
|
14
|
-
group:
|
14
|
+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
|
15
15
|
cancel-in-progress: true
|
16
16
|
|
17
17
|
permissions:
|
@@ -28,8 +28,8 @@ jobs:
|
|
28
28
|
|
29
29
|
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
|
30
30
|
with:
|
31
|
-
cache:
|
32
|
-
node-version-file:
|
31
|
+
cache: 'npm'
|
32
|
+
node-version-file: '.nvmrc'
|
33
33
|
|
34
34
|
- name: Info
|
35
35
|
run: |
|
@@ -2,7 +2,7 @@ name: Lint commit messages
|
|
2
2
|
on: [pull_request]
|
3
3
|
|
4
4
|
concurrency:
|
5
|
-
group:
|
5
|
+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.sha }}'
|
6
6
|
|
7
7
|
jobs:
|
8
8
|
commitlint:
|
@@ -4,10 +4,10 @@ on:
|
|
4
4
|
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
|
5
5
|
schedule:
|
6
6
|
# daily-help-update (e.g., daily at 5 AM UTC)
|
7
|
-
- cron:
|
7
|
+
- cron: '0 5 * * *'
|
8
8
|
|
9
9
|
concurrency:
|
10
|
-
group:
|
10
|
+
group: '${{ github.workflow }}'
|
11
11
|
cancel-in-progress: true
|
12
12
|
|
13
13
|
permissions:
|
@@ -24,8 +24,8 @@ jobs:
|
|
24
24
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
25
25
|
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
|
26
26
|
with:
|
27
|
-
cache:
|
28
|
-
node-version-file:
|
27
|
+
cache: 'npm'
|
28
|
+
node-version-file: '.nvmrc'
|
29
29
|
|
30
30
|
- name: Install dependencies
|
31
31
|
run: |
|
@@ -4,10 +4,10 @@ on:
|
|
4
4
|
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
|
5
5
|
schedule:
|
6
6
|
# daily-tx-pull (e.g., daily at 3 AM UTC)
|
7
|
-
- cron:
|
7
|
+
- cron: '0 3 * * *'
|
8
8
|
|
9
9
|
concurrency:
|
10
|
-
group:
|
10
|
+
group: '${{ github.workflow }}'
|
11
11
|
cancel-in-progress: true
|
12
12
|
|
13
13
|
permissions:
|
@@ -28,8 +28,8 @@ jobs:
|
|
28
28
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
29
29
|
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
|
30
30
|
with:
|
31
|
-
cache:
|
32
|
-
node-version-file:
|
31
|
+
cache: 'npm'
|
32
|
+
node-version-file: '.nvmrc'
|
33
33
|
|
34
34
|
- name: Install dependencies
|
35
35
|
run: npm ci
|
@@ -1,9 +1,9 @@
|
|
1
|
-
name:
|
1
|
+
name: 'Signature Assistant'
|
2
2
|
on:
|
3
3
|
issue_comment:
|
4
4
|
types: [created]
|
5
5
|
pull_request_target:
|
6
|
-
types: [opened,closed,synchronize]
|
6
|
+
types: [opened, closed, synchronize]
|
7
7
|
|
8
8
|
permissions:
|
9
9
|
actions: write
|
@@ -15,7 +15,7 @@ jobs:
|
|
15
15
|
CLA-Assistant:
|
16
16
|
runs-on: ubuntu-latest
|
17
17
|
steps:
|
18
|
-
- name:
|
18
|
+
- name: 'CLA Assistant'
|
19
19
|
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
20
20
|
uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1
|
21
21
|
env:
|
package/.prettierignore
ADDED
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,20 @@
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [5.0.232](https://github.com/scratchfoundation/scratch-l10n/compare/v5.0.231...v5.0.232) (2025-05-07)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **deps:** lock file maintenance ([1e2db4a](https://github.com/scratchfoundation/scratch-l10n/commit/1e2db4aa1b943df6bcf4eacd9050cc2e30284887))
|
12
|
+
|
13
|
+
## [5.0.231](https://github.com/scratchfoundation/scratch-l10n/compare/v5.0.230...v5.0.231) (2025-05-05)
|
14
|
+
|
15
|
+
|
16
|
+
### Bug Fixes
|
17
|
+
|
18
|
+
* pull new editor translations from Transifex ([3d51731](https://github.com/scratchfoundation/scratch-l10n/commit/3d517315d4680bfb3232e8c28a3ee21960b81da3))
|
19
|
+
|
6
20
|
## [5.0.230](https://github.com/scratchfoundation/scratch-l10n/compare/v5.0.229...v5.0.230) (2025-05-04)
|
7
21
|
|
8
22
|
|
package/README.md
CHANGED
@@ -10,23 +10,23 @@ you would like to contribute translations, please sign up to translate on Transi
|
|
10
10
|
### Basic Use
|
11
11
|
|
12
12
|
```js
|
13
|
-
import locales, {localeData, isRtl} from 'scratch-l10n'
|
14
|
-
import editorMessages from 'scratch-l10n/locales/editor-messages'
|
13
|
+
import locales, { localeData, isRtl } from 'scratch-l10n'
|
14
|
+
import editorMessages from 'scratch-l10n/locales/editor-messages'
|
15
15
|
```
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
- `locales`: currently supported locales for the Scratch project
|
18
|
+
- `isRtl`: function that returns true if the locale is one that is written right-to-left
|
19
|
+
- `localeData`: locale data for the supported locales, in the format accepted by `addLocaleData` required by `react-intl`
|
20
|
+
- `editorMessages`: the actual message strings for all supported locales for a particular resource. `editorMessages`
|
21
21
|
collects all the strings for the interface, extensions and paint-editor.
|
22
22
|
|
23
23
|
### Useful Scripts
|
24
24
|
|
25
25
|
scratch-l10n provides:
|
26
26
|
|
27
|
-
|
27
|
+
- `build-i18n-src`: script that uses babel and plugins to extract all `FormattedMessage` strings for translation.
|
28
28
|
Combines the message from all the source files into one `en.json`
|
29
|
-
|
29
|
+
- `tx-push-src`: script to push the `en.json` file to Transifex. Requires that the environment variable `TX_TOKEN` is
|
30
30
|
set with a value that has developer access to the Scratch projects on Transifex (i.e. Scratch Team only)
|
31
31
|
|
32
32
|
### Versioning
|
@@ -50,12 +50,12 @@ specification.
|
|
50
50
|
|
51
51
|
Here's a quick introduction:
|
52
52
|
|
53
|
-
|
53
|
+
- Prefix your commit subject with `fix:` if it fixes a bug but doesn't add any new functionality and doesn't change
|
54
54
|
the API.
|
55
|
-
|
56
|
-
|
55
|
+
- Prefix your commit subject with `feat:` if it adds new functionality but maintains backwards compatibility.
|
56
|
+
- Include `BREAKING CHANGE:` as a footer in your commit body, or add `!` to the commit subject, if the change breaks
|
57
57
|
compatibility with existing code.
|
58
|
-
|
58
|
+
- Other prefixes, such as `chore:`, `docs:`, etc., are allowed but will not change the version or cause a new release.
|
59
59
|
These should only be used for changes that do not affect functionality.
|
60
60
|
|
61
61
|
### Example commit messages
|
package/commitlint.config.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
}
|
2
|
+
extends: ['@commitlint/config-conventional'],
|
3
|
+
ignores: [message => message.startsWith('chore(release):')],
|
4
|
+
}
|