auto-lang 1.0.7 → 1.0.8
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/README.md +36 -28
- package/package.json +1 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
@@ -16,16 +16,23 @@ You could either install the package and add a script to `package.json` or use t
|
|
16
16
|
$ npx auto-lang [options]
|
17
17
|
|
18
18
|
### 2. Using a script in `package.json`
|
19
|
-
|
20
19
|
```json
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
}
|
20
|
+
{
|
21
|
+
"scripts": {
|
22
|
+
"gen-lang": "auto-lang [options]"
|
25
23
|
}
|
24
|
+
}
|
26
25
|
```
|
27
26
|
|
28
|
-
|
27
|
+
Now, in the terminal run:
|
28
|
+
|
29
|
+
$ npm run gen-lang
|
30
|
+
|
31
|
+
Or, using yarn:
|
32
|
+
|
33
|
+
$ yarn gen-lang
|
34
|
+
|
35
|
+
**Note:** You can give your script any name you wish. Also, replace `[options]` with any of the options below.
|
29
36
|
|
30
37
|
#### Options
|
31
38
|
|
@@ -62,6 +69,7 @@ There is a file `en.json` in the translations folder
|
|
62
69
|
}
|
63
70
|
```
|
64
71
|
Get translation files for French (fr) and Spanish (es).
|
72
|
+
|
65
73
|
$ npx auto-lang --from en --to fr es
|
66
74
|
|
67
75
|
Two files have been created; `fr.json` and `es.json` in the `translations` folder.
|
@@ -76,17 +84,17 @@ Two files have been created; `fr.json` and `es.json` in the `translations` folde
|
|
76
84
|
/* fr.json */
|
77
85
|
|
78
86
|
{
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
87
|
+
"GENERAL": {
|
88
|
+
"OK": "D'ACCORD",
|
89
|
+
"CANCEL": "Annuler",
|
90
|
+
"ACCEPT": "Accepter",
|
91
|
+
"DECLINE": "Déclin"
|
92
|
+
},
|
93
|
+
"GREETINGS": {
|
94
|
+
"HELLO": "Bonjour",
|
95
|
+
"HI": "Salut",
|
96
|
+
"GOOD_MORNING": "Bonjour"
|
97
|
+
}
|
90
98
|
}
|
91
99
|
```
|
92
100
|
|
@@ -94,17 +102,17 @@ Two files have been created; `fr.json` and `es.json` in the `translations` folde
|
|
94
102
|
/* es.json */
|
95
103
|
|
96
104
|
{
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
105
|
+
"GENERAL": {
|
106
|
+
"OK": "OK",
|
107
|
+
"CANCEL": "Cancelar",
|
108
|
+
"ACCEPT": "Aceptar",
|
109
|
+
"DECLINE": "Rechazar"
|
110
|
+
},
|
111
|
+
"GREETINGS": {
|
112
|
+
"HELLO": "Hola",
|
113
|
+
"HI": "Hola",
|
114
|
+
"GOOD_MORNING": "Buenos dias"
|
115
|
+
}
|
108
116
|
}
|
109
117
|
```
|
110
118
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -14,7 +14,7 @@ import { Logger } from './utils/Logger.mjs';
|
|
14
14
|
import chalk from 'chalk';
|
15
15
|
import { validateOptions } from './utils/validation.mjs';
|
16
16
|
|
17
|
-
const APP_VERSION = '1.0.
|
17
|
+
const APP_VERSION = '1.0.8';
|
18
18
|
|
19
19
|
const program = new Command();
|
20
20
|
const nodeMajVer = parseInt(process.version.substring(1).split('.')[0]);
|