auto-lang 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -6
- package/package.json +1 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
@@ -17,7 +17,7 @@ You could either install the package and add a script to `package.json` or use t
|
|
17
17
|
|
18
18
|
### 2. Using a script in `package.json`
|
19
19
|
|
20
|
-
```json
|
20
|
+
```json
|
21
21
|
{
|
22
22
|
"scripts": {
|
23
23
|
"gen-lang": "auto-lang [options]"
|
@@ -46,7 +46,7 @@ You can also pass `--dir <directory>` to change the folder that contains your la
|
|
46
46
|
|
47
47
|
There is a file `en.json` in the translations folder
|
48
48
|
|
49
|
-
```json
|
49
|
+
```json
|
50
50
|
{
|
51
51
|
"GENERAL": {
|
52
52
|
"OK": "OK",
|
@@ -72,7 +72,7 @@ Two files have been created; `fr.json` and `es.json` in the `translations` folde
|
|
72
72
|
| | +-- fr.json
|
73
73
|
| | +-- es.json
|
74
74
|
|
75
|
-
```json
|
75
|
+
```json
|
76
76
|
/* fr.json */
|
77
77
|
|
78
78
|
{
|
@@ -90,7 +90,7 @@ Two files have been created; `fr.json` and `es.json` in the `translations` folde
|
|
90
90
|
}
|
91
91
|
```
|
92
92
|
|
93
|
-
```json
|
93
|
+
```json
|
94
94
|
/* es.json */
|
95
95
|
|
96
96
|
{
|
@@ -122,7 +122,7 @@ This will generate a `GlobalTranslation` type based on the structure of the `tra
|
|
122
122
|
| | +-- fr.json
|
123
123
|
| | +-- es.json
|
124
124
|
|
125
|
-
```ts
|
125
|
+
```ts
|
126
126
|
/* translations/types/index.ts */
|
127
127
|
|
128
128
|
type NestedKeyOf<ObjectType extends object> = {
|
@@ -156,7 +156,7 @@ interface GENERAL {
|
|
156
156
|
|
157
157
|
Now you should be able to use `GlobalTranslation` in your code.
|
158
158
|
|
159
|
-
```ts
|
159
|
+
```ts
|
160
160
|
import { GlobalTranslation } from './translations/types';
|
161
161
|
|
162
162
|
const translate = (key: GlobalTranslation) => {
|
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.7';
|
18
18
|
|
19
19
|
const program = new Command();
|
20
20
|
const nodeMajVer = parseInt(process.version.substring(1).split('.')[0]);
|