@kununu/phraseapp-cli 4.0.0-beta.4 → 4.0.1
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.
|
@@ -18,6 +18,15 @@ Add to ```package.json```
|
|
|
18
18
|
"check-translations": "SOURCE_DIR=src node ./node_modules/@kununu/phraseapp-cli/check-translations.js",
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
### Add `report-check-translations` in .gitignore
|
|
22
|
+
|
|
23
|
+
Add to ```.gitignore````
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
# Check Translations Report Folder
|
|
27
|
+
report-check-translations/*
|
|
28
|
+
```
|
|
29
|
+
|
|
21
30
|
## Configuration file
|
|
22
31
|
|
|
23
32
|
You have to add to the ```.phraseapp.json``` file a new var dynamicKeys
|
|
@@ -50,6 +59,17 @@ You have to add to the ```.phraseapp.json``` file a new var dynamicKeys
|
|
|
50
59
|
}
|
|
51
60
|
```
|
|
52
61
|
|
|
62
|
+
## Structure
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
/
|
|
66
|
+
├─ check-translations.js # Initial file
|
|
67
|
+
├─ possible_dynamic_keys.json # Automatically created file indicating in which files we might have dynamic keys.
|
|
68
|
+
├─ missing_keys.json # Automatically created file indicating the keys that exist in the app but are not translated.
|
|
69
|
+
├─ not_used_keys.json # Automatically created file indicating the keys that are not being used in the app.
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
|
|
53
73
|
## License
|
|
54
74
|
|
|
55
75
|
Apache-2.0 © [kununu](https://kununu.com)
|
package/check-translations.js
CHANGED
|
@@ -35,8 +35,10 @@ function extractTranslationKeys() {
|
|
|
35
35
|
CallExpression({node}) {
|
|
36
36
|
if (
|
|
37
37
|
node.callee &&
|
|
38
|
-
node.callee.property &&
|
|
39
|
-
|
|
38
|
+
((node.callee.property &&
|
|
39
|
+
['formatMessage'].includes(node.callee.property.name)) ||
|
|
40
|
+
(node.callee.name &&
|
|
41
|
+
['formatMessage'].includes(node.callee.name)))
|
|
40
42
|
) {
|
|
41
43
|
const firstArg = node.arguments[0];
|
|
42
44
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kununu/phraseapp-cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "kununu",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"lint": "eslint . --ext jsx --ext js --ext tsx --ext ts --ignore-path .eslintignore --max-warnings 10
|
|
9
|
+
"lint": "eslint . --ext jsx --ext js --ext tsx --ext ts --ignore-path .eslintignore --max-warnings 10"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@babel/parser": "^7.26.10",
|