auto-translate-json-library 1.2.1 → 1.2.2

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 CHANGED
@@ -38,7 +38,7 @@ node node_modules\auto-translate-json-library\index.js --pivotTranslation=./tran
38
38
  if you clone repo you can use the following commands
39
39
 
40
40
  ```shell
41
- npm run i
41
+ npm i
42
42
  npm run build
43
43
  node .\build\src\index.js --pivotTranslation=./tests/translations/en.json
44
44
  ```
package/aws.js CHANGED
@@ -120,7 +120,7 @@ class AWSTranslate {
120
120
  result = translation.TranslatedText;
121
121
  }
122
122
  catch (error) {
123
- console.log(error);
123
+ console.error(error);
124
124
  return "";
125
125
  }
126
126
  result = util_1.Util.replaceArgumentsWithNumbers(args, result);
package/google.js CHANGED
@@ -149,7 +149,7 @@ class GoogleTranslate {
149
149
  if (error.message === "Invalid Value") {
150
150
  message = `Invalid Locale ${targetLocale}`;
151
151
  }
152
- console.log(message);
152
+ console.error(message);
153
153
  return message;
154
154
  }
155
155
  return "error";
package/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.translate = void 0;
4
- const process_1 = require("process");
5
4
  const lib_1 = require("./lib");
6
5
  Object.defineProperty(exports, "translate", { enumerable: true, get: function () { return lib_1.translate; } });
7
6
  const config = {};
@@ -47,7 +46,6 @@ function setConfigurationFromCLI() {
47
46
  else {
48
47
  console.log(argv);
49
48
  console.log("Please provide a pivot translation");
50
- (0, process_1.exit)(1);
51
49
  }
52
50
  }
53
51
  function setDefaultConfiguration() {
package/openai.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { ITranslate } from "./translate.interface";
2
2
  export declare class OpenAITranslate implements ITranslate {
3
3
  private apiKey;
4
- private endpoint;
5
4
  private openai;
6
5
  constructor(apiKey: string);
7
6
  isValidLocale(targetLocale: string): boolean;
package/openai.js CHANGED
@@ -125,7 +125,6 @@ const supportedLanguages = {
125
125
  class OpenAITranslate {
126
126
  constructor(apiKey) {
127
127
  this.apiKey = apiKey;
128
- this.endpoint = "https://api.cognitive.microsofttranslator.com";
129
128
  const configuration = new openai_1.Configuration({
130
129
  apiKey: apiKey,
131
130
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-translate-json-library",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Automatically translates JSON language files to other languages using Google Translate,AWS,Azure,DeepL or OpenAI",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -47,25 +47,25 @@
47
47
  }
48
48
  },
49
49
  "devDependencies": {
50
- "@types/jest": "29.5.1",
51
- "@types/node": "20.2.0",
50
+ "@types/jest": "29.5.2",
51
+ "@types/node": "20.3.1",
52
52
  "@types/yargs": "17.0.24",
53
53
  "husky": "8.0.3",
54
54
  "jest": "^29.5.0",
55
55
  "prettier": "2.8.8",
56
56
  "pretty-quick": "3.1.3",
57
- "rome": "^12.1.1",
58
- "ts-jest": "^29.1.0",
57
+ "rome": "12.1.3",
58
+ "ts-jest": "29.1.0",
59
59
  "ts-node": "10.9.1",
60
- "typescript": "5.0.4"
60
+ "typescript": "5.1.3"
61
61
  },
62
62
  "dependencies": {
63
- "@aws-sdk/client-translate": "3.332.0",
63
+ "@aws-sdk/client-translate": "3.359.0",
64
64
  "@google-cloud/translate": "7.2.1",
65
65
  "axios": "1.4.0",
66
- "dotenv": "16.0.3",
66
+ "dotenv": "16.3.1",
67
67
  "form-data": "4.0.0",
68
- "openai": "3.2.1",
68
+ "openai": "3.3.0",
69
69
  "uuid": "9.0.0",
70
70
  "yargs": "17.7.2"
71
71
  }
package/util.js CHANGED
@@ -35,7 +35,7 @@ class Util {
35
35
  return { args, text };
36
36
  }
37
37
  }
38
+ exports.Util = Util;
38
39
  Util._startDelimiter = "{";
39
40
  Util._endDelimiter = "}";
40
41
  Util.pattern = new RegExp(`${Util._startDelimiter}(.*?)${Util._endDelimiter}`, "g");
41
- exports.Util = Util;