auto-translate-json-library 1.2.2 → 1.2.3
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/deepl.js +1 -1
- package/files.js +1 -1
- package/folderFiles.js +3 -3
- package/lib.js +1 -1
- package/package.json +2 -2
package/deepl.js
CHANGED
package/files.js
CHANGED
|
@@ -68,7 +68,7 @@ class Files {
|
|
|
68
68
|
getTargetLocales() {
|
|
69
69
|
const locales = new Array();
|
|
70
70
|
const files = fs.readdirSync(this.folderPath);
|
|
71
|
-
files.forEach((file) => {
|
|
71
|
+
files.forEach((file, _index, _array) => {
|
|
72
72
|
const locale = this.getLocaleFromFilename(file);
|
|
73
73
|
if (locale !== this.sourceLocale) {
|
|
74
74
|
locales.push(locale);
|
package/folderFiles.js
CHANGED
|
@@ -39,9 +39,9 @@ class FolderFiles {
|
|
|
39
39
|
getTargetLocales() {
|
|
40
40
|
const files = fs
|
|
41
41
|
.readdirSync(this.folderPath)
|
|
42
|
-
.map((folder) => path.basename(folder))
|
|
43
|
-
.map((locale) =>
|
|
44
|
-
.filter((x) => x); // do not want empty strings
|
|
42
|
+
.map((folder, _index, _array) => path.basename(folder))
|
|
43
|
+
.map((locale, _index, _array) => locale !== this.sourceLocale ? locale : "")
|
|
44
|
+
.filter((x, _index, _array) => x); // do not want empty strings
|
|
45
45
|
return files;
|
|
46
46
|
}
|
|
47
47
|
createFileName(locale) {
|
package/lib.js
CHANGED
|
@@ -78,7 +78,7 @@ function translate(sourceFile, config) {
|
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
// Iterate target Locales
|
|
81
|
-
files.targetLocales.forEach((targetLocale) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
files.targetLocales.forEach((targetLocale, _index, _array) => __awaiter(this, void 0, void 0, function* () {
|
|
82
82
|
try {
|
|
83
83
|
const isValid = yield translateEngine.isValidLocale(targetLocale);
|
|
84
84
|
if (!isValid) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auto-translate-json-library",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
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",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"rome": "12.1.3",
|
|
58
58
|
"ts-jest": "29.1.0",
|
|
59
59
|
"ts-node": "10.9.1",
|
|
60
|
-
"typescript": "5.1.
|
|
60
|
+
"@topce/typescript": "5.1.6"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@aws-sdk/client-translate": "3.359.0",
|