opticore-translator 1.0.10 → 1.0.12
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/dist/index.cjs +7 -7
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -7
- package/example/index.ts +1 -0
- package/package.json +5 -5
- package/tsconfig.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -55,13 +55,13 @@ var TranslationLoader = class {
|
|
|
55
55
|
try {
|
|
56
56
|
this.translations[locale] = JSON.parse(import_fs.default.readFileSync(filePath, "utf-8"));
|
|
57
57
|
} catch (error) {
|
|
58
|
-
this.loggerConfig.error(
|
|
59
|
-
error.message,
|
|
60
|
-
`Error loading translations for ${locale}`,
|
|
61
|
-
"Translation error",
|
|
62
|
-
error.stack,
|
|
63
|
-
import_opticore_http_response.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
64
|
-
);
|
|
58
|
+
this.loggerConfig.error({
|
|
59
|
+
message: error.message,
|
|
60
|
+
title: `Error loading translations for ${locale}`,
|
|
61
|
+
errorType: "Translation error",
|
|
62
|
+
stackTrace: error.stack,
|
|
63
|
+
httpCodeValue: import_opticore_http_response.HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
64
|
+
});
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
});
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -19,13 +19,13 @@ var TranslationLoader = class {
|
|
|
19
19
|
try {
|
|
20
20
|
this.translations[locale] = JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
21
21
|
} catch (error) {
|
|
22
|
-
this.loggerConfig.error(
|
|
23
|
-
error.message,
|
|
24
|
-
`Error loading translations for ${locale}`,
|
|
25
|
-
"Translation error",
|
|
26
|
-
error.stack,
|
|
27
|
-
HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
28
|
-
);
|
|
22
|
+
this.loggerConfig.error({
|
|
23
|
+
message: error.message,
|
|
24
|
+
title: `Error loading translations for ${locale}`,
|
|
25
|
+
errorType: "Translation error",
|
|
26
|
+
stackTrace: error.stack,
|
|
27
|
+
httpCodeValue: HttpStatusCode.INTERNAL_SERVER_ERROR
|
|
28
|
+
});
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
});
|
package/example/index.ts
CHANGED
|
@@ -4,5 +4,6 @@ import path from "path";
|
|
|
4
4
|
((): void => {
|
|
5
5
|
TranslationLoader.loadTranslations(path.join('src', 'utils', 'translations'));
|
|
6
6
|
console.log("path is :", path.join(process.cwd(), 'src', 'utils', 'translations'));
|
|
7
|
+
TranslationLoader.t("mongoServerError", "en", { dbHost: '127.0.0.1' })
|
|
7
8
|
console.log("mongoServerError is :", TranslationLoader.t("mongoServerError", "en", { dbHost: '127.0.0.1' }));
|
|
8
9
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opticore-translator",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "opticore translator to translate according language",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"ansi-colors": "^4.1.3",
|
|
29
29
|
"chalk": "^5.4.1",
|
|
30
|
-
"opticore-env-access": "^1.0.
|
|
31
|
-
"opticore-http-response": "^1.0.
|
|
32
|
-
"opticore-logger": "^1.0.
|
|
33
|
-
"tsx": "^4.
|
|
30
|
+
"opticore-env-access": "^1.0.13",
|
|
31
|
+
"opticore-http-response": "^1.0.9",
|
|
32
|
+
"opticore-logger": "^1.0.28",
|
|
33
|
+
"tsx": "^4.21.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^22.13.5",
|
package/tsconfig.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"noImplicitAny": true,
|
|
5
5
|
"esModuleInterop": true,
|
|
6
6
|
"strictNullChecks": true,
|
|
7
|
-
"module": "
|
|
7
|
+
"module": "ESNext",
|
|
8
8
|
"pretty": true,
|
|
9
|
-
"target": "
|
|
9
|
+
"target": "ESNext",
|
|
10
10
|
"moduleResolution": "node",
|
|
11
11
|
"declaration": true,
|
|
12
12
|
"isolatedModules": true,
|