auto-translate-json-library 1.3.2 → 1.3.4
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 +13 -9
- package/build/package.json +1 -1
- package/build/src/bin/cli.js +2 -2
- package/package.json +1 -1
package/README.MD
CHANGED
|
@@ -4,10 +4,10 @@ This project is used in, (and refactored from) excellent vs code extension
|
|
|
4
4
|
Auto Translate JSON
|
|
5
5
|
<https://marketplace.visualstudio.com/items?itemName=JeffJorczak.auto-translate-json>
|
|
6
6
|
|
|
7
|
-
It
|
|
7
|
+
It opens posibility to use Auto Taransation JSON
|
|
8
8
|
not just in vs code but as a library and command line interface
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Use as library
|
|
11
11
|
|
|
12
12
|
```shell
|
|
13
13
|
npm i auto-translate-json-library
|
|
@@ -28,7 +28,7 @@ await translate(pivotTranslation, config) ;
|
|
|
28
28
|
// translation for example fr.json in same folder as pivotTranslation should contain the translations
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
## Use as command line tool
|
|
32
32
|
|
|
33
33
|
first install it
|
|
34
34
|
|
|
@@ -38,8 +38,6 @@ npm i auto-translate-json-library
|
|
|
38
38
|
|
|
39
39
|
do not forget to set translation engine parameters in environment variables or .env file
|
|
40
40
|
|
|
41
|
-
```shell
|
|
42
|
-
|
|
43
41
|
```shell
|
|
44
42
|
node node_modules\auto-translate-json-library\index.js --pivotTranslation=./translations/en.json
|
|
45
43
|
```
|
|
@@ -52,9 +50,9 @@ npm run build
|
|
|
52
50
|
node .\build\src\index.js --pivotTranslation=./tests/translations/en.json
|
|
53
51
|
```
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
# CLI PARAMETERS
|
|
53
|
+
## CLI PARAMETERS
|
|
57
54
|
|
|
55
|
+
``` config
|
|
58
56
|
mode,
|
|
59
57
|
file or folder,
|
|
60
58
|
default is file
|
|
@@ -133,9 +131,15 @@ ATJ_IGNORE_PREFIX=
|
|
|
133
131
|
|
|
134
132
|
You can also use .env file to store environment variables
|
|
135
133
|
|
|
136
|
-
There is also improved version of CLI for example:
|
|
134
|
+
There is also improved version of CLI (since version 1.3.2) for example:
|
|
137
135
|
|
|
138
136
|
```shell
|
|
137
|
+
npm install -g auto-translate-library
|
|
139
138
|
atj tests/translations/en.json -e google -m file
|
|
140
139
|
```
|
|
141
|
-
|
|
140
|
+
|
|
141
|
+
You can also use it with npx
|
|
142
|
+
|
|
143
|
+
```shell
|
|
144
|
+
npx auto-translate-library tests/translations/en.json -e google -m file
|
|
145
|
+
```
|
package/build/package.json
CHANGED
package/build/src/bin/cli.js
CHANGED
|
@@ -13,12 +13,12 @@ require("dotenv").config();
|
|
|
13
13
|
// Define a function to display the help message
|
|
14
14
|
function displayHelp() {
|
|
15
15
|
console.log(`🔨 Auto translate json cli v${package_json_1.version}`);
|
|
16
|
-
console.log(
|
|
16
|
+
console.log("Usage: atj [options] <inputPath>");
|
|
17
17
|
console.log("");
|
|
18
18
|
console.log("Options:");
|
|
19
19
|
console.log(" --help, -h Display this help message");
|
|
20
20
|
console.log(" --mode, -m <mode> Specify the translation mode:file or folder");
|
|
21
|
-
console.log(" --engine, -e <engine> Specify the translation engine:aws,azure,google,
|
|
21
|
+
console.log(" --engine, -e <engine> Specify the translation engine:aws,azure,google,deepLPro,deepLFree or openai");
|
|
22
22
|
console.log(" --sourceLocale, -s <locale> Specify the source locale");
|
|
23
23
|
console.log(" --keepTranslations, --no-keepTranslations Keep or retranslate existing translations");
|
|
24
24
|
console.log(" --keepExtraTranslations, --no-keepExtraTranslations Keep or remove extra translations");
|
package/package.json
CHANGED