adapt-authoring-lang 1.0.1 → 1.0.3
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/.github/workflows/releases.yml +9 -2
- package/bin/check.js +1 -1
- package/lib/LangModule.js +1 -1
- package/package.json +9 -9
|
@@ -3,10 +3,16 @@ on:
|
|
|
3
3
|
push:
|
|
4
4
|
branches:
|
|
5
5
|
- master
|
|
6
|
+
|
|
6
7
|
jobs:
|
|
7
8
|
release:
|
|
8
9
|
name: Release
|
|
9
10
|
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write # to be able to publish a GitHub release
|
|
13
|
+
issues: write # to be able to comment on released issues
|
|
14
|
+
pull-requests: write # to be able to comment on released pull requests
|
|
15
|
+
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
|
|
10
16
|
steps:
|
|
11
17
|
- name: Checkout
|
|
12
18
|
uses: actions/checkout@v3
|
|
@@ -16,10 +22,11 @@ jobs:
|
|
|
16
22
|
uses: actions/setup-node@v3
|
|
17
23
|
with:
|
|
18
24
|
node-version: 'lts/*'
|
|
25
|
+
- name: Update npm
|
|
26
|
+
run: npm install -g npm@latest
|
|
19
27
|
- name: Install dependencies
|
|
20
28
|
run: npm ci
|
|
21
29
|
- name: Release
|
|
22
30
|
env:
|
|
23
31
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
24
|
-
|
|
25
|
-
run: npx semantic-release
|
|
32
|
+
run: npx semantic-release
|
package/bin/check.js
CHANGED
|
@@ -52,7 +52,7 @@ async function getUsedStrings (translatedStrings) {
|
|
|
52
52
|
translatedKeys.forEach(k => {
|
|
53
53
|
translatedStrings[k] = contents.includes(k) ? true : undefined
|
|
54
54
|
})
|
|
55
|
-
const match = contents.matchAll(/['|"|`|](app\.[\w
|
|
55
|
+
const match = contents.matchAll(/['|"|`|](app\.[\w|.]+)\W/g)
|
|
56
56
|
if (match) {
|
|
57
57
|
for (const m of match) {
|
|
58
58
|
const key = m[1]
|
package/lib/LangModule.js
CHANGED
|
@@ -183,7 +183,7 @@ class LangModule extends AbstractModule {
|
|
|
183
183
|
* @returns The translated error (if passed error is not an instance of AdaptError, the original value will be returned)
|
|
184
184
|
*/
|
|
185
185
|
translateError (lang, error) {
|
|
186
|
-
return error
|
|
186
|
+
return error?.constructor.name.endsWith('Error') ? this.translate(lang, `error.${error.code}`, error.data ?? error) : error
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-authoring-lang",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Localisation for the Adapt authoring tool",
|
|
5
5
|
"homepage": "https://github.com/taylortom/adapt-authoring-lang",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"glob": "^11.0.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"
|
|
18
|
-
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
17
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
19
18
|
"@semantic-release/git": "^10.0.1",
|
|
20
|
-
"@semantic-release/github": "^
|
|
21
|
-
"@semantic-release/npm": "^
|
|
22
|
-
"@semantic-release/release-notes-generator": "^
|
|
23
|
-
"conventional-changelog-eslint": "^
|
|
24
|
-
"semantic-release": "^
|
|
25
|
-
"semantic-release-replace-plugin": "^1.2.7"
|
|
19
|
+
"@semantic-release/github": "^12.0.2",
|
|
20
|
+
"@semantic-release/npm": "^13.1.2",
|
|
21
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
22
|
+
"conventional-changelog-eslint": "^6.0.0",
|
|
23
|
+
"semantic-release": "^25.0.2",
|
|
24
|
+
"semantic-release-replace-plugin": "^1.2.7",
|
|
25
|
+
"standard": "^17.1.0"
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
28
28
|
"plugins": [
|