@runnerpro/backend 1.0.15 → 1.0.16
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.
|
@@ -11,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.sendMail = void 0;
|
|
13
13
|
const nodemailer = require('nodemailer');
|
|
14
|
-
const path = require('path');
|
|
15
14
|
const transporter = nodemailer.createTransport({
|
|
16
15
|
service: 'gmail',
|
|
17
16
|
auth: {
|
|
@@ -26,7 +26,12 @@ const translate = (text, { fromLanguage, toLanguage, }) => __awaiter(void 0, voi
|
|
|
26
26
|
targetLanguageCode: toLanguage,
|
|
27
27
|
};
|
|
28
28
|
const [response] = yield translationClient.translateText(request);
|
|
29
|
-
|
|
29
|
+
const translatedText = response.translations[0].translatedText;
|
|
30
|
+
// If the first letter of original text is uppercase, the translated text will be uppercase
|
|
31
|
+
if (text[0] === text[0].toUpperCase())
|
|
32
|
+
return translatedText[0].toUpperCase() + translatedText.slice(1);
|
|
33
|
+
else
|
|
34
|
+
return translatedText;
|
|
30
35
|
});
|
|
31
36
|
exports.translate = translate;
|
|
32
37
|
const useTranslation = (language, path) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendMail/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendMail/index.ts"],"names":[],"mappings":"AAUA,UAAU,IAAI;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,WAAW,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,QAAA,MAAM,QAAQ,0DAQX,IAAI,iBAwBN,CAAC;AA+EF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/translation/index.ts"],"names":[],"mappings":"AACA,QAAA,MAAQ,SAAS,KAAiC,CAAC;AAGnD,KAAK,cAAc,GAAG,MAAM,OAAO,SAAS,CAAC;AAE7C,QAAA,MAAM,SAAS,SACP,MAAM;kBAIO,cAAc;gBAAc,cAAc;MAC5D,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/translation/index.ts"],"names":[],"mappings":"AACA,QAAA,MAAQ,SAAS,KAAiC,CAAC;AAGnD,KAAK,cAAc,GAAG,MAAM,OAAO,SAAS,CAAC;AAE7C,QAAA,MAAM,SAAS,SACP,MAAM;kBAIO,cAAc;gBAAc,cAAc;MAC5D,QAAQ,MAAM,CAqBhB,CAAC;AAEF,QAAA,MAAM,cAAc,aAAc,MAAM,QAAQ,MAAM;cAExC,MAAM,iBAAiB,GAAG;CAevC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC"}
|