auto-translate-json-library 1.4.8 → 1.4.9

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-translate-json-library",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "Automatically translates JSON language files to other languages using Google Translate,AWS,Azure,DeepL,OpenAI or local OpenAI compatible server",
5
5
  "main": "./build/src/index.js",
6
6
  "bin": {
@@ -18,8 +18,8 @@
18
18
  "build:run": "ts-node ./build/src/index.js --pivotTranslation=./tests/translations/en.json",
19
19
  "debug": "ts-node src/index.ts --pivotTranslation=./tests/translations/en.json",
20
20
  "lint": "biome check ./src",
21
- "lint-fix": "biome check ./src --apply",
22
- "lint-fix-all": "biome check --apply-unsafe ./src",
21
+ "lint-fix": "biome check ./src --write",
22
+ "lint-fix-all": "biome check --write --unsafe ./src",
23
23
  "format": "biome format ./src",
24
24
  "format-fix": "biome format ./src --write",
25
25
  "start": "ts-node src/index.ts"
@@ -53,24 +53,24 @@
53
53
  ],
54
54
  "license": "MIT",
55
55
  "devDependencies": {
56
- "@biomejs/biome": "1.9.4",
56
+ "@biomejs/biome": "2.1.2",
57
57
  "@types/minimist": "1.2.5",
58
- "@types/node": "22.10.10",
58
+ "@types/node": "24.0.15",
59
59
  "@types/yargs": "17.0.33",
60
60
  "ts-node": "10.9.2",
61
- "typescript": "5.7.3"
61
+ "typescript": "5.8.3"
62
62
  },
63
63
  "dependencies": {
64
- "@aws-sdk/client-translate": "3.734.0",
65
- "@google-cloud/translate": "8.5.0",
66
- "axios": "1.7.9",
67
- "deepl-node": "1.16.0",
68
- "dotenv": "16.4.7",
69
- "form-data": "4.0.1",
64
+ "@aws-sdk/client-translate": "3.848.0",
65
+ "@google-cloud/translate": "9.2.0",
66
+ "axios": "1.10.0",
67
+ "deepl-node": "1.19.0",
68
+ "dotenv": "17.2.0",
69
+ "form-data": "4.0.4",
70
70
  "minimist": "1.2.8",
71
- "openai": "4.80.1",
71
+ "openai": "5.10.1",
72
72
  "picocolors": "1.1.1",
73
- "uuid": "11.0.5",
74
- "yargs": "17.7.2"
73
+ "uuid": "11.1.0",
74
+ "yargs": "18.0.0"
75
75
  }
76
76
  }
@@ -99,7 +99,9 @@ class DeepLTranslate {
99
99
  let args;
100
100
  ({ args, text } = util_1.Util.replaceContextVariables(text));
101
101
  let result = "";
102
- const translator = new deepl.Translator(this.subscriptionKey);
102
+ const translator = new deepl.Translator(this.subscriptionKey, {
103
+ serverUrl: this.endpoint,
104
+ });
103
105
  const translation = yield translator.translateText(text, sourceLocale, targetLocale);
104
106
  result = translation.text;
105
107
  result = util_1.Util.replaceArgumentsWithNumbers(args, result);
@@ -79,7 +79,7 @@ class Files {
79
79
  return fileName.replace(".json", "");
80
80
  }
81
81
  getTargetLocales() {
82
- const locales = new Array();
82
+ const locales = [];
83
83
  const files = fs.readdirSync(this.folderPath);
84
84
  for (const file of files) {
85
85
  const locale = this.getLocaleFromFilename(file);
package/build/src/lib.js CHANGED
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // The module 'vscode' contains the VS Code extensibility API
3
+ // Import the module and reference it with the alias vscode in your code below
2
4
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
5
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
6
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10,13 +12,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
12
  };
11
13
  Object.defineProperty(exports, "__esModule", { value: true });
12
14
  exports.translate = translate;
13
- // The module 'vscode' contains the VS Code extensibility API
14
- // Import the module and reference it with the alias vscode in your code below
15
- const files_1 = require("./files");
16
- const folderFiles_1 = require("./folderFiles");
17
15
  const aws_1 = require("./aws");
18
16
  const azure_1 = require("./azure");
19
17
  const deepl_1 = require("./deepl");
18
+ const files_1 = require("./files");
19
+ const folderFiles_1 = require("./folderFiles");
20
20
  const google_1 = require("./google");
21
21
  const openai_1 = require("./openai");
22
22
  const util_1 = require("./util");
@@ -119,7 +119,7 @@ const readFiles = (filePath, mode) => {
119
119
  function recurseNode(source_1, original_1, keepTranslations_1, keepExtras_1, sourceLocale_1, locale_1, translateEngine_1) {
120
120
  return __awaiter(this, arguments, void 0, function* (source, original, keepTranslations, keepExtras, sourceLocale, locale, translateEngine, ignorePrefix = "", isArray = false) {
121
121
  var _a;
122
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
122
+ // biome-ignore lint/suspicious/noExplicitAny: array and object types are used for flexibility
123
123
  const destination = isArray ? [] : {};
124
124
  // defaults
125
125
  if (keepTranslations === null) {
package/build/src/util.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Util = void 0;
4
- // biome-ignore lint/complexity/noStaticOnlyClass: <explanation>
4
+ // biome-ignore lint/complexity/noStaticOnlyClass: This class is used for utility functions that do not require instantiation
5
5
  class Util {
6
6
  static set startDelimiter(value) {
7
7
  Util._startDelimiter = value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-translate-json-library",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "Automatically translates JSON language files to other languages using Google Translate,AWS,Azure,DeepL,OpenAI or local OpenAI compatible server",
5
5
  "main": "./build/src/index.js",
6
6
  "bin": {
@@ -18,8 +18,8 @@
18
18
  "build:run": "ts-node ./build/src/index.js --pivotTranslation=./tests/translations/en.json",
19
19
  "debug": "ts-node src/index.ts --pivotTranslation=./tests/translations/en.json",
20
20
  "lint": "biome check ./src",
21
- "lint-fix": "biome check ./src --apply",
22
- "lint-fix-all": "biome check --apply-unsafe ./src",
21
+ "lint-fix": "biome check ./src --write",
22
+ "lint-fix-all": "biome check --write --unsafe ./src",
23
23
  "format": "biome format ./src",
24
24
  "format-fix": "biome format ./src --write",
25
25
  "start": "ts-node src/index.ts"
@@ -53,24 +53,24 @@
53
53
  ],
54
54
  "license": "MIT",
55
55
  "devDependencies": {
56
- "@biomejs/biome": "1.9.4",
56
+ "@biomejs/biome": "2.1.2",
57
57
  "@types/minimist": "1.2.5",
58
- "@types/node": "22.10.10",
58
+ "@types/node": "24.0.15",
59
59
  "@types/yargs": "17.0.33",
60
60
  "ts-node": "10.9.2",
61
- "typescript": "5.7.3"
61
+ "typescript": "5.8.3"
62
62
  },
63
63
  "dependencies": {
64
- "@aws-sdk/client-translate": "3.734.0",
65
- "@google-cloud/translate": "8.5.0",
66
- "axios": "1.7.9",
67
- "deepl-node": "1.16.0",
68
- "dotenv": "16.4.7",
69
- "form-data": "4.0.1",
64
+ "@aws-sdk/client-translate": "3.848.0",
65
+ "@google-cloud/translate": "9.2.0",
66
+ "axios": "1.10.0",
67
+ "deepl-node": "1.19.0",
68
+ "dotenv": "17.2.0",
69
+ "form-data": "4.0.4",
70
70
  "minimist": "1.2.8",
71
- "openai": "4.80.1",
71
+ "openai": "5.10.1",
72
72
  "picocolors": "1.1.1",
73
- "uuid": "11.0.5",
74
- "yargs": "17.7.2"
73
+ "uuid": "11.1.0",
74
+ "yargs": "18.0.0"
75
75
  }
76
76
  }